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

/test/lib/numeric/real/test_real2.e

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