PageRenderTime 18ms CodeModel.GetById 10ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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