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