/test/language/simplify/test_simplify12.e

http://github.com/tybor/Liberty · Specman e · 85 lines · 53 code · 7 blank · 25 comment · 3 complexity · 1ebc3540ca904bb239a6f47e6f77c7ca 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_SIMPLIFY12
  5. --
  6. -- To test routine body normalization (extra initialization removal).
  7. --
  8. --
  9. insert
  10. EIFFELTEST_TOOLS
  11. create {}
  12. make
  13. feature {ANY}
  14. f_0: BOOLEAN
  15. local
  16. a: INTEGER; b: CHARACTER; c: STRING
  17. do
  18. a := 0
  19. b := '%U'
  20. c := Void
  21. Result := True
  22. end
  23. f_1 (a1: INTEGER): BOOLEAN
  24. local
  25. a: INTEGER; b: CHARACTER; c: STRING
  26. do
  27. a := 0
  28. b := '%U'
  29. c := Void
  30. Result := True
  31. end
  32. f_2 (a1, a2: INTEGER): BOOLEAN
  33. local
  34. a: INTEGER; b: CHARACTER; c: STRING
  35. do
  36. a := 0
  37. b := '%U'
  38. c := Void
  39. Result := True
  40. end
  41. make
  42. do
  43. if f_0 then
  44. assert(True)
  45. else
  46. c_inline_c("simplify error #1 in boost_simplify12")
  47. end
  48. if f_1(1) then
  49. assert(True)
  50. else
  51. c_inline_c("simplify error #2 in boost_simplify12")
  52. end
  53. if f_2(2, 2) then
  54. assert(True)
  55. else
  56. c_inline_c("simplify error #3 in boost_simplify12")
  57. end
  58. assert(assert_counter.item = 3)
  59. end
  60. end -- class TEST_SIMPLIFY12
  61. --
  62. -- ------------------------------------------------------------------------------------------------------------------------------
  63. -- Copyright notice below. Please read.
  64. --
  65. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  66. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  67. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  68. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  69. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  70. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  71. --
  72. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  73. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  74. --
  75. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  76. --
  77. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  78. -- ------------------------------------------------------------------------------------------------------------------------------