/test/language/agent/test_agent55.e

http://github.com/tybor/Liberty · Specman e · 73 lines · 38 code · 10 blank · 25 comment · 0 complexity · 4becb57995bb02d092fc827456543d4e MD5 · raw file

  1. -- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
  2. -- See the Copyright notice at the end of this file.
  3. --
  4. class TEST_AGENT55
  5. --
  6. -- From a bug report of Wolfgang Jansen on our mailing list.
  7. -- SZ:490:
  8. --
  9. insert
  10. EIFFELTEST_TOOLS
  11. create {}
  12. make
  13. feature {ANY}
  14. make
  15. local
  16. v: INTEGER
  17. do
  18. n_memory := 3
  19. func := agent func_run(n)
  20. assert(n_memory = 4)
  21. v := func.item([])
  22. assert(v = 3)
  23. assert(n_memory = 4)
  24. proc := agent proc_run(n)
  25. assert(n_memory = 5)
  26. proc.call([])
  27. assert(n_memory = 4)
  28. end
  29. n_memory: INTEGER
  30. n: INTEGER
  31. do
  32. Result := n_memory
  33. n_memory := n_memory + 1
  34. end
  35. func: FUNCTION[TUPLE, INTEGER]
  36. func_run (i: INTEGER): INTEGER
  37. do
  38. Result := i
  39. end
  40. proc: PROCEDURE[TUPLE]
  41. proc_run (i: INTEGER)
  42. do
  43. n_memory := i
  44. end
  45. end -- class TEST_AGENT55
  46. --
  47. -- ------------------------------------------------------------------------------------------------------------------------------
  48. -- Copyright notice below. Please read.
  49. --
  50. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  51. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  52. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  53. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  54. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  55. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  56. --
  57. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  58. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  59. --
  60. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  61. --
  62. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  63. -- ------------------------------------------------------------------------------------------------------------------------------