/[eiffelstudio]/branches/eth/eve/eweasel/tests/rdtp001/test_loop.e
ViewVC logotype

Contents of /branches/eth/eve/eweasel/tests/rdtp001/test_loop.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 92811 - (show annotations)
Fri Jul 26 04:35:53 2013 UTC (6 years, 2 months ago) by jasonw
File size: 4663 byte(s)
<<Merged from trunk#92810.>>
1 indexing
2 description: "Test for various loop flavours."
3 date: "$Date$"
4 revision: "$Revision$"
5
6 class
7 TEST_LOOP
8
9 feature
10
11 make is
12 local
13 a: ARRAY [INTEGER]
14 i: INTEGER
15 b: BOOLEAN
16 do
17 a := <<1, 2, 3, 4, 5>>
18 b := True
19 -- Loop_body without iteration
20 -- All clauses
21 from
22 i := 5
23 invariant
24 b
25 until
26 i = 3
27 loop
28 i := i - 1
29 variant
30 i
31 end
32 -- No Invariant
33 from
34 i := 5
35 until
36 i = 3
37 loop
38 i := i - 1
39 variant
40 i
41 end
42 -- No variant
43 from
44 i := 5
45 invariant
46 b
47 until
48 i = 3
49 loop
50 i := i - 1
51 end
52 -- No Invariant, Variant
53 from
54 i := 5
55 until
56 i = 3
57 loop
58 i := i - 1
59 end
60 -- Loop_body with iteration
61 -- All clauses
62 across
63 a as c
64 from
65 i := 5
66 invariant
67 c /= Void
68 until
69 i = 3
70 loop
71 i := i - 1
72 variant
73 i
74 end
75 -- No Initialization
76 across
77 a as c
78 invariant
79 c /= Void
80 until
81 i = 3
82 loop
83 i := i - 1
84 variant
85 i
86 end
87 -- No Invariant
88 across
89 a as c
90 from
91 i := 5
92 until
93 i = 3
94 loop
95 i := i - 1
96 variant
97 i
98 end
99 -- No Exit_condition
100 across
101 a as c
102 from
103 i := 5
104 invariant
105 c /= Void
106 loop
107 i := i - 1
108 variant
109 i
110 end
111 -- No variant
112 across
113 a as c
114 from
115 i := 5
116 invariant
117 c /= Void
118 until
119 i = 3
120 loop
121 i := i - 1
122 end
123 -- No Initialization, Invariant
124 across
125 a as c
126 until
127 i = 3
128 loop
129 i := i - 1
130 variant
131 i
132 end
133 -- No Initialization, Exit_condition
134 across
135 a as c
136 invariant
137 c /= Void
138 loop
139 i := i - 1
140 variant
141 i
142 end
143 -- No Initialization, Variant
144 across
145 a as c
146 invariant
147 c /= Void
148 until
149 i = 3
150 loop
151 i := i - 1
152 end
153 -- No Invariant, Exit_condition
154 across
155 a as c
156 from
157 i := 5
158 loop
159 i := i - 1
160 variant
161 i
162 end
163 -- No Invariant, Variant
164 across
165 a as c
166 from
167 i := 5
168 until
169 i = 3
170 loop
171 i := i - 1
172 end
173 -- No Exit_condition, Variant
174 across
175 a as c
176 from
177 i := 5
178 invariant
179 c /= Void
180 loop
181 i := i - 1
182 end
183 -- No Initialization, Invariant, Exit_condition
184 across
185 a as c
186 loop
187 i := i - 1
188 variant
189 i
190 end
191 -- No Initialization, Invariant, Variant
192 across
193 a as c
194 until
195 i = 3
196 loop
197 i := i - 1
198 end
199 -- No Initialization, Exit_condition, Variant
200 across
201 a as c
202 invariant
203 c /= Void
204 loop
205 i := i - 1
206 end
207 -- No Invariant, Exit_condition, Variant
208 across
209 a as c
210 from
211 i := 5
212 loop
213 i := i - 1
214 end
215 -- No Initialization, Invariant, Exit_condition, Variant
216 across
217 a as c
218 loop
219 i := i - 1
220 end
221 -- All_body
222 -- All clauses
223 b := across
224 a as c
225 invariant
226 c /= Void
227 until
228 i = 3
229 all
230 c.item = 3
231 variant
232 i
233 end
234 -- No Invariant
235 b := across
236 a as c
237 until
238 i = 3
239 all
240 c.item = 3
241 variant
242 i
243 end
244 -- No Exit_condition
245 b := across
246 a as c
247 invariant
248 c /= Void
249 all
250 c.item = 3
251 variant
252 i
253 end
254 -- No variant
255 b := across
256 a as c
257 invariant
258 c /= Void
259 until
260 i = 3
261 all
262 c.item = 3
263 end
264 -- No Invariant, Exit_condition
265 b := across
266 a as c
267 all
268 c.item = 3
269 variant
270 i
271 end
272 -- No Invariant, Variant
273 b := across
274 a as c
275 until
276 i = 3
277 all
278 c.item = 3
279 end
280 -- No Exit_condition, Variant
281 b := across
282 a as c
283 invariant
284 c /= Void
285 all
286 c.item = 3
287 end
288 -- No Invariant, Exit_condition, Variant
289 b := across
290 a as c
291 all
292 c.item = 3
293 end
294 -- Some_body
295 -- All clauses
296 b := across
297 a as c
298 invariant
299 c /= Void
300 until
301 i = 3
302 some
303 c.item = 3
304 variant
305 i
306 end
307 -- No Invariant
308 b := across
309 a as c
310 until
311 i = 3
312 some
313 c.item = 3
314 variant
315 i
316 end
317 -- No Exit_condition
318 b := across
319 a as c
320 invariant
321 c /= Void
322 some
323 c.item = 3
324 variant
325 i
326 end
327 -- No variant
328 b := across
329 a as c
330 invariant
331 c /= Void
332 until
333 i = 3
334 some
335 c.item = 3
336 end
337 -- No Invariant, Exit_condition
338 b := across
339 a as c
340 some
341 c.item = 3
342 variant
343 i
344 end
345 -- No Invariant, Variant
346 b := across
347 a as c
348 until
349 i = 3
350 some
351 c.item = 3
352 end
353 -- No Exit_condition, Variant
354 b := across
355 a as c
356 invariant
357 c /= Void
358 some
359 c.item = 3
360 end
361 -- No Invariant, Exit_condition, Variant
362 b := across
363 a as c
364 some
365 c.item = 3
366 end
367 end
368
369 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23