/test/language/gc/ISMM98/unused1/test_bench.e

http://github.com/tybor/Liberty · Specman e · 84 lines · 57 code · 6 blank · 21 comment · 2 complexity · f907e9a70ba943199bc421b3b3bc369d 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_BENCH
  5. create {}
  6. make
  7. feature {}
  8. tuning: INTEGER 40_000
  9. make
  10. local
  11. a: ARRAY[ANIMAL]; i: INTEGER
  12. do
  13. create a.make(1, 1024)
  14. from
  15. i := tuning
  16. until
  17. i = 0
  18. loop
  19. fill(a)
  20. clear(a)
  21. i := i - 1
  22. end
  23. end
  24. fill (array: ARRAY[ANIMAL])
  25. local
  26. i: INTEGER; animal: ANIMAL
  27. do
  28. from
  29. i := array.upper
  30. until
  31. i < array.lower
  32. loop
  33. if i \\ 2 = 0 then
  34. create {CAT} animal.make
  35. else
  36. create {DOG} animal.make
  37. end
  38. array.put(animal, i)
  39. i := i - 1
  40. end
  41. end
  42. clear (array: ARRAY[ANIMAL])
  43. local
  44. i: INTEGER; animal: ANIMAL
  45. do
  46. from
  47. i := array.upper
  48. until
  49. i < array.lower
  50. loop
  51. animal := array.item(i)
  52. array.put(Void, i)
  53. if animal.is_cat then
  54. create {CAT} animal.make
  55. array.put(animal, i)
  56. end
  57. i := i - 1
  58. end
  59. end
  60. end -- class TEST_BENCH
  61. --
  62. -- ------------------------------------------------------------------------------------------------------------------------------
  63. -- Copyright notice below. Please read.
  64. --
  65. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  66. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  67. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  68. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  69. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  70. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  71. --
  72. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  73. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  74. --
  75. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  76. --
  77. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  78. -- ------------------------------------------------------------------------------------------------------------------------------