PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/test/language/simplify/test_simplify11.e

http://github.com/tybor/Liberty
Specman e | 159 lines | 121 code | 13 blank | 25 comment | 18 complexity | 429619e8d5f4b8ab5ec5a64b792ec87c 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_SIMPLIFY11
  5   --
  6   -- To test routine body normalization (extra initialization removal).
  7   --
  8   --
  9
 10insert
 11   EIFFELTEST_TOOLS
 12
 13create {}
 14   make
 15
 16feature {ANY}
 17   f_0: BOOLEAN
 18      do
 19         Result := False
 20         if True then
 21            Result := True
 22         end
 23      end
 24
 25   f_1 (a1: INTEGER): BOOLEAN
 26      do
 27         Result := False
 28         if True then
 29            Result := True
 30         end
 31      end
 32
 33   f_2 (a1, a2: INTEGER): BOOLEAN
 34      do
 35         Result := False
 36         if True then
 37            Result := True
 38         end
 39      end
 40
 41   make
 42      do
 43         if f_0 then
 44            assert(True)
 45         else
 46            c_inline_c("simplify error #1 in boost_simplify11")
 47         end
 48         if f_1(1) then
 49            assert(True)
 50         else
 51            c_inline_c("simplify error #2 in boost_simplify11")
 52         end
 53         if f_2(2, 2) then
 54            assert(True)
 55         else
 56            c_inline_c("simplify error #3 in boost_simplify11")
 57         end
 58         assert(assert_counter.item = 3)
 59         if g_0 then
 60            c_inline_c("simplify error #4 in boost_simplify11")
 61         else
 62            assert(True)
 63         end
 64         if g_1(1) then
 65            c_inline_c("simplify error #5 in boost_simplify11")
 66         else
 67            assert(True)
 68         end
 69         if g_2(2, 2) then
 70            c_inline_c("simplify error #6 in boost_simplify11")
 71         else
 72            assert(True)
 73         end
 74         assert(assert_counter.item = 7)
 75         if h_0 = 1 then
 76            assert(True)
 77         else
 78            c_inline_c("simplify error #7 in boost_simplify11")
 79         end
 80         if h_1(1) = 1 then
 81            assert(True)
 82         else
 83            c_inline_c("simplify error #8 in boost_simplify11")
 84         end
 85         if h_2(2, 2) = 1 then
 86            assert(True)
 87         else
 88            c_inline_c("simplify error #9 in boost_simplify11")
 89         end
 90         assert(assert_counter.item = 11)
 91      end
 92
 93   g_0: BOOLEAN
 94      do
 95         Result := False
 96         if True then
 97         end
 98      end
 99
100   g_1 (a1: INTEGER): BOOLEAN
101      do
102         Result := False
103         if True then
104         end
105      end
106
107   g_2 (a1, a2: INTEGER): BOOLEAN
108      do
109         Result := False
110         if True then
111         end
112      end
113
114   h_0: INTEGER
115      do
116         Result := 0
117         Result := 0
118         if True then
119            Result := 1
120         end
121      end
122
123   h_1 (a1: INTEGER): INTEGER
124      do
125         Result := 0
126         Result := 0
127         if True then
128            Result := 1
129         end
130      end
131
132   h_2 (a1, a2: INTEGER): INTEGER
133      do
134         Result := 0
135         Result := 0
136         if True then
137            Result := 1
138         end
139      end
140
141end -- class TEST_SIMPLIFY11
142--
143-- ------------------------------------------------------------------------------------------------------------------------------
144-- Copyright notice below. Please read.
145--
146-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
147-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
148-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
149-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
150-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
151-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
152--
153-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
154-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
155--
156-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
157--
158-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
159-- ------------------------------------------------------------------------------------------------------------------------------