PageRenderTime 22ms CodeModel.GetById 16ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/test/language/simplify/inlining/test_inlining5.e

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