/test/language/assertion/aux_assertion.e

http://github.com/tybor/Liberty · Specman e · 110 lines · 75 code · 14 blank · 21 comment · 0 complexity · 1a1e220c876be4009437844066be9c3f 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 AUX_ASSERTION
  5. insert
  6. ASSERTION_CONSTANTS
  7. create {ANY}
  8. make
  9. feature {}
  10. trace: ARRAY[INTEGER]
  11. make (t: like trace)
  12. do
  13. trace := t
  14. end
  15. feature {ANY}
  16. do_call
  17. require
  18. require_test
  19. local
  20. stop: BOOLEAN
  21. do
  22. from
  23. invariant
  24. loop_invariant_test
  25. variant
  26. variant_test
  27. until
  28. stop
  29. loop
  30. stop := True
  31. end
  32. check
  33. check_test
  34. end
  35. debug
  36. debug_test
  37. end
  38. ensure
  39. ensure_test
  40. end
  41. feature {}
  42. require_test: BOOLEAN
  43. do
  44. trace.put(trace.item(require_index) + 1, require_index)
  45. Result := True
  46. end
  47. ensure_test: BOOLEAN
  48. do
  49. trace.put(trace.item(ensure_index) + 1, ensure_index)
  50. Result := True
  51. end
  52. class_invariant_test: BOOLEAN
  53. do
  54. trace.put(trace.item(class_invariant_index) + 1, class_invariant_index)
  55. Result := True
  56. end
  57. loop_invariant_test: BOOLEAN
  58. do
  59. trace.put(trace.item(loop_invariant_index) + 1, loop_invariant_index)
  60. Result := True
  61. end
  62. variant_test: INTEGER
  63. do
  64. trace.put(trace.item(variant_index) + 1, variant_index)
  65. Result := 1
  66. end
  67. check_test: BOOLEAN
  68. do
  69. trace.put(trace.item(check_index) + 1, check_index)
  70. Result := True
  71. end
  72. debug_test
  73. do
  74. trace.put(trace.item(debug_index) + 1, debug_index)
  75. end
  76. invariant
  77. class_invariant_test
  78. end -- class AUX_ASSERTION
  79. --
  80. -- ------------------------------------------------------------------------------------------------------------------------------
  81. -- Copyright notice below. Please read.
  82. --
  83. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  84. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  85. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  86. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  87. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  88. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  89. --
  90. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  91. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  92. --
  93. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  94. --
  95. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  96. -- ------------------------------------------------------------------------------------------------------------------------------