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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 77422 - (show annotations)
Fri Feb 27 23:08:13 2009 UTC (11 years ago) by manus
File size: 2290 byte(s)
Added test for expanded initialization that also overflows the special boundaries.

1 class TEST
2
3 inherit
4 INTERNAL
5 MEMORY
6
7 create
8 make
9
10 feature
11
12 make is
13 local
14 l_spec: SPECIAL [INTEGER_64]
15 l_spec_exp: SPECIAL [EXP]
16 l_count: NATURAL_64
17 do
18 collection_off
19
20 create l_spec.make (0x1FFFFFFF)
21 l_spec := l_spec.aliased_resized_area (0x20000001)
22
23 if l_spec.count /= 536870913 then
24 io.put_string ("Not OK%N")
25 end
26 if l_spec.capacity /= 536870913 then
27 io.put_string ("Not OK%N")
28 end
29
30 l_count := l_spec.count.as_natural_64
31
32 if (l_count * 8) > physical_size_64 (l_spec) then
33 if (l_count * 8) - physical_size_64 (l_spec) > 32 then
34 io.put_natural_64 ((l_count * 8) - physical_size_64 (l_spec))
35 io.put_new_line
36 end
37 elseif physical_size_64 (l_spec) - (l_count * 8) > 32 then
38 io.put_natural_64 (physical_size_64 (l_spec) - (l_count * 8))
39 io.put_new_line
40 end
41
42 l_spec := Void
43 collection_on
44 full_collect
45 collection_off
46
47 create l_spec.make (0x1FFFFFFF)
48 l_spec := l_spec.twin
49
50 if l_spec.count /= 536870911 then
51 io.put_string ("Not OK%N")
52 end
53 if l_spec.capacity /= 536870911 then
54 io.put_string ("Not OK%N")
55 end
56
57 l_count := l_spec.count.as_natural_64
58
59 if (l_count * 8) > physical_size_64 (l_spec) then
60 if (l_count * 8) - physical_size_64 (l_spec) > 32 then
61 io.put_natural_64 ((l_count * 8) - physical_size_64 (l_spec))
62 io.put_new_line
63 end
64 elseif physical_size_64 (l_spec) - (l_count * 8) > 32 then
65 io.put_natural_64 (physical_size_64 (l_spec) - (l_count * 8))
66 io.put_new_line
67 end
68
69 collection_on
70 full_collect
71 collection_off
72
73 l_spec := l_spec.deep_twin
74
75 if l_spec.count /= 536870911 then
76 io.put_string ("Not OK%N")
77 end
78 if l_spec.capacity /= 536870911 then
79 io.put_string ("Not OK%N")
80 end
81
82 l_count := l_spec.count.as_natural_64
83
84 if (l_count * 8) > physical_size_64 (l_spec) then
85 if (l_count * 8) - physical_size_64 (l_spec) > 32 then
86 io.put_natural_64 ((l_count * 8) - physical_size_64 (l_spec))
87 io.put_new_line
88 end
89 elseif physical_size_64 (l_spec) - (l_count * 8) > 32 then
90 io.put_natural_64 (physical_size_64 (l_spec) - (l_count * 8))
91 io.put_new_line
92 end
93
94 l_spec := Void
95 collection_on
96 full_collect
97 collection_off
98
99 create l_spec_exp.make (0x7FFFFFF)
100 end
101
102 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23