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

Annotation of /trunk/eweasel/tests/tuple006/test.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 79005 - (hide annotations)
Tue Jun 2 00:06:53 2009 UTC (10 years, 9 months ago) by manus
File size: 1496 byte(s)
Made code compile with both version of SPECIAL.

1 manus 66337 class TEST
2    
3     create
4     make
5    
6     feature
7    
8     make is
9     local
10 manus 68898 t1, t2: TUPLE [a:STRING_8; b: ANY; c:HASH_TABLE [STRING, STRING]]
11 manus 66337 l_table: HASH_TABLE [STRING, STRING]
12 manus 79005 l_obj: SPECIAL [detachable ANY]
13 manus 66337 i, j: INTEGER
14     do
15     create l_table.make (10)
16     l_table.put ("ISE_EIFFEL", "/home/Eiffel60")
17    
18 manus 68898 from
19     i := 1
20 manus 79005 create l_obj.make_filled (Void, 1000)
21 manus 68898 until
22     i = 1000
23     loop
24 manus 79005 l_obj.put (create {SPECIAL [INTEGER]}.make_filled (0, 128), i)
25 manus 68898 i := i + 1
26     end
27 manus 66337
28 manus 68898 t1 := ["TEST", l_obj, l_table]
29    
30 manus 66337 -- Twin test
31     from
32     i := 1
33     until
34     i = 10000
35     loop
36     t2 := t1.twin
37     if
38     t2 = Void or
39     t2.a = Void or
40     t2.b = Void or
41     t2.c = Void or
42     not equal (t1.a, t2.a) or
43     not equal (t1.b, t2.b) or
44     not equal (t1.c, t2.c) or
45     t2.a.count /= t1.a.count
46     then
47     j := j + 1
48     print ("Failure twin at " + i.out + "%N")
49     end
50     i := i + 1
51     end
52     if j > 0 then
53     print (j.out + " failures with twin.%N")
54     end
55    
56     -- Deep_twin test
57     from
58     i := 1
59     j := 0
60     until
61     i = 10000
62     loop
63     t2 := t1.deep_twin
64     if
65     t2 = Void or
66     t2.a = Void or
67     t2.b = Void or
68     t2.c = Void or
69     not equal (t1.a, t2.a) or
70 manus 68898 not deep_equal (t1.b, t2.b) or
71 manus 66337 not deep_equal (t1.c, t2.c) or
72     t2.a.count /= t1.a.count
73     then
74     j := j + 1
75     print ("Failure deep_twin at " + i.out + "%N")
76     end
77     i := i + 1
78     end
79     if j > 0 then
80     print (j.out + " failures with deep_twin.%N")
81     end
82    
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