/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
- -- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
- -- See the Copyright notice at the end of this file.
- --
- class TEST_FREE4
- -- From philippe Coucaud <Philippe.Coucaud@telelogic.com>
- create {}
- make
- feature {ANY}
- incr: BOOLEAN
- make
- local
- i, j, k: INTEGER; a: ARRAY[STRING]; s: STRING; rand: PRESS_RANDOM_NUMBER_GENERATOR
- do
- from
- i := 200
- create a.make(0, 350)
- create rand.make
- until
- i < 0
- loop
- --io.put_integer(i); io.put_new_line;
- from
- if incr then
- j := a.lower
- else
- j := a.upper
- end
- until
- incr and j = a.upper or not incr and j = a.lower
- loop
- k := rand.last_integer(100000)
- rand.next
- create s.make(k)
- a.put(s, j)
- if incr then
- j := j + 1
- else
- j := j - 1
- end
- end
- incr := not incr
- i := i - 1
- end
- end
- end -- class TEST_FREE4
- --
- -- ------------------------------------------------------------------------------------------------------------------------------
- -- Copyright notice below. Please read.
- --
- -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
- -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
- -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
- -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
- -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
- -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
- --
- -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
- -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
- --
- -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
- --
- -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
- -- ------------------------------------------------------------------------------------------------------------------------------