PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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--
 4class TEST_FREE4
 5   -- From philippe Coucaud <Philippe.Coucaud@telelogic.com>
 6
 7create {}
 8   make
 9
10feature {ANY}
11   incr: BOOLEAN
12
13   make
14      local
15         i, j, k: INTEGER; a: ARRAY[STRING]; s: STRING; rand: PRESS_RANDOM_NUMBER_GENERATOR
16      do
17         from
18            i := 200
19            create a.make(0, 350)
20            create rand.make
21         until
22            i < 0
23         loop
24            --io.put_integer(i); io.put_new_line;
25            from
26               if incr then
27                  j := a.lower
28               else
29                  j := a.upper
30               end
31            until
32               incr and j = a.upper or not incr and j = a.lower
33            loop
34               k := rand.last_integer(100000)
35               rand.next
36               create s.make(k)
37               a.put(s, j)
38               if incr then
39                  j := j + 1
40               else
41                  j := j - 1
42               end
43            end
44            incr := not incr
45            i := i - 1
46         end
47      end
48
49end -- class TEST_FREE4
50--
51-- ------------------------------------------------------------------------------------------------------------------------------
52-- Copyright notice below. Please read.
53--
54-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
55-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
56-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
57-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
58-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
59-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
60--
61-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
62-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
63--
64-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
65--
66-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
67-- ------------------------------------------------------------------------------------------------------------------------------