PageRenderTime 23ms CodeModel.GetById 14ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/test/language/simplify/test_simplify01.e

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