PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/test/language/unclassified/test_fa3.e

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