PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/test/lib/storage/collection/test_resize2.e

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