PageRenderTime 28ms CodeModel.GetById 24ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/test/language/exceptions/test_exceptions18.e

http://github.com/tybor/Liberty
Specman e | 67 lines | 36 code | 9 blank | 22 comment | 1 complexity | 0fcf9ebe0abea02eea1dbb9efae003f9 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_EXCEPTIONS18
 5
 6insert
 7   EXCEPTIONS
 8
 9create {}
10   make
11
12feature {ANY}
13   val: INTEGER
14
15   aux: AUX_EXCEPTIONS18A
16
17   make
18      local
19         counter: INTEGER
20      do
21         create aux.make(val)
22      rescue
23         is_true(Class_invariant = exception)
24         counter := counter + 1
25         val := val + 1
26         retry
27      end
28
29feature {ANY}
30   is_true (b: BOOLEAN)
31      do
32         cpt := cpt + 1
33         if not b then
34            crash
35            std_output.put_string("TEST_EXCEPTION18: ERROR Test # ")
36            std_output.put_integer(cpt)
37            std_output.put_string("%N")
38         else
39            --std_output.put_string("Yes%N");
40         end
41      end
42
43   cpt: INTEGER
44
45invariant
46   val = 2
47   val = aux.i
48
49end -- class TEST_EXCEPTIONS18
50--
51-- ------------------------------------------------------------------------------------------------------------------------------
52-- Copyright notice below. Please read.
53--
54-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
55-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
56-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
57-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
58-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
59-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
60--
61-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
62-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
63--
64-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
65--
66-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
67-- ------------------------------------------------------------------------------------------------------------------------------