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

/test/language/unclassified/test_unique.e

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