Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / setofMatch / TsetofMatch.ttcn
CommitLineData
970ed795 1/******************************************************************************
3abe9331 2 * Copyright (c) 2000-2015 Ericsson Telecom AB
970ed795
EL
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 ******************************************************************************/
8module TsetofMatch {
9// Type definitions
10
11type component my_comp {};
12type enumerated my_enum {amstel, buckler, coronita, desperados};
13type record of integer recordof_int;
14//type union my_union {
15// int x1,
16// recordof_int x2
17//};
18
19type set of integer setof_int; // set of basic type
20type set of my_enum setof_enum; // set of enum
21//type set of my_union setof_union; // set of union
22type set of recordof_int setof_recordof; // set of record of
23type set of setof_int setof_setof; // recursive set of
24
25// Constants
26
27const recordof_int record_element1:={4,3,2};
28
29const setof_int setof_const1:={1,2,3,4,5};
30const setof_enum setof_const2:={amstel, coronita};
31//const setof_union setof_const3:={{1,{1,2,3}}, {9,{4}}};
32const setof_recordof setof_const4:={record_element1, {5,4,3}, {2}};
33const setof_setof setof_const5:={{0,1}, setof_const1, {1}};
34
35// Templates
36
37template setof_int setof_temp1 := {1,2,3,4};
38template setof_enum setof_temp2 := {amstel, buckler, ?};
39template setof_enum setof_temp3 := {?, buckler, ?, buckler};
40template setof_int setof_temp4 := {*};
41template setof_int setof_temp5 := {1, *, 3};
42template setof_recordof setof_temp6 := {*, {1,2}, {3}, *};
43template setof_setof setof_temp7 := {{?,1}, {7,3}, ?, {5,*}};
44template setof_setof setof_temp8 := {{1,*}, * length (4)};
45template setof_int setof_temp9 := ({1},{2,?},{(3,4,5),?,?});
46template setof_setof setof_temp10 := {* length(2), * length(3), *};
47
48// Testcases - non-template part
49
50testcase setofIntAssign() runs on my_comp {
51var setof_int x1:= {25, 13, 37};
52var setof_int x2, x3, x4;
53x2:={32,12};
54x3:={11};
55x3:={11,22};
56x4:={};
57
58if (x1[0]==25) {setverdict(pass);} // at declaration
59 else {setverdict(fail);}
60if (x1[1]==13) {setverdict(pass);}
61 else {setverdict(fail);}
62if (x2[0]==32) {setverdict(pass);} // later
63 else {setverdict(fail);}
64if (x2[1]==12) {setverdict(pass);}
65 else {setverdict(fail);}
66if (x3[0]==11) {setverdict(pass);} // after changing size
67 else {setverdict(fail);}
68if (x3[1]==22) {setverdict(pass);}
69 else {setverdict(fail);}
70if (sizeof(x4)==0) {setverdict(pass);} // empty set of
71 else {setverdict(fail);}
72}
73
74testcase setofIntEq() runs on my_comp {
75// setof_int setof_const1:={1,2,3,4,5};
76var setof_int x1, x2, x3, x4, x5, x6, x7, x8, x9, x10;
77x1 := {1, 2, 3, 4, 5};
78x2 := {1, 3, 2, 5, 4};
79x3 := {4, 3, 2, 1, 5};
80x4 := {5, 1, 4, 3, 2};
81x5 := {3, 4, 5, 2, 1};
82x6 := {1, 2, 3, 4, 4};
83x7 := {1, 1, 1, 1, 1};
84x8 := {1, 2, 3, 4, 5, 6};
85x9:= {1, 4, 3, 2};
86//equality - the same order
87if (x1==setof_const1) {setverdict(pass);}
88 else {setverdict(fail);}
89//equality - other order
90if (x2==setof_const1) {setverdict(pass);}
91 else {setverdict(fail);}
92if (x3==setof_const1) {setverdict(pass);}
93 else {setverdict(fail);}
94if (x4==setof_const1) {setverdict(pass);}
95 else {setverdict(fail);}
96if (x5==setof_const1) {setverdict(pass);}
97 else {setverdict(fail);}
98//non-equality - unmatched elements
99if (x6!=setof_const1) {setverdict(pass);}
100 else {setverdict(fail);}
101if (x7!=setof_const1) {setverdict(pass);}
102 else {setverdict(fail);}
103//non-equality - too many elements
104if (x8!=setof_const1) {setverdict(pass);}
105 else {setverdict(fail);}
106//non-equality - too few elements
107if (x9!=setof_const1) {setverdict(pass);}
108 else {setverdict(fail);}
109}
110
111testcase setofSetofEq() runs on my_comp {
112var setof_setof x1, x2, x3, x4, x5, x6, x7;
113x1 := {{1,2},{3,4}};
114x2 := {{1,2},{3,4}};
115x3 := {{3,4},{1,2}};
116x4 := {{2,1},{4,3}};
117x5 := {{2,1},{4,3},{1,2}};
118x6 := {{4,1},{3,2}};
119x7 := {{1},{2,4}};
120//equality - in same order
121if (x2==x1) {setverdict(pass);}
122 else {setverdict(fail);}
123//equality - different orders
124if (x3==x1) {setverdict(pass);}
125 else {setverdict(fail);}
126if (x4==x1) {setverdict(pass);}
127 else {setverdict(fail);}
128//non-equality - too many elements
129if (x5!=x1) {setverdict(pass);}
130 else {setverdict(fail);}
131//non-equality - elements not matching
132if (x6!=x1) {setverdict(pass);}
133 else {setverdict(fail);}
134//non-equality - elements size not proper
135if (x7!=x1) {setverdict(pass);}
136 else {setverdict(fail);}
137}
138
139// Testcases - template part
140
141testcase tsetofIntSpecValueMatch() runs on my_comp {
142//template setof_int setof_temp1 := {1,2,3,4};
143var setof_int x1, x2, x3, x4, x5, x6, x7, x8, x9, x10;
144x1 := {1, 2, 3, 4}
145x2 := {1, 3, 2, 4}
146x3 := {4, 3, 2, 1}
147x4 := {2, 1, 4, 3}
148x5 := {3, 4, 1, 2}
149x6 := {1, 2, 3}
150x7 := {1, 2, 3, 4, 5}
151x8 := {4, 3, 2, 2}
152x9 := {1, 1, 4, 3}
153x10 := {3, 5, 1, 2}
154//match - in same order
155if (match(x1,setof_temp1)) {setverdict(pass);}
156 else {setverdict(fail);}
157//match - in different orders
158if (match(x2,setof_temp1)) {setverdict(pass);}
159 else {setverdict(fail);}
160if (match(x3,setof_temp1)) {setverdict(pass);}
161 else {setverdict(fail);}
162if (match(x4,setof_temp1)) {setverdict(pass);}
163 else {setverdict(fail);}
164if (match(x5,setof_temp1)) {setverdict(pass);}
165 else {setverdict(fail);}
166//no match: too few elements
167if (not(match(x6,setof_temp1))) {setverdict(pass);}
168 else {setverdict(fail);}
169//no match: too many elements
170if (not(match(x7,setof_temp1))) {setverdict(pass);}
171 else {setverdict(fail);}
172//no match: two different elements only match one
173if (not(match(x8,setof_temp1))) {setverdict(pass);}
174 else {setverdict(fail);}
175if (not(match(x9,setof_temp1))) {setverdict(pass);}
176 else {setverdict(fail);}
177//no match: unmatched element
178if (not(match(x10,setof_temp1))) {setverdict(pass);}
179 else {setverdict(fail);}
180}
181
182testcase tsetofEnumAnyValueMatch() runs on my_comp {
183//template setof_enum setof_temp2 := {amstel, buckler, ?};
184//template setof_enum setof_temp3 := {?, buckler, ?, buckler};
185var setof_enum x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12;
186x1 := {amstel, buckler, coronita}
187x2 := {buckler, coronita, amstel}
188x3 := {buckler, buckler, amstel}
189x4 := {buckler, amstel, amstel}
190x5 := {buckler, amstel, desperados}
191x6 := {amstel, amstel, buckler, buckler}
192x7 := {buckler, coronita, buckler, amstel}
193x8 := {amstel, buckler}
194x9 := {buckler, coronita, buckler}
195x10 := {buckler, buckler, buckler}
196x11 := {coronita, amstel, amstel}
197x12 := {amstel, buckler, coronita, desperados}
198//match - in same order
199if (match(x1,setof_temp2)) {setverdict(pass);}
200 else {setverdict(fail);}
201//match - in other orders
202if (match(x2,setof_temp2)) {setverdict(pass);}
203 else {setverdict(fail);}
204if (match(x3,setof_temp2)) {setverdict(pass);}
205 else {setverdict(fail);}
206if (match(x4,setof_temp2)) {setverdict(pass);}
207 else {setverdict(fail);}
208if (match(x5,setof_temp2)) {setverdict(pass);}
209 else {setverdict(fail);}
210if (match(x6,setof_temp3)) {setverdict(pass);}
211 else {setverdict(fail);}
212if (match(x7,setof_temp3)) {setverdict(pass);}
213 else {setverdict(fail);}
214//no match - too many elements
215if (match(x6,setof_temp2)) {setverdict(fail);}
216 else {setverdict(pass);}
217//no match - too few elements
218if (match(x8,setof_temp2)) {setverdict(fail);}
219 else {setverdict(pass);}
220//no match - element unmatched
221if (match(x9,setof_temp2)) {setverdict(fail);}
222 else {setverdict(pass);}
223if (match(x10,setof_temp2)) {setverdict(fail);}
224 else {setverdict(pass);}
225if (match(x11,setof_temp2)) {setverdict(fail);}
226 else {setverdict(pass);}
227if (match(x12,setof_temp3)) {setverdict(fail);}
228 else {setverdict(pass);}
229}
230
231testcase tsetofIntAnyorNoneMatch() runs on my_comp {
232//template setof_int setof_temp4 := {*};
233//template setof_int setof_temp5 := {1, *, 3};
234var setof_int x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10;
235//x0 := {omit}
236x1 := {}
237x2 := {1}
238x3 := {2}
239x4 := {2, 1}
240x5 := {3, 2, 1}
241x6 := {1, 3}
242x7 := {3, 1}
243x8 := {1, 2, 3}
244x9 := {3, 2, 1}
245x10 := {4, 3, 2, 1}
246 //match - matches everything
247 /*
248if (match(x0,setof_temp4)) {setverdict(pass);}
249 else {setverdict(fail);}
250 */
251if (match(x1,setof_temp4)) {setverdict(pass);}
252 else {setverdict(fail);}
253if (match(x2,setof_temp4)) {setverdict(pass);}
254 else {setverdict(fail);}
255if (match(x3,setof_temp4)) {setverdict(pass);}
256 else {setverdict(fail);}
257if (match(x4,setof_temp4)) {setverdict(pass);}
258 else {setverdict(fail);}
259if (match(x5,setof_temp4)) {setverdict(pass);}
260 else {setverdict(fail);}
261//match - in same and reverse order
262if (match(x6,setof_temp5)) {setverdict(pass);}
263 else {setverdict(fail);}
264if (match(x7,setof_temp5)) {setverdict(pass);}
265 else {setverdict(fail);}
266//match - with one or more anyvalues
267if (match(x8,setof_temp5)) {setverdict(pass);}
268 else {setverdict(fail);}
269if (match(x9,setof_temp5)) {setverdict(pass);}
270 else {setverdict(fail);}
271if (match(x10,setof_temp5)) {setverdict(pass);}
272 else {setverdict(fail);}
273}
274
275testcase tsetofRecordofAnyorNoneMatch() runs on my_comp {
276// setof_recordof setof_temp6 := {*, {1,2}, {3}, *};
277var setof_recordof x1, x2, x3, x4, x5, x6, x7;
278x1 := {{1,2},{3}};
279x2 := {{3},{1,2}};
280x3 := {{2,1},{3}};
281x4 := {{1,2},{3},{1,2}};
282x5 := {{1,2,3},{1},{2},{3},{1,2},{2,3},{1,3}};
283x6 := {{1,2,3},{3},{2,3},{1,3},{3,3}};
284x7 := {{1,2}};
285//match in both order
286if (match(x1,setof_temp6)) {setverdict(pass);}
287 else {setverdict(fail);}
288if (match(x2,setof_temp6)) {setverdict(pass);}
289 else {setverdict(fail);}
290//no match - wrong order in the record
291if (not(match(x3,setof_temp6))) {setverdict(pass);}
292 else {setverdict(fail);}
293//match - use anyornone values
294if (match(x4,setof_temp6)) {setverdict(pass);}
295 else {setverdict(fail);}
296if (match(x5,setof_temp6)) {setverdict(pass);}
297 else {setverdict(fail);}
298//no match - no match for one of the elements
299if (not(match(x6,setof_temp6))) {setverdict(pass);}
300 else {setverdict(fail);}
301if (not(match(x7,setof_temp6))) {setverdict(pass);}
302 else {setverdict(fail);}
303}
304
305testcase tsetofSetofMatch() runs on my_comp {
306// setof_setof setof_temp7 := {{?,1}, {7,3}, ?, {5,*}};
307var setof_setof x1, x2, x3, x4, x5;
308x1 := {{1,1},{7,3},{8,9},{5}};
309x2 := {{7,6,5},{1,0},{3,7},{11}};
310x3 := {{5,7,3},{7,3},{},{1,5}};
311x4 := {{7,3},{1,2},{5}};
312x5 := {{1,1,1},{3,7},{2,3},{5,5}};
313//match - in the same order
314if (match(x1,setof_temp7)) {setverdict(pass);}
315 else {setverdict(fail);}
316//match - in different order
317if (match(x2,setof_temp7)) {setverdict(pass);}
318 else {setverdict(fail);}
319if (match(x3,setof_temp7)) {setverdict(pass);}
320 else {setverdict(fail);}
321//no match: too few elements
322if (not(match(x4,setof_temp7))) {setverdict(pass);}
323 else {setverdict(fail);}
324//no match: first element unmatched
325if (not(match(x5,setof_temp7))) {setverdict(pass);}
326 else {setverdict(fail);}
327}
328
329testcase tsetofSetofLengthMatch1() runs on my_comp {
330//template setof_setof setof_temp8 := {{1,*}, * length (4)};
331// Note: the interpretation of the asterisk with length restriction is
332// unspecified in the standard.
333// In our interpretation the asterisk matches exactly one element if it has
334// extra matching attributes (e.g. length restriction).
335// That is, * length(4) and ? length(4) are treated as equivalents.
336var setof_setof x1, x2, x3, x4, x5, x6, x7, x8;
337x1 := {{1},{1,1,1,1}};
338x2 := {{1,2,3,4},{5,1}};
339x3 := {{1,2,3},{1,2,3,4},{4,3,2,1}};
340x4 := {{5,1}};
341x5 := {{2,3,4,5}};
342x6 := {{1},{1,2},{1,2,3,4}};
343x8 := {{1},{1,2,3,4},{1,2}};
344x7 := {{1},{1,2}};
345//match - in same order
346if (match(x1,setof_temp8)) {setverdict(pass);}
347 else {setverdict(fail);}
348//match - in different order
349if (match(x2,setof_temp8)) {setverdict(pass);}
350 else {setverdict(fail);}
351//no match - multiple fixed length elements
352if (not match(x3,setof_temp8)) {setverdict(pass);}
353 else {setverdict(fail);}
354//no match - no fixed length elements
355if (not match(x4,setof_temp8)) {setverdict(pass);}
356 else {setverdict(fail);}
357//no match: element unmatched
358if (not match(x5,setof_temp8)) {setverdict(pass);}
359 else {setverdict(fail);}
360//no match - element of wrong length
361if (not(match(x6,setof_temp8))) {setverdict(pass);}
362 else {setverdict(fail);}
363if (not(match(x8,setof_temp8))) {setverdict(pass);}
364 else {setverdict(fail);}
365if (not(match(x7,setof_temp8))) {setverdict(pass);}
366 else {setverdict(fail);}
367}
368
369testcase tsetofIntValueListMatch() runs on my_comp {
370//template setof_int setof_temp9 := ({1},{2,?},{3..5,?,?});
371var setof_int x1, x2, x3, x4, x5, x6, x7, x8, x9, x10;
372x1 := {1};
373x2 := {2,5};
374x3 := {3,3,3};
375x4 := {1,2,3};
376x5 := {2,1};
377x6 := {2};
378x7 := {1,2,6};
379x8 := {1,3};
380x9 := {1,2,2};
381x10 := {1,2,3,4};
382//match
383if (match(x1,setof_temp9)) {setverdict(pass);}
384 else {setverdict(fail);}
385if (match(x2,setof_temp9)) {setverdict(pass);}
386 else {setverdict(fail);}
387if (match(x3,setof_temp9)) {setverdict(pass);}
388 else {setverdict(fail);}
389if (match(x4,setof_temp9)) {setverdict(pass);}
390 else {setverdict(fail);}
391if (match(x5,setof_temp9)) {setverdict(pass);}
392 else {setverdict(fail);}
393//no match
394if (not(match(x6,setof_temp9))) {setverdict(pass);}
395 else {setverdict(fail);}
396if (not(match(x7,setof_temp9))) {setverdict(pass);}
397 else {setverdict(fail);}
398if (not(match(x8,setof_temp9))) {setverdict(pass);}
399 else {setverdict(fail);}
400if (not(match(x9,setof_temp9))) {setverdict(pass);}
401 else {setverdict(fail);}
402if (not(match(x10,setof_temp9))) {setverdict(pass);}
403 else {setverdict(fail);}
404}
405
406testcase tsetofSetofLengthMatch2() runs on my_comp {
407//template setof_setof setof_temp10 := {* length(2), * length(3), *};
408// See the note for testcase tsetofSetofLengthMatch1
409var setof_setof x1, x2, x3, x4, x5;
410x1 := {};
411x2 := {{1,2},{2,3},{1,2,3}};
412x3 := {{1}, {1,2}};
413x4 := {{1,2,3},{4,3}};
414x5 := {{},{}};
415//no match - empty set
416if (not match(x1,setof_temp10)) {setverdict(pass);}
417 else {setverdict(fail);}
418//match - lengths are ok
419if (match(x2,setof_temp10)) {setverdict(pass);}
420 else {setverdict(fail);}
421//no match: length too short
422if (not(match(x3,setof_temp10))) {setverdict(pass);}
423 else {setverdict(fail);}
424//match: lengths are ok
425if (match(x4,setof_temp10)) {setverdict(pass);}
426 else {setverdict(fail);}
427//no match: lengths are zero
428if (not(match(x5,setof_temp10))) {setverdict(pass);}
429 else {setverdict(fail);}
430}
431
432 testcase tsetofSuperset1() runs on my_comp {
433 template setof_int t1 := superset(1, 2, 3);
434 template setof_int t2 := superset(5, 4, 3, 2, 1);
435 template setof_int t3 := superset(5, 4, 3, 2, 1, 6);
436 template setof_int t4 := superset(5, 4, 3, 2, 1, ?);
437 template setof_int t5 := superset(5, 4, 3, 2, ?);
438 template setof_int t6 := superset(?, 5, 4, 3, 2);
439 template setof_int t7 := superset(?, 5, 4, 3, 2, *);
440 template setof_int t8 := superset(?, 5, 4, 3, *);
441 template setof_int t9 := superset(5, 4, 3, 2, 1, ?, *);
442 template setof_int t1a := superset(1, 7, 2, 3);
443 template setof_int t2a := superset(5, 4, 7, 3, 2, 1);
444 template setof_int t3a := superset(5, 4, 3, 7, 2, 1, 6);
445 template setof_int t4a := superset(5, 7, 4, 3, 2, 1, ?);
446 template setof_int t5a := superset(5, 4, 3, 2, ?, 7);
447 template setof_int t6a := superset(?, 5, 7, 4, 3, 2);
448 template setof_int t7a := superset(7, ?, 5, 4, 3, 2, *);
449 template setof_int t8a := superset(?, 5, 4, 7, 3, *);
450 template setof_int t9a := superset(5, 4, 3, 2, 7, 1, ?, *);
451 template setof_int t10 := superset(?, ?, ?, ?, ?, ?);
452 template setof_int t11 := superset(?, ?, ?, ?, ?);
453
454 if(match(setof_const1, t1)) {setverdict(pass);}
455 else {setverdict(fail);}
456 if(match(setof_const1, t2)) {setverdict(pass);}
457 else {setverdict(fail);}
458 if(not match(setof_const1, t3)) {setverdict(pass);}
459 else {setverdict(fail);}
460 if(not match(setof_const1, t4)) {setverdict(pass);}
461 else {setverdict(fail);}
462 if(match(setof_const1, t5)) {setverdict(pass);}
463 else {setverdict(fail);}
464 if(match(setof_const1, t6)) {setverdict(pass);}
465 else {setverdict(fail);}
466 if(match(setof_const1, t7)) {setverdict(pass);}
467 else {setverdict(fail);}
468 if(match(setof_const1, t8)) {setverdict(pass);}
469 else {setverdict(fail);}
470 if(not match(setof_const1, t9)) {setverdict(pass);}
471 else {setverdict(fail);}
472
473 if(not match(setof_const1, t1a)) {setverdict(pass);}
474 else {setverdict(fail);}
475 if(not match(setof_const1, t2a)) {setverdict(pass);}
476 else {setverdict(fail);}
477 if(not match(setof_const1, t3a)) {setverdict(pass);}
478 else {setverdict(fail);}
479 if(not match(setof_const1, t4a)) {setverdict(pass);}
480 else {setverdict(fail);}
481 if(not match(setof_const1, t5a)) {setverdict(pass);}
482 else {setverdict(fail);}
483 if(not match(setof_const1, t6a)) {setverdict(pass);}
484 else {setverdict(fail);}
485 if(not match(setof_const1, t7a)) {setverdict(pass);}
486 else {setverdict(fail);}
487 if(not match(setof_const1, t8a)) {setverdict(pass);}
488 else {setverdict(fail);}
489 if(not match(setof_const1, t9a)) {setverdict(pass);}
490 else {setverdict(fail);}
491
492 if(not match(setof_const1, t10)) {setverdict(pass);}
493 else {setverdict(fail);}
494 if(match(setof_const1, t11)) {setverdict(pass);}
495 else {setverdict(fail);}
496
497 /* --- */
498
499 template setof_setof tt1 := superset(t1);
500 template setof_setof tt2 := superset(t2, superset(1));
501 template setof_setof tt3 := superset(t5, superset(1), superset(1));
502 template setof_setof tt4 := superset(t6, superset(1), superset(1, 0));
503 template setof_setof tt5 := superset(t7, superset(1), superset(1, 2));
504 template setof_setof tt6 := superset(t7, superset(1), t3);
505
506 if(match(setof_const5, tt1)) {setverdict(pass);}
507 else {setverdict(fail);}
508 if(match(setof_const5, tt2)) {setverdict(pass);}
509 else {setverdict(fail);}
510 if(match(setof_const5, tt3)) {setverdict(pass);}
511 else {setverdict(fail);}
512 if(match(setof_const5, tt4)) {setverdict(pass);}
513 else {setverdict(fail);}
514 if(not match(setof_const5, tt5)) {setverdict(pass);}
515 else {setverdict(fail);}
516 if(not match(setof_const5, tt6)) {setverdict(pass);}
517 else {setverdict(fail);}
518 }
519
520 testcase tsetofSuperset2() runs on my_comp {
521 template setof_enum t1 := superset(buckler);
522 template setof_enum t2 := superset(coronita);
523 template setof_enum t3 := superset(coronita, buckler);
524 template setof_enum t4 := superset(coronita, amstel);
525
526 if(not match(setof_const2, t1)) {setverdict(pass);}
527 else {setverdict(fail);}
528 if(match(setof_const2, t2)) {setverdict(pass);}
529 else {setverdict(fail);}
530 if(not match(setof_const2, t3)) {setverdict(pass);}
531 else {setverdict(fail);}
532 if(match(setof_const2, t4)) {setverdict(pass);}
533 else {setverdict(fail);}
534 }
535
536 testcase tsetofSubset1() runs on my_comp {
537 template setof_int t1 := subset(1, 2, 3);
538 template setof_int t2 := subset(1, 2, 3, 4, 5, 6);
539 template setof_int t3 := subset(6, 5, 4, 3, 2, 1);
540 template setof_int t4 := subset(?);
541 template setof_int t5 := subset(*);
542 template setof_int t6 := subset(?, ?, ?, ?);
543 template setof_int t7 := subset(?, ?, ?, ?, ?);
544 template setof_int t8 := subset(?, ?, ?, ?, ?, ?);
545 template setof_int t9 := subset(?, ?, ?, ?, *);
546 template setof_int t10 := subset(2, 3, 4, 5, 6);
547 template setof_int t11 := subset(2, 3, 4, 5, 6, ?);
548 template setof_int t12 := subset(2, 3, 4, 5, 6, *);
549 template setof_int t13 := subset(3, 4, 5, 6, ?);
550
551 if(not match(setof_const1, t1)) {setverdict(pass);}
552 else {setverdict(fail);}
553 if(match(setof_const1, t2)) {setverdict(pass);}
554 else {setverdict(fail);}
555 if(match(setof_const1, t3)) {setverdict(pass);}
556 else {setverdict(fail);}
557 if(not match(setof_const1, t4)) {setverdict(pass);}
558 else {setverdict(fail);}
559 if(match(setof_const1, t5)) {setverdict(pass);}
560 else {setverdict(fail);}
561 if(not match(setof_const1, t6)) {setverdict(pass);}
562 else {setverdict(fail);}
563 if(match(setof_const1, t7)) {setverdict(pass);}
564 else {setverdict(fail);}
565 if(match(setof_const1, t8)) {setverdict(pass);}
566 else {setverdict(fail);}
567 if(match(setof_const1, t9)) {setverdict(pass);}
568 else {setverdict(fail);}
569 if(not match(setof_const1, t10)) {setverdict(pass);}
570 else {setverdict(fail);}
571 if(match(setof_const1, t11)) {setverdict(pass);}
572 else {setverdict(fail);}
573 if(match(setof_const1, t12)) {setverdict(pass);}
574 else {setverdict(fail);}
575 if(not match(setof_const1, t13)) {setverdict(pass);}
576 else {setverdict(fail);}
577 }
578
579 testcase tsetofSubset2() runs on my_comp {
580 template setof_enum t1 := subset(buckler);
581 template setof_enum t2 := subset(coronita);
582 template setof_enum t3 := subset(coronita, buckler);
583 template setof_enum t4 := subset(coronita, amstel);
584 template setof_enum t5 := subset(coronita, buckler, amstel);
585
586 if(not match(setof_const2, t1)) {setverdict(pass);}
587 else {setverdict(fail);}
588 if(not match(setof_const2, t2)) {setverdict(pass);}
589 else {setverdict(fail);}
590 if(not match(setof_const2, t3)) {setverdict(pass);}
591 else {setverdict(fail);}
592 if(match(setof_const2, t4)) {setverdict(pass);}
593 else {setverdict(fail);}
594 if(match(setof_const2, t5)) {setverdict(pass);}
595 else {setverdict(fail);}
596 }
597
598control {
599execute(setofIntAssign());
600execute(setofIntEq());
601execute(setofSetofEq());
602
603execute(tsetofIntSpecValueMatch());
604execute(tsetofEnumAnyValueMatch());
605execute(tsetofIntAnyorNoneMatch());
606execute(tsetofRecordofAnyorNoneMatch());
607execute(tsetofSetofMatch());
608execute(tsetofSetofLengthMatch1());
609execute(tsetofIntValueListMatch());
610execute(tsetofSetofLengthMatch2());
611 execute(tsetofSuperset1());
612 execute(tsetofSuperset2());
613 execute(tsetofSubset1());
614 execute(tsetofSubset2());
615}
616}
This page took 0.047639 seconds and 5 git commands to generate.