/test/language/agent/test_agent37.e

http://github.com/tybor/Liberty · Specman e · 66 lines · 36 code · 7 blank · 23 comment · 0 complexity · 800705f804961c340da84f59a22933cb 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_AGENT37
  5. -- SZ:232:
  6. -- for marking of reference arguments
  7. inherit
  8. EIFFELTEST_TOOLS
  9. create {}
  10. make
  11. feature {}
  12. make
  13. local
  14. mem: MEMORY
  15. do
  16. doit := agent foo(create {AUX_AGENT37})
  17. doit.call([])
  18. generate_garbage -- no error if this is commented out
  19. mem.collection_on
  20. mem.full_collect
  21. doit.call([])
  22. end
  23. doit: PROCEDURE[TUPLE]
  24. foo (x: AUX_AGENT37)
  25. do
  26. assert(not x.is_disposed)
  27. end
  28. generate_garbage
  29. local
  30. i: INTEGER; s: STRING
  31. do
  32. from
  33. i := 1
  34. until
  35. i = 10000
  36. loop
  37. create s.make_from_string("quark ends here")
  38. i := i + 1
  39. end
  40. end
  41. end -- class TEST_AGENT37
  42. --
  43. -- ------------------------------------------------------------------------------------------------------------------------------
  44. -- Copyright notice below. Please read.
  45. --
  46. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  47. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  48. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  49. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  50. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  51. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  52. --
  53. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  54. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  55. --
  56. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  57. --
  58. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  59. -- ------------------------------------------------------------------------------------------------------------------------------