PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/test/language/assertion/test_assertion_require1.e

http://github.com/tybor/Liberty
Specman e | 58 lines | 32 code | 4 blank | 22 comment | 0 complexity | 6baba91884ae71af7e7b7481eba71619 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_ASSERTION_REQUIRE1
 5   -- To be run only in "-require_check" mode.
 6
 7insert
 8   EIFFELTEST_TOOLS
 9   ASSERTION_CONSTANTS
10
11create {}
12   main
13
14feature {ANY}
15   main
16      local
17         trace: ARRAY[INTEGER]; aux: AUX_ASSERTION
18      do
19         create trace.make(require_index, debug_index)
20         assert(trace.count = 7) -- assert #  1
21         assert(trace.occurrences(0) = 7) -- assert #  2
22         create aux.make(trace)
23         assert(trace.item(require_index) = 0) -- assert #  3
24         assert(trace.item(ensure_index) = 0) -- assert #  4
25         assert(trace.item(class_invariant_index) = 0) -- assert #  5
26         assert(trace.item(loop_invariant_index) = 0) -- assert #  6
27         assert(trace.item(variant_index) = 0) -- assert #  7
28         assert(trace.item(check_index) = 0) -- assert #  8
29         assert(trace.item(debug_index) = 0) -- assert #  9
30         aux.do_call
31         assert(trace.item(require_index) = 1) -- assert # 10
32         assert(trace.item(ensure_index) = 0) -- assert # 11
33         assert(trace.item(class_invariant_index) = 0) -- assert # 12
34         assert(trace.item(loop_invariant_index) = 0) -- assert # 13
35         assert(trace.item(variant_index) = 0) -- assert # 14
36         assert(trace.item(check_index) = 0) -- assert # 15
37         assert(trace.item(debug_index) = 0) -- assert # 16
38      end
39
40end -- class TEST_ASSERTION_REQUIRE1
41--
42-- ------------------------------------------------------------------------------------------------------------------------------
43-- Copyright notice below. Please read.
44--
45-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
46-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
47-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
48-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
49-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
50-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
51--
52-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
53-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
54--
55-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
56--
57-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
58-- ------------------------------------------------------------------------------------------------------------------------------