/[eiffelstudio]/trunk/eweasel/tests/exec374/test.e
ViewVC logotype

Contents of /trunk/eweasel/tests/exec374/test.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 103165 - (show annotations)
Thu May 16 10:17:47 2019 UTC (4 months ago) by alexk
File size: 3993 byte(s)
Added test cases for `is_equal` and its variants (bug#19544).
1 class TEST
2
3 create
4 make
5
6 feature {NONE} -- Creation
7
8 make
9 do
10 report_32 ( 1, 1)
11 report_32 (-1, 1)
12 report_32 ( 1, -1)
13 report_32 (-1, -1)
14 report_32 ( 1, {REAL_32}.nan)
15 report_32 ({REAL_32}.nan, 1)
16 report_32 ({REAL_32}.nan, {REAL_32}.nan)
17 report_32 ({REAL_32}.positive_infinity, {REAL_32}.positive_infinity)
18 report_32 ({REAL_32}.negative_infinity, {REAL_32}.positive_infinity)
19 report_32 ({REAL_32}.positive_infinity, {REAL_32}.negative_infinity)
20 report_32 ({REAL_32}.negative_infinity, {REAL_32}.negative_infinity)
21 report_32 ({REAL_32}.positive_infinity, {REAL_32}.nan)
22 report_32 ({REAL_32}.nan, {REAL_32}.positive_infinity)
23 report_32 ({REAL_32}.negative_infinity, {REAL_32}.nan)
24 report_32 ({REAL_32}.nan, {REAL_32}.negative_infinity)
25 io.put_new_line
26 report_64 ( 1, 1)
27 report_64 (-1, 1)
28 report_64 ( 1, -1)
29 report_64 (-1, -1)
30 report_64 ( 1, {REAL_64}.nan)
31 report_64 ({REAL_64}.nan, 1)
32 report_64 ({REAL_64}.nan, {REAL_64}.nan)
33 report_64 ({REAL_64}.positive_infinity, {REAL_64}.positive_infinity)
34 report_64 ({REAL_64}.negative_infinity, {REAL_64}.positive_infinity)
35 report_64 ({REAL_64}.positive_infinity, {REAL_64}.negative_infinity)
36 report_64 ({REAL_64}.negative_infinity, {REAL_64}.negative_infinity)
37 report_64 ({REAL_64}.positive_infinity, {REAL_64}.nan)
38 report_64 ({REAL_64}.nan, {REAL_64}.positive_infinity)
39 report_64 ({REAL_64}.negative_infinity, {REAL_64}.nan)
40 report_64 ({REAL_64}.nan, {REAL_64}.negative_infinity)
41 end
42
43 feature {NONE} -- Output
44
45 report_32 (x, y: REAL_32)
46 -- Print results of comparison `x` to `y`.
47 do
48 io.put_string ("REAL_32: ")
49 io.put_real (x)
50 io.put_character (' ')
51 io.put_real (y)
52 io.put_new_line
53 io.put_string (" = std: " + (x = y).to_integer.out + " ieee: " + x.ieee_is_equal (y).to_integer.out +
54 " is_equal: " + x.is_equal (y).to_integer.out +
55 " is_deep_equal: " + x.is_deep_equal (y).to_integer.out +
56 " standard_is_equal: " + x.standard_is_equal (y).to_integer.out + "%N")
57 io.put_string (" <= std: " + (x <= y).to_integer.out + " ieee: " + x.ieee_is_less_equal (y).to_integer.out + "%N")
58 io.put_string (" < std: " + (x < y).to_integer.out + " ieee: " + x.ieee_is_less (y).to_integer.out + "%N")
59 io.put_string (" > std: " + (x > y).to_integer.out + " ieee: " + x.ieee_is_greater (y).to_integer.out + "%N")
60 io.put_string (" >= std: " + (x >= y).to_integer.out + " ieee: " + x.ieee_is_greater_equal (y).to_integer.out + "%N")
61 io.put_string (" max std: " + x.max (y).out + " ieee: " + x.ieee_maximum_number (y).out + "%N")
62 io.put_string (" min std: " + x.min (y).out + " ieee: " + x.ieee_minimum_number (y).out + "%N")
63 end
64
65 report_64 (x, y: REAL_64)
66 -- Print results of comparison `x` to `y`.
67 do
68 io.put_string ("REAL_64: ")
69 io.put_double (x)
70 io.put_character (' ')
71 io.put_double (y)
72 io.put_new_line
73 io.put_string (" = std: " + (x = y).to_integer.out + " ieee: " + x.ieee_is_equal (y).to_integer.out +
74 " is_equal: " + x.is_equal (y).to_integer.out +
75 " is_deep_equal: " + x.is_deep_equal (y).to_integer.out +
76 " standard_is_equal: " + x.standard_is_equal (y).to_integer.out + "%N")
77 io.put_string (" <= std: " + (x <= y).to_integer.out + " ieee: " + x.ieee_is_less_equal (y).to_integer.out + "%N")
78 io.put_string (" < std: " + (x < y).to_integer.out + " ieee: " + x.ieee_is_less (y).to_integer.out + "%N")
79 io.put_string (" > std: " + (x > y).to_integer.out + " ieee: " + x.ieee_is_greater (y).to_integer.out + "%N")
80 io.put_string (" >= std: " + (x >= y).to_integer.out + " ieee: " + x.ieee_is_greater_equal (y).to_integer.out + "%N")
81 io.put_string (" max std: " + x.max (y).out + " ieee: " + x.ieee_maximum_number (y).out + "%N")
82 io.put_string (" min std: " + x.min (y).out + " ieee: " + x.ieee_minimum_number (y).out + "%N")
83 end
84
85 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23