/test/language/gc/test_free4.e

http://github.com/tybor/Liberty · Specman e · 67 lines · 40 code · 4 blank · 23 comment · 2 complexity · 28c52ee857540a6c41246a708c6ef505 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_FREE4
  5. -- From philippe Coucaud <Philippe.Coucaud@telelogic.com>
  6. create {}
  7. make
  8. feature {ANY}
  9. incr: BOOLEAN
  10. make
  11. local
  12. i, j, k: INTEGER; a: ARRAY[STRING]; s: STRING; rand: PRESS_RANDOM_NUMBER_GENERATOR
  13. do
  14. from
  15. i := 200
  16. create a.make(0, 350)
  17. create rand.make
  18. until
  19. i < 0
  20. loop
  21. --io.put_integer(i); io.put_new_line;
  22. from
  23. if incr then
  24. j := a.lower
  25. else
  26. j := a.upper
  27. end
  28. until
  29. incr and j = a.upper or not incr and j = a.lower
  30. loop
  31. k := rand.last_integer(100000)
  32. rand.next
  33. create s.make(k)
  34. a.put(s, j)
  35. if incr then
  36. j := j + 1
  37. else
  38. j := j - 1
  39. end
  40. end
  41. incr := not incr
  42. i := i - 1
  43. end
  44. end
  45. end -- class TEST_FREE4
  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. -- ------------------------------------------------------------------------------------------------------------------------------