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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 class TEST
2
3 create
4 make
5
6 feature
7
8 make is
9 local
10 t1, t2: TUPLE [a:STRING_8; b: ANY; c:HASH_TABLE [STRING, STRING]]
11 l_table: HASH_TABLE [STRING, STRING]
12 l_obj: SPECIAL [detachable ANY]
13 i, j: INTEGER
14 do
15 create l_table.make (10)
16 l_table.put ("ISE_EIFFEL", "/home/Eiffel60")
17
18 from
19 i := 1
20 create l_obj.make_filled (Void, 1000)
21 until
22 i = 1000
23 loop
24 l_obj.put (create {SPECIAL [INTEGER]}.make_filled (0, 128), i)
25 i := i + 1
26 end
27
28 t1 := ["TEST", l_obj, l_table]
29
30 -- 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 not deep_equal (t1.b, t2.b) or
71 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