PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/test/lib/storage/collection/aux_inherit_array1.e

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