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