PageRenderTime 18ms CodeModel.GetById 10ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/test/language/simplify/inlining/test_inlining12.e

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