/[eiffelstudio]/trunk/eweasel/tests/store007/storable_test.e
ViewVC logotype

Contents of /trunk/eweasel/tests/store007/storable_test.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91277 - (show annotations)
Fri Feb 22 21:47:41 2013 UTC (6 years, 10 months ago) by manus
File size: 3786 byte(s)
Updated test to exercize all our store/retrieve mechanisms.

1 note
2 description: "Test object for storable"
3 date: "$Date$"
4 revision: "$Revision$"
5
6 class
7 STORABLE_TEST
8
9 create
10 make
11
12 feature {NONE} -- Initialization
13
14 make
15 do
16 create_basic_types
17 create_tuples
18 create_specials
19 create_lists
20 end
21
22 feature -- Basic types
23
24 a: ANY
25
26 i8: INTEGER_8
27 i16: INTEGER_16
28 i32: INTEGER
29 i64: INTEGER_64
30
31 n8: NATURAL_8
32 n16: NATURAL_16
33 n32: NATURAL_32
34 n64: NATURAL_64
35
36 p: POINTER
37
38 r32: REAL
39 r64: DOUBLE
40
41 c: CHARACTER
42 s: STRING
43
44 create_basic_types
45 do
46 i8 := -9
47 i16 := -1245
48 i32 := 65538
49 i64 := 0x0000FFFF0000FFFF
50
51 n8 := 1
52 n16 := 0xFFFF
53 n32 := 0xFFFFFFFF
54 n64 := 0xFFFF0000FFFF0000
55
56 p := default_pointer + 65
57
58 r32 := {REAL_32} 4.5
59 r64 := 6.5
60
61 c := 'a'
62 s := "I'm a nice string!!"
63 end
64
65 feature -- Tuples
66
67 t1: TUPLE
68 t2: TUPLE [INTEGER]
69 t3: TUPLE [INTEGER, CHARACTER, BOOLEAN]
70 t4: TUPLE [REAL, DOUBLE]
71 t5: TUPLE [STRING, NATURAL_8, NATURAL_16]
72 t6: TUPLE [INTEGER_8, INTEGER_16, INTEGER, INTEGER_64, NATURAL_8, NATURAL_16, NATURAL_32, NATURAL_64]
73
74 create_tuples
75 do
76 t1 := []
77 t2 := [5]
78 t3 := [5, 's', True]
79 t4 := [{REAL} 4.6, 6.5]
80 t5 := ["TEST", {NATURAL_8} 9, {NATURAL_16} 16]
81 t6 := [{INTEGER_8} 1, {INTEGER_16} 2, 3, {INTEGER_64} 4, {NATURAL_8} 5, {NATURAL_16} 6, {NATURAL_32} 7, {NATURAL_64} 8]
82 end
83
84 feature -- Specials
85
86 spec_i8: SPECIAL [INTEGER_8]
87 spec_i16: SPECIAL [INTEGER_16]
88 spec_i32: SPECIAL [INTEGER]
89 spec_i64: SPECIAL [INTEGER_64]
90
91 spec_n8: SPECIAL [NATURAL_8]
92 spec_n16: SPECIAL [NATURAL_16]
93 spec_n32: SPECIAL [NATURAL_32]
94 spec_n64: SPECIAL [NATURAL_64]
95
96 spec_p: SPECIAL [POINTER]
97
98 spec_r32: SPECIAL [REAL]
99 spec_r64: SPECIAL [DOUBLE]
100
101 spec_c: SPECIAL [CHARACTER]
102 spec_s: SPECIAL [STRING]
103 spec_t: SPECIAL [TUPLE]
104
105 create_specials
106 do
107 create spec_i8.make_filled (0, 100)
108 create spec_i16.make_filled (0, 100)
109 create spec_i32.make_filled (0, 100)
110 create spec_i64.make_filled (0, 100)
111 create spec_n8.make_filled (0, 100)
112 create spec_n16.make_filled (0, 100)
113 create spec_n32.make_filled (0, 100)
114 create spec_n64.make_filled (0, 100)
115 create spec_r32.make_filled ({REAL_32} 0.0, 100)
116 create spec_r64.make_filled (0.0, 100)
117 create spec_p.make_filled (default_pointer, 100)
118 create spec_c.make_filled ('%/000/', 100)
119
120 create spec_s.make_filled (Void, 100)
121 spec_s.put ("FDS", 10)
122 create spec_t.make_filled (Void, 100)
123 spec_t.put ([12, 23, 45, "Fds"], 90)
124 end
125
126 feature -- Lists
127
128 list_i8: LINKED_LIST [INTEGER_8]
129 list_i16: LINKED_LIST [INTEGER_16]
130 list_i32: LINKED_LIST [INTEGER]
131 list_i64: LINKED_LIST [INTEGER_64]
132
133 list_n8: LINKED_LIST [NATURAL_8]
134 list_n16: LINKED_LIST [NATURAL_16]
135 list_n32: LINKED_LIST [NATURAL_32]
136 list_n64: LINKED_LIST [NATURAL_64]
137
138 list_p: LINKED_LIST [POINTER]
139
140 list_r32: LINKED_LIST [REAL]
141 list_r64: LINKED_LIST [DOUBLE]
142
143 list_c: LINKED_LIST [CHARACTER]
144 list_s: LINKED_LIST [STRING]
145
146 list_cell: LINKED_LIST [CELL [INTEGER]]
147
148 lists: ARRAYED_LIST [like list_cell]
149
150 create_lists
151 local
152 i: INTEGER
153 do
154 create list_i8.make
155 create list_i16.make
156 create list_i32.make
157 create list_i64.make
158 create list_n8.make
159 create list_n16.make
160 create list_n32.make
161 create list_n64.make
162 create list_p.make
163 create list_r32.make
164 create list_r64.make
165 create list_c.make
166 create list_s.make
167 list_s.extend ("FDs")
168 list_s.extend ("FDs")
169
170 list_cell := list
171
172 from
173 i := 1
174 create lists.make (20)
175 until
176 i = 20
177 loop
178 lists.extend (list)
179 i := i + 1
180 end
181 end
182
183 list: LINKED_LIST [CELL [INTEGER]]
184 -- New big list of data
185 local
186 i: INTEGER
187 do
188 create Result.make
189 from
190 i := 1
191 until
192 i = 300
193 loop
194 Result.extend (create {CELL [INTEGER]}.put (i))
195 Result.finish
196 i := i + 1
197 end
198 end
199
200 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23