/test/language/simplify/test_simplify16.e

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