/test/language/agent/test_agent40.e

http://github.com/tybor/Liberty · Specman e · 70 lines · 39 code · 7 blank · 24 comment · 0 complexity · 2ec30b58751bbe323851716725e091a7 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_AGENT40
  5. -- SZ:232:
  6. -- for marking of expanded arguments
  7. inherit
  8. EIFFELTEST_TOOLS
  9. create {}
  10. make
  11. feature {}
  12. make
  13. local
  14. mem: MEMORY; aux: AUX_AGENT40
  15. do
  16. create aux.make
  17. -- to get one
  18. doit := agent foo(aux)
  19. create aux.make -- to erase it in the stack
  20. doit.call([])
  21. generate_garbage
  22. mem.collection_on
  23. mem.full_collect
  24. doit.call([])
  25. end
  26. doit: PROCEDURE[TUPLE]
  27. foo (x: AUX_AGENT40)
  28. do
  29. assert(not x.is_disposed)
  30. assert(not x.field.is_disposed)
  31. end
  32. generate_garbage
  33. local
  34. i: INTEGER; s: STRING
  35. do
  36. from
  37. i := 1
  38. until
  39. i = 10000
  40. loop
  41. create s.make_from_string("quark ends here")
  42. i := i + 1
  43. end
  44. end
  45. end -- class TEST_AGENT40
  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. -- ------------------------------------------------------------------------------------------------------------------------------