Sync with 5.4.2
[deliverable/titan.core.git] / regression_test / all_from / all_from.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 all_from { // ETSI CR 6088
9import from types all;
10import from functions all;
11import from imported_templates all;
12
13//just to test these types as well:
14modulepar RoI tsp_RoI3 := {20,21,22};
15modulepar RoI tsp_SoI3 := {20,21,22};
16
17const RoI c_RoI3 := {20,21,22};
18const SoI c_SoI3 := {20,21,22};
19
20// Test Target:
21// ETSI ES 201 873-1 v?.?
22// B 1.2.1 Template List
23//"It can be used on values of all types"
24
25//============Record of Integer============================
26template RoI t_RoI1 := {1, 2, (6..9)};
27template RoI t_RoI2 := {1, *, 3};
28template RoI t_RoI3 := {20,21,22};
29template RoI t_RoI4 := {1, ?, 3};
30
31template integer t_i0 := (all from t_RoI1);
32template integer t_i0_eq := (1, 2, (6..9));
33
34template integer t_i1 := (all from t_RoI1, 100);
35template integer t_i1_eq := (1, 2, (6..9), 100);
36
37template integer t_i2 := (-1,0,all from t_RoI1, 100);
38template integer t_i2_eq:=(-1,0,1, 2, (6..9),100);
39
40template integer t_i3 := (-1,0,all from t_RoI1, all from t_RoI3, 100);
41template integer t_i3_eq := (-1,0,1, 2, (6..9), 20,21,22, 100);
42
43template integer t_i4 := (-1,0,all from t_RoI1, 100, all from t_RoI3);
44template integer t_i4_eq := (-1,0,1, 2, (6..9),100,20,21,22);
45
46template integer t_i5 := (-1,0,all from t_RoI1, 100,all from t_RoI3,all from t_RoI3 ); //repetition
47template integer t_i5_eq := (-1,0,1, 2, (6..9),100,20,21,22,20,21,22);
48
49template integer t_i6 := (-1,0,all from t_RoI1, 100, all from t_RoI3,all from t_RoI3,all from t_RoI3); //repetition
50template integer t_i6_eq := (-1,0,1, 2, (6..9),100,20,21,22,20,21,22,20,21,22);
51
52template integer t_i7 := (all from t_RoI4,100);
53template integer t_i7_eq := (1,?,3,100);
54
55template integer t_i8 := (100,all from t_RoI4);
56template integer t_i8_eq := (100,1,?,3);
57
58template integer t_i9 := (100,all from t_RoI4,-1);
59template integer t_i9_eq := (100,1,?,3,-1);
60//NEG TEST: template integer t_i10 := ((all from t_RoI2),100); //<== WHY not if the previous three accepted?
61//NEG TEST: template integer t_i11 := (100,all from t_RoI2);
62//NEG TEST: template integer t_i12 := (100,all from t_RoI2,-1);
63
64//from modulepar:
65template integer t_i13roi := (all from tsp_RoI3);
66template integer t_i13_eq := (20,21,22);
67template integer t_i13soi := (all from tsp_SoI3);
68
69//from const:
70template integer t_i13roi_c := (all from c_RoI3);
71template integer t_i13soi_c := (all from c_SoI3);
72
73
74//=== All from referring remote templates (imported templates)
75template integer t_importing_i0 := (all from t_imported_RoI1);
76template integer t_importing_i1 := (all from t_imported_RoI1, 100);
77template integer t_importing_i2 := (-1,0,all from t_imported_RoI1, 100);
78template integer t_importing_i3 := (-1,0,all from t_imported_RoI1, all from t_imported_RoI3, 100);
79template integer t_importing_i4 := (-1,0,all from t_imported_RoI1, 100, all from t_imported_RoI3);
80template integer t_importing_i5 := (-1,0,all from t_imported_RoI1, 100,all from t_imported_RoI3,all from t_imported_RoI3 ); //repetition
81template integer t_importing_i6 := (-1,0,all from t_imported_RoI1, 100, all from t_imported_RoI3,all from t_imported_RoI3,all from t_imported_RoI3); //repetition
82template integer t_importing_i7 := (all from t_imported_RoI4,100);
83template integer t_importing_i8 := (100,all from t_imported_RoI4);
84template integer t_importing_i9 := (100,all from t_imported_RoI4,-1);
85
86
87//===========Set of Integer================================
88template SoI t_SoI1 := {1,2,(6..9)};
89template SoI t_SoI2 := {1, *, 3};
90template SoI t_SoI3 := {20,21,22};
91
92template integer t_i0s := (all from t_SoI1);
93template integer t_i0s_eq := ( 1,2,(6..9));
94
95template integer t_i1s := (all from t_SoI1, 100);
96template integer t_i1s_eq := ( 1,2,(6..9),100);
97// equivalent to (1, 2, (6..9) , 100);
98
99template integer t_i2s := (-1,0,all from t_SoI1, 100);
100template integer t_i2s_eq:=(-1,0,1,2,(6..9), 100);
101
102template integer t_i3s := (-1,0,all from t_SoI1, all from t_SoI3, 100);
103template integer t_i3s_eq := (-1,0,1,2,(6..9),20,21,22, 100);
104
105template integer t_i4s := (-1,0,all from t_SoI1, 100, all from t_SoI3);
106template integer t_i4s_eq := (-1,0,1,2,(6..9),100,20,21,22);
107
108template integer t_i5s := (-1,0,all from t_imported_SoI1, 100, all from t_imported_SoI3,all from t_imported_SoI3 ); //repetition
109template integer t_i5s_eq := (-1,0,1,2,(6..9),100,20,21,22,20,21,22);
110
111template integer t_i6s := (-1,0,all from t_imported_SoI1, 100, all from t_imported_SoI3,all from t_imported_SoI3,all from t_imported_SoI3); //repetition
112template integer t_i6s_eq := (-1,0,1,2,(6..9),100,20,21,22,20,21,22,20,21,22);
113
114template integer t_importing_i0s := (all from t_imported_SoI1);
115template integer t_importing_i1s := (all from t_imported_SoI1, 100);
116template integer t_importing_i2s := (-1,0,all from t_imported_SoI1, 100);
117template integer t_importing_i3s := (-1,0,all from t_imported_SoI1, all from t_imported_SoI3, 100);
118template integer t_importing_i4s := (-1,0,all from t_imported_SoI1, 100, all from t_imported_SoI3);
119template integer t_importing_i5s := (-1,0,all from t_imported_SoI1, 100, all from t_imported_SoI3,all from t_imported_SoI3 ); //repetition
120template integer t_importing_i6s := (-1,0,all from t_SoI1, 100, all from t_SoI3,all from t_SoI3,all from t_SoI3); //repetition
121
122//===========Record of of charstring================================
123template RoCS t_RoCS1 := { "apple","banana","","pear"};
124template RoCS t_RoCS2 := { "apples","bananas","","pears"};
125template charstring t_cs1 := ( all from t_RoCS1, "dog" );
126template charstring t_cs1_eq := ( "apple","banana","","pear", "dog" );
127template charstring t_cs2 := ( "treeeeeeeeeeeeee",all from t_RoCS1, "dog", all from t_RoCS2);
128template charstring t_cs2_eq := ( "treeeeeeeeeeeeee","apple","banana","","pear", "dog","apples","bananas","","pears");
129
130//===========Record of octetstring================================
131template RoOS t_RoOS1 := {'ABBA'O,'BABA'O,'FFFF'O,'00'O,'0B'O}
132template octetstring t_os1 := ( all from t_RoOS1 );
133template octetstring t_os1_eq := ('ABBA'O,'BABA'O,'FFFF'O,'00'O,'0B'O)
134template octetstring t_os2 := ( 'AA'O,all from t_RoOS1,all from t_RoOS1);
135
136//====== Embedded templates ====
137//Record
138template MyRecord t_myrec1 := { i:= t_i1, roi:=t_RoI1, soi:=t_SoI1 }
139template MyRecord t_myrec1_eq := { i:= t_i1_eq, roi:=t_RoI1, soi:={1,2,(6..9)} }
140
141template MyRecord t_myrec2 := { i:= t_i2, roi:=t_RoI1, soi:=t_SoI1 }
142template MyRecord t_myrec2_eq := { i:= t_i2_eq, roi:=t_RoI1, soi:= {1,2,(6..9)}}
143
144template MyRecord t_myrec3 := { i:= t_i2, roi:={t_i0s,t_i1}, soi:=t_SoI1 }
145template MyRecord t_myrec3_eq := { i:= t_i2_eq, roi:={( 1,2,(6..9)),(1, 2, (6..9), 100)}, soi:={1,2,(6..9)} }
146
147//Union
148template MyUnion t_myunion1i := { i:= t_i1}
149template MyUnion t_myunion1roi := { roi:={t_i1,t_i1}}
150template MyUnion t_myunion1soi := { soi:={t_i1,t_i1}}
151
152template MyUnion t_myunion1i_eq := { i:= t_i1_eq}
153template MyUnion t_myunion1roi_eq := { roi:= {(1, 2, (6..9)),(1, 2, (6..9))}}
154template MyUnion t_myunion1soi_eq := { soi:= {(1, 2, (6..9)),(1, 2, (6..9))}}
155
156template MyUnion t_myunion2i := { i:= t_i2 }
157template MyUnion t_myunion2roi := { roi:=t_RoI1 }
158template MyUnion t_myunion2soi := { soi:=t_SoI1 }
159
160template MyUnion t_myunion2i_eq := { i:= t_i2_eq }
161template MyUnion t_myunion2roi_eq := { roi:={1, 2,(6..9)} };
162template MyUnion t_myunion2soi_eq := { soi:= {1,2,(6..9)} };
163
164template MyUnion t_myunion3 := { roi:={t_i0s,t_i1}}
165template MyUnion t_myunion3_eq := {roi:={ ( 1,2,(6..9)),(1, 2, (6..9), 100)}}
166
167//Complex
168template RoI t_roiComplex1 := { t_i0s, (all from t_SoI3) };
169template RoI t_roiComplex1_eq := { ( 1,2,(6..9)), (20,21,22)};
170template integer t_complex1 := (all from t_roiComplex1);
171template integer t_complex1_eq := ( ( 1,2,(6..9)), (20,21,22));
172
173//==== function reference =====
174template RoF_int2int t_rofref_int2int := { refers(f_int2int_1),refers(f_int2int_2) }
175template F_int2int t_fref_int2int := ( all from t_rofref_int2int );
176template F_int2int t_fref_int2int_eq := ( refers(f_int2int_1),refers(f_int2int_2) );
177
178//============== Test for Integer List ================================
179
180
181//----- Tests for static templates ------
182
183//real static template, without any manipulation
184testcase tc_checkIntegerValueListTemplate() runs on A
185{
186 var RoI vl_goodValues := { 1,2,6,7,8,9,100};
187 action("t_i1=", t_i1, " will be checked against ",vl_goodValues);
188 var integer N:=sizeof(vl_goodValues);
189 for(var integer i:=0;i<N;i:=i+1) {
190 if (match(vl_goodValues[i], t_i1)) { setverdict(pass); }
191 else { setverdict(fail,vl_goodValues[i], " should match ", t_i1); }
192 }
193
194 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
195 action("t_i1=", t_i1, " will be checked against ",vl_badValues);
196 N:=sizeof(vl_badValues);
197 for(var integer i:=0;i<N;i:=i+1) {
198 if (not match(vl_badValues[i], t_i1)) { setverdict(pass); }
199 else { setverdict(fail,vl_badValues[i], " should match ", t_i1); }
200 }
201
202}
203
204//=== 0 ===
205//( 1,2,(6..9));
206testcase tc_checkIntegerValueListTemplate0_eq() runs on A{
207 f_checkIntTemplateEquivalence(t_i0,t_i0_eq);
208}
209
210testcase tc_checkImportingIntegerValueListTemplate0_eq() runs on A{
211 f_checkIntTemplateEquivalence(t_importing_i0,t_i0_eq);
212}
213
214testcase tc_checkIntegerValueListTemplate0() runs on A
215{
216 var RoI vl_goodValues := { 1,2,6,7,8,9};
217 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,100,101,102,200,1000, 100000000000000};
218 f_checkIntegerTemplate(t_i0,vl_goodValues,vl_badValues);
219}
220
221testcase tc_checkImportingIntegerValueListTemplate0() runs on A
222{
223 var RoI vl_goodValues := { 1,2,6,7,8,9};
224 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,100,101,102,200,1000, 100000000000000};
225 f_checkIntegerTemplate(t_importing_i0,vl_goodValues,vl_badValues);
226}
227//=== 1 ===
228//( 1,2,(6..9),100);
229testcase tc_checkIntegerValueListTemplate1_eq() runs on A{
230 f_checkIntTemplateEquivalence(t_i1,t_i1_eq);
231}
232
233testcase tc_checkImportingIntegerValueListTemplate1_eq() runs on A{
234 f_checkIntTemplateEquivalence(t_importing_i1,t_i1_eq);
235}
236
237testcase tc_checkIntegerValueListTemplate1() runs on A
238{
239 var RoI vl_goodValues := { 1,2,6,7,8,9,100};
240 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
241 f_checkIntegerTemplate(t_i1,vl_goodValues,vl_badValues);
242}
243
244testcase tc_checkImportingIntegerValueListTemplate1() runs on A
245{
246 var RoI vl_goodValues := { 1,2,6,7,8,9,100};
247 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
248 f_checkIntegerTemplate(t_importing_i1,vl_goodValues,vl_badValues);
249}
250//=== 2 ===
251//(-1,0,1,2,(6..9), 100);
252testcase tc_checkIntegerValueListTemplate2_eq() runs on A{
253 f_checkIntTemplateEquivalence(t_i2,t_i2_eq);
254}
255
256testcase tc_checkImportingIntegerValueListTemplate2_eq() runs on A{
257 f_checkIntTemplateEquivalence(t_importing_i2,t_i2_eq);
258}
259testcase tc_checkIntegerValueListTemplate2() runs on A
260{
261 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100};
262 var RoI vl_badValues := { -99,-10,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
263 f_checkIntegerTemplate(t_i2,vl_goodValues,vl_badValues);
264}
265testcase tc_checkImportingIntegerValueListTemplate2() runs on A
266{
267 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100};
268 var RoI vl_badValues := { -99,-10,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
269 f_checkIntegerTemplate(t_importing_i2,vl_goodValues,vl_badValues);
270}
271//=== 3 ===
272//(-1,0,1,2,(6..9),20,21,22, 100);
273testcase tc_checkIntegerValueListTemplate3_eq() runs on A{
274 f_checkIntTemplateEquivalence(t_i3,t_i3_eq);
275}
276testcase tc_checkIntegerValueListTemplate3() runs on A
277{
278 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
279 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
280 f_checkIntegerTemplate(t_i3,vl_goodValues,vl_badValues);
281}
282//=== 4 ===
283//order;(-1,0,1,2,(6..9),100,20,21,22);
284testcase tc_checkIntegerValueListTemplate4_eq() runs on A{
285 f_checkIntTemplateEquivalence(t_i4,t_i4_eq);
286}
287testcase tc_checkIntegerValueListTemplate4() runs on A
288{
289 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
290 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
291 f_checkIntegerTemplate(t_i4,vl_goodValues,vl_badValues);
292}
293
294//=== 5 ===
295//repetition
296//(-1,0,1,2,(6..9),100,20,21,22,20,21,22);
297testcase tc_checkIntegerValueListTemplate5_eq() runs on A{
298 f_checkIntTemplateEquivalence(t_i5,t_i5_eq);
299}
300testcase tc_checkIntegerValueListTemplate5() runs on A
301{
302 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
303 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
304 f_checkIntegerTemplate(t_i5,vl_goodValues,vl_badValues);
305}
306
307//=== 6 ===
308//(-1,0,1,2,(6..9),100,20,21,22,20,21,22,20,21,22);
309testcase tc_checkIntegerValueListTemplate6_eq() runs on A{
310 f_checkIntTemplateEquivalence(t_i6,t_i6_eq);
311}
312testcase tc_checkIntegerValueListTemplate6() runs on A
313{
314 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
315 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
316 f_checkIntegerTemplate(t_i6,vl_goodValues,vl_badValues);
317}
318//=== 7 ===
319//(1,?,3,100);
320testcase tc_checkIntegerValueListTemplate7_eq() runs on A{
321 f_checkIntTemplateEquivalence(t_i7,t_i7_eq);
322}
323testcase tc_checkIntegerValueListTemplate7() runs on A
324{
325 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
326 var RoI vl_badValues := { };
327 f_checkIntegerTemplate(t_i7,vl_goodValues,vl_badValues);
328}
329//=== 8 ===
330//(100,all from t_RoI4);
331testcase tc_checkIntegerValueListTemplate8_eq() runs on A{
332 f_checkIntTemplateEquivalence(t_i8,t_i8_eq);
333}
334testcase tc_checkIntegerValueListTemplate8() runs on A
335{
336 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
337 var RoI vl_badValues := { };
338 f_checkIntegerTemplate(t_i8,vl_goodValues,vl_badValues);
339}
340//=== 9 ===
341//(100,1,?,3,-1);
342testcase tc_checkIntegerValueListTemplate9_eq() runs on A{
343 f_checkIntTemplateEquivalence(t_i9,t_i9_eq);
344}
345testcase tc_checkIntegerValueListTemplate9() runs on A
346{
347 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
348 var RoI vl_badValues := { };
349 f_checkIntegerTemplate(t_i9,vl_goodValues,vl_badValues);
350}
351
352/* wrong?
353testcase tc_checkIntegerValueListTemplate10() runs on A
354{
355 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
356 var RoI vl_badValues := { };
357 f_checkIntegerTemplate(t_i10,vl_goodValues,vl_badValues);
358}
359
360testcase tc_checkIntegerValueListTemplate11() runs on A
361{
362 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
363 var RoI vl_badValues := { };
364 f_checkIntegerTemplate(t_i11,vl_goodValues,vl_badValues);
365}
366
367testcase tc_checkIntegerValueListTemplate12() runs on A
368{
369 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
370 var RoI vl_badValues := { };
371 f_checkIntegerTemplate(t_i12,vl_goodValues,vl_badValues);
372}
373*/
374
375//=== i13 ===
376//(20,21,22);
377
378testcase tc_checkIntegerValueListTemplate13roi_eq() runs on A{
379 f_checkIntTemplateEquivalence(t_i13roi,t_i13_eq);
380}
381testcase tc_checkIntegerValueListTemplate13roi() runs on A
382{
383 var RoI vl_goodValues := {20,21,22};
384 var RoI vl_badValues := { };
385 f_checkIntegerTemplate(t_i13roi,vl_goodValues,vl_badValues);
386}
387
388testcase tc_checkIntegerValueListTemplate13soi_eq() runs on A{
389 f_checkIntTemplateEquivalence(t_i13soi,t_i13_eq);
390}
391testcase tc_checkIntegerValueListTemplate13soi() runs on A
392{
393 var RoI vl_goodValues := {20,21,22};
394 var RoI vl_badValues := { };
395 f_checkIntegerTemplate(t_i13soi,vl_goodValues,vl_badValues);
396}
397
398testcase tc_checkIntegerValueListTemplate13roi_c_eq() runs on A{
399 f_checkIntTemplateEquivalence(t_i13roi_c,t_i13_eq);
400}
401testcase tc_checkIntegerValueListTemplate13roi_c() runs on A
402{
403 var RoI vl_goodValues := {20,21,22};
404 var RoI vl_badValues := { };
405 f_checkIntegerTemplate(t_i13roi_c,vl_goodValues,vl_badValues);
406}
407
408testcase tc_checkIntegerValueListTemplate13soi_c_eq() runs on A{
409 f_checkIntTemplateEquivalence(t_i13soi_c,t_i13_eq);
410}
411testcase tc_checkIntegerValueListTemplate13soi_c() runs on A
412{
413 var RoI vl_goodValues := {20,21,22};
414 var RoI vl_badValues := { };
415 f_checkIntegerTemplate(t_i13soi_c,vl_goodValues,vl_badValues);
416}
417
418testcase tc_checkAllFromInFunctionCall_IntegerValueListInTemplate13roi_eq() runs on A{
419 var template integer tl_i := 0;
420 f_createIntegerWithAllFromFromInTemplateFromRoi(t_RoI3,tl_i);
421 f_checkIntTemplateEquivalence(tl_i,t_i13_eq);
422}
423
424testcase tc_checkAllFromInFunctionCall_IntegerValueListInOutTemplate13roi_eq() runs on A{
425 var template integer tl_i := 0;
426 f_createIntegerWithAllFromFromInTemplateFromRoi(t_RoI3,tl_i);
427 f_checkIntTemplateEquivalence(tl_i,t_i13_eq);
428}
429
430testcase tc_checkAllFromInFunctionCall_IntegerValueListInTemplate13soi_eq() runs on A{
431 var template integer tl_i := 0;
432 f_createIntegerWithAllFromFromInTemplateFromSoi(t_SoI3,tl_i);
433 f_checkIntTemplateEquivalence(tl_i,t_i13_eq);
434}
435
436testcase tc_checkAllFromInFunctionCall_IntegerValueListInOutTemplate13soi_eq() runs on A{
437 var template integer tl_i := 0;
438 f_createIntegerWithAllFromFromInTemplateFromSoi(t_SoI3,tl_i);
439 f_checkIntTemplateEquivalence(tl_i,t_i13_eq);
440}
441
442testcase tc_checkAllFromComponentVar_IntegerValueListTemplate13roi_eq() runs on A{
443 var template integer tl_i := (all from v_roi);
444 f_checkIntTemplateEquivalence(tl_i,t_i13_eq);
445}
446
447testcase tc_checkAllFromComponentVar_IntegerValueListTemplate13soi_eq() runs on A{
448 var template integer tl_i := (all from v_soi);
449 f_checkIntTemplateEquivalence(tl_i,t_i13_eq);
450}
451
452//====== templates derived from set of integers
453//=== i0s ===
454//t_i0s_eq := ( 1,2,(6..9));
455
456testcase tc_checkIntegerValueListTemplate0s_eq() runs on A{
457 f_checkIntTemplateEquivalence(t_i0s,t_i0s_eq);
458}
459
460testcase tc_checkImportingIntegerValueListTemplate0s_eq() runs on A{
461 f_checkIntTemplateEquivalence(t_importing_i0s,t_i0s_eq);
462}
463
464testcase tc_checkIntegerValueListTemplate0s() runs on A
465{
466 var RoI vl_goodValues := { 1,2,6,7,8,9};
467 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,100,101,102,200,1000, 100000000000000};
468 f_checkIntegerTemplate(t_i0s,vl_goodValues,vl_badValues);
469}
470testcase tc_checkImportingIntegerValueListTemplate0s() runs on A
471{
472 var RoI vl_goodValues := { 1,2,6,7,8,9};
473 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,100,101,102,200,1000, 100000000000000};
474 f_checkIntegerTemplate(t_importing_i0s,vl_goodValues,vl_badValues);
475}
476//=== i1s ==
477//t_i1s_eq := ( 1,2,(6..9),100);
478testcase tc_checkIntegerValueListTemplate1s_eq() runs on A{
479 f_checkIntTemplateEquivalence(t_i1s,t_i1s_eq);
480}
481testcase tc_checkImportingIntegerValueListTemplate1s_eq() runs on A{
482 f_checkIntTemplateEquivalence(t_importing_i1s,t_i1s_eq);
483}
484testcase tc_checkIntegerValueListTemplate1s() runs on A
485{
486 var RoI vl_goodValues := { 1,2,6,7,8,9,100};
487 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
488 f_checkIntegerTemplate(t_i1s,vl_goodValues,vl_badValues);
489}
490
491//=== i2s ===
492//(-1,0,1,2,(6..9), 100);
493testcase tc_checkIntegerValueListTemplate2s_eq() runs on A{
494 f_checkIntTemplateEquivalence(t_i2s,t_i2s_eq);
495}
496testcase tc_checkIntegerValueListTemplate2s() runs on A
497{
498 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100};
499 var RoI vl_badValues := { -99,-10,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
500 f_checkIntegerTemplate(t_i2s,vl_goodValues,vl_badValues);
501}
502
503//=== i3s ===
504//(-1,0,1,2,(6..9),20,21,22, 100);
505testcase tc_checkIntegerValueListTemplate3s_eq() runs on A{
506 f_checkIntTemplateEquivalence(t_i3s,t_i3s_eq);
507}
508testcase tc_checkIntegerValueListTemplate3s() runs on A
509{
510 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
511 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
512 f_checkIntegerTemplate(t_i3s,vl_goodValues,vl_badValues);
513}
514
515//=== i4s ===
516//order
517//(-1,0,1,2,(6..9),100,20,21,22);
518testcase tc_checkIntegerValueListTemplate4s_eq() runs on A{
519 f_checkIntTemplateEquivalence(t_i4s,t_i4s_eq);
520}
521testcase tc_checkIntegerValueListTemplate4s() runs on A
522{
523 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
524 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
525 f_checkIntegerTemplate(t_i4s,vl_goodValues,vl_badValues);
526}
527
528//=== i5s ===
529//repetition
530testcase tc_checkIntegerValueListTemplate5s_eq() runs on A{
531 f_checkIntTemplateEquivalence(t_i5s,t_i5s_eq);
532}
533testcase tc_checkIntegerValueListTemplate5s() runs on A
534{
535 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
536 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
537 f_checkIntegerTemplate(t_i5s,vl_goodValues,vl_badValues);
538}
539
540//=== i6s ===
541//(-1,0,1,2,(6..9),100,20,21,22,20,21,22,20,21,22);
542testcase tc_checkIntegerValueListTemplate6s_eq() runs on A{
543 f_checkIntTemplateEquivalence(t_i6s,t_i6s_eq);
544}
545testcase tc_checkIntegerValueListTemplate6s() runs on A
546{
547 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
548 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
549 f_checkIntegerTemplate(t_i6s,vl_goodValues,vl_badValues);
550}
551//-------- Tests for dynamic templates ( template variables) ----
552//=== i0 ===
553//( 1,2,(6..9));
554testcase tc_checkIntegerValueListTemplate0_eq_dyn() runs on A{
555 var template integer tl_i0 := (all from t_RoI1);
556 f_checkIntTemplateEquivalence(tl_i0,t_i0_eq);
557}
558
559testcase tc_checkImportingIntegerValueListTemplate0_eq_dyn() runs on A{
560 var template integer tl_importing_i0 := (all from t_imported_RoI1);
561 f_checkIntTemplateEquivalence(tl_importing_i0,t_i0_eq);
562}
563
564testcase tc_checkIntegerValueListTemplate0_eq_2dyn() runs on A{
565 var template RoI tl_RoI1 := {1, 2, (6..9)};
566 var template integer tl_i0 := (all from tl_RoI1);
567 f_checkIntTemplateEquivalence(tl_i0,t_i0_eq);
568}
569
570testcase tc_checkIntegerValueListTemplate0_dyn() runs on A
571{
572 var template integer tl_i0 := (all from t_RoI1);
573 var RoI vl_goodValues := { 1,2,6,7,8,9};
574 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,100,101,102,200,1000, 100000000000000};
575 f_checkIntegerTemplate(tl_i0,vl_goodValues,vl_badValues);
576}
577
578testcase tc_checkImportingIntegerValueListTemplate0_dyn() runs on A
579{
580 var template integer tl_importing_i0 := (all from t_imported_RoI1);
581 var RoI vl_goodValues := { 1,2,6,7,8,9};
582 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,100,101,102,200,1000, 100000000000000};
583 f_checkIntegerTemplate(tl_importing_i0,vl_goodValues,vl_badValues);
584}
585
586testcase tc_checkIntegerValueListTemplate0_2dyn() runs on A
587{
588 var template RoI tl_RoI1 := {1, 2, (6..9)};
589 var template integer tl_i0 := (all from tl_RoI1);
590 var RoI vl_goodValues := { 1,2,6,7,8,9};
591 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,100,101,102,200,1000, 100000000000000};
592 f_checkIntegerTemplate(tl_i0,vl_goodValues,vl_badValues);
593}
594//=== i1 ===
595testcase tc_checkIntegerValueListTemplate1_eq_dyn() runs on A
596{
597 var template integer tl_i1 := (all from t_RoI1, 100);
598 f_checkIntTemplateEquivalence(tl_i1,t_i1_eq);
599}
600testcase tc_checkIntegerValueListTemplate1_eq_2dyn() runs on A
601{
602 var template RoI tl_RoI1 := {1, 2, (6..9)};
603 var template integer tl_i1 := (all from tl_RoI1, 100);
604 f_checkIntTemplateEquivalence(tl_i1,t_i1_eq);
605}
606
607testcase tc_checkIntegerValueListTemplate1_dyn() runs on A
608{
609 var template integer tl_i1 := (all from t_RoI1, 100);
610 var RoI vl_goodValues := { 1,2,6,7,8,9,100};
611 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
612 f_checkIntegerTemplate(tl_i1,vl_goodValues,vl_badValues);
613}
614
615testcase tc_checkIntegerValueListTemplate1_2dyn() runs on A
616{
617 var template RoI tl_RoI1:= {1, 2, (6..9)};
618 var template integer tl_i1 := (all from tl_RoI1, 100);
619 var RoI vl_goodValues := {1,2,6,7,8,9,100};
620 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
621 f_checkIntegerTemplate(tl_i1,vl_goodValues,vl_badValues);
622}
623
624//=== i2 ===
625testcase tc_checkIntegerValueListTemplate2_eq_dyn() runs on A{
626 var template integer tl_i2 := (-1,0,all from t_RoI1, 100);
627 f_checkIntTemplateEquivalence(tl_i2,t_i2_eq);
628}
629testcase tc_checkIntegerValueListTemplate2_eq_2dyn() runs on A{
630 var template RoI tl_RoI1:= {1, 2, (6..9)};
631 var template integer tl_i2 := (-1,0,all from tl_RoI1, 100);
632 f_checkIntTemplateEquivalence(tl_i2,t_i2_eq);
633}
634testcase tc_checkIntegerValueListTemplate2_dyn() runs on A
635{
636 var template integer tl_i2 := (-1,0,all from t_RoI1, 100);
637 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100};
638 var RoI vl_badValues := { -99,-10,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
639 f_checkIntegerTemplate(tl_i2,vl_goodValues,vl_badValues);
640}
641
642testcase tc_checkIntegerValueListTemplate2_2dyn() runs on A
643{
644 var template RoI tl_RoI1:= {1, 2, (6..9)};
645 var template integer tl_i2 := (-1,0,all from tl_RoI1, 100);
646 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100};
647 var RoI vl_badValues := { -99,-10,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
648 f_checkIntegerTemplate(tl_i2,vl_goodValues,vl_badValues);
649}
650//=== i3 ===
651
652testcase tc_checkIntegerValueListTemplate3_eq_dyn() runs on A{
653 var template integer tl_i3 := (-1,0,all from t_RoI1, all from t_RoI3, 100);
654 f_checkIntTemplateEquivalence(tl_i3,t_i3_eq);
655}
656testcase tc_checkIntegerValueListTemplate3_eq_2dyn() runs on A{
657 var template RoI tl_RoI1:= {1, 2, (6..9)};
658 var template RoI tl_RoI3 := {20,21,22};
659 var template integer tl_i3 := (-1,0,all from tl_RoI1, all from tl_RoI3, 100);
660 f_checkIntTemplateEquivalence(tl_i3,t_i3_eq);
661}
662
663testcase tc_checkIntegerValueListTemplate3_dyn() runs on A
664{
665 var template integer tl_i3 := (-1,0,all from t_RoI1, all from t_RoI3, 100);
666 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,20,21,22,100};
667 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
668 f_checkIntegerTemplate(tl_i3,vl_goodValues,vl_badValues);
669}
670
671testcase tc_checkIntegerValueListTemplate3_2dyn() runs on A
672{
673 var template RoI tl_RoI1:= {1, 2, (6..9)};
674 var template RoI tl_RoI3 := {20,21,22};
675 var template integer tl_i4 := (-1,0,all from tl_RoI1, 100, all from tl_RoI3);
676 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
677 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
678 f_checkIntegerTemplate(tl_i4,vl_goodValues,vl_badValues);
679}
680
681//=== i4 ===
682testcase tc_checkIntegerValueListTemplate4_eq_dyn() runs on A{
683 var template integer tl_i4 := (-1,0,all from t_RoI1, 100, all from t_RoI3);
684 f_checkIntTemplateEquivalence(tl_i4,t_i4_eq);
685}
686testcase tc_checkIntegerValueListTemplate4_eq_2dyn() runs on A{
687 var template RoI tl_RoI1:= {1, 2, (6..9)};
688 var template RoI tl_RoI3 := {20,21,22};
689 var template integer tl_i4 := (-1,0,all from tl_RoI1, 100, all from tl_RoI3);
690 f_checkIntTemplateEquivalence(tl_i4,t_i4_eq);
691}
692
693testcase tc_checkIntegerValueListTemplate4_dyn() runs on A
694{
695 var template integer tl_i4 := (-1,0,all from t_RoI1, 100, all from t_RoI3);
696 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
697 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
698 f_checkIntegerTemplate(t_i4,vl_goodValues,vl_badValues);
699}
700
701testcase tc_checkIntegerValueListTemplate4_2dyn() runs on A
702{
703 var template RoI tl_RoI1:= {1, 2, (6..9)};
704 var template RoI tl_RoI3 := {20,21,22};
705 var template integer tl_i4 := (-1,0,all from tl_RoI1, 100, all from tl_RoI3);
706 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
707 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
708 f_checkIntegerTemplate(tl_i4,vl_goodValues,vl_badValues);
709}
710
711//=== i5 ===
712testcase tc_checkIntegerValueListTemplate5_eq_dyn() runs on A{
713 var template integer tl_i5 := (-1,0,all from t_RoI1, 100,all from t_RoI3,all from t_RoI3 )
714 f_checkIntTemplateEquivalence(tl_i5,t_i5_eq);
715}
716
717testcase tc_checkIntegerValueListTemplate5_eq_2dyn() runs on A{
718 var template RoI tl_RoI1:= {1, 2, (6..9)};
719 var template RoI tl_RoI3 := {20,21,22};
720 var template integer tl_i5 := (-1,0,all from tl_RoI1, 100,all from tl_RoI3,all from tl_RoI3 )
721 f_checkIntTemplateEquivalence(tl_i5,t_i5_eq);
722}
723
724testcase tc_checkIntegerValueListTemplate5_dyn() runs on A
725{
726 var template integer tl_i5 := (-1,0,all from t_RoI1, 100,all from t_RoI3,all from t_RoI3 )
727 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
728 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
729 f_checkIntegerTemplate(tl_i5,vl_goodValues,vl_badValues);
730}
731testcase tc_checkIntegerValueListTemplate5_2dyn() runs on A
732{
733 var template RoI tl_RoI1:= {1, 2, (6..9)};
734 var template RoI tl_RoI3 := {20,21,22};
735 var template integer tl_i5 := (-1,0,all from tl_RoI1, 100,all from tl_RoI3,all from tl_RoI3 )
736 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
737 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
738 f_checkIntegerTemplate(tl_i5,vl_goodValues,vl_badValues);
739}
740
741//=== i6 ===
742testcase tc_checkIntegerValueListTemplate6_eq_dyn() runs on A{
743 var template integer tl_i6 := (-1,0,all from t_RoI1, 100, all from t_RoI3,all from t_RoI3,all from t_RoI3);
744 f_checkIntTemplateEquivalence(tl_i6,t_i6_eq);
745}
746
747testcase tc_checkIntegerValueListTemplate6_eq_2dyn() runs on A{
748 var template RoI tl_RoI1:= {1, 2, (6..9)};
749 var template RoI tl_RoI3 := {20,21,22};
750 var template integer tl_i6 := (-1,0,all from tl_RoI1, 100, all from tl_RoI3,all from tl_RoI3,all from tl_RoI3);
751 f_checkIntTemplateEquivalence(tl_i6,t_i6_eq);
752}
753
754testcase tc_checkIntegerValueListTemplate6_dyn() runs on A
755{
756 var template integer tl_i6 := (-1,0,all from t_RoI1, 100, all from t_RoI3,all from t_RoI3,all from t_RoI3); //repetition
757 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
758 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
759 f_checkIntegerTemplate(tl_i6,vl_goodValues,vl_badValues);
760}
761testcase tc_checkIntegerValueListTemplate6_2dyn() runs on A
762{
763 var template RoI tl_RoI1:= {1, 2, (6..9)};
764 var template RoI tl_RoI3 := {20,21,22};
765 var template integer tl_i6 := (-1,0,all from t_RoI1, 100, all from t_RoI3,all from t_RoI3,all from t_RoI3); //repetition
766 var RoI vl_goodValues := { -1,0,1,2,6,7,8,9,100,20,21,22};
767 var RoI vl_badValues := { -99,-10,3,4,5,10,11,19,23,40,42,44,99,101,102,200,1000, 100000000000000};
768 f_checkIntegerTemplate(tl_i6,vl_goodValues,vl_badValues);
769}
770//=== i7 ===
771testcase tc_checkIntegerValueListTemplate7_eq_dyn() runs on A{
772 var template integer tl_i7 := (all from t_RoI4,100);
773 f_checkIntTemplateEquivalence(tl_i7,t_i7_eq);
774}
775
776testcase tc_checkIntegerValueListTemplate7_eq_2dyn() runs on A{
777 var template RoI tl_RoI4 := {1, ?, 3};
778 var template integer tl_i7 := (all from tl_RoI4,100);
779 f_checkIntTemplateEquivalence(tl_i7,t_i7_eq);
780}
781
782testcase tc_checkIntegerValueListTemplate7_dyn() runs on A
783{
784 var template integer tl_i7 := (all from t_RoI4,100);
785 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
786 var RoI vl_badValues := { };
787 f_checkIntegerTemplate(tl_i7,vl_goodValues,vl_badValues);
788}
789
790testcase tc_checkIntegerValueListTemplate7_2dyn() runs on A
791{
792 var template RoI tl_RoI4 := {1, ?, 3};
793 var template integer tl_i7 := (all from tl_RoI4,100);
794 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
795 var RoI vl_badValues := { };
796 f_checkIntegerTemplate(tl_i7,vl_goodValues,vl_badValues);
797}
798
799//=== i8 ===
800testcase tc_checkIntegerValueListTemplate8_eq_dyn() runs on A{
801 var template integer tl_i8 := (100,all from t_RoI4);
802 f_checkIntTemplateEquivalence(tl_i8,t_i8_eq);
803}
804
805testcase tc_checkIntegerValueListTemplate8_eq_2dyn() runs on A{
806 var template RoI tl_RoI4 := {1, ?, 3};
807 var template integer tl_i8 := (100,all from tl_RoI4);
808 f_checkIntTemplateEquivalence(tl_i8,t_i8_eq);
809}
810
811testcase tc_checkIntegerValueListTemplate8_dyn() runs on A
812{
813 var template integer tl_i8 := (100,all from t_RoI4);
814 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
815 var RoI vl_badValues := { };
816 f_checkIntegerTemplate(tl_i8,vl_goodValues,vl_badValues);
817}
818testcase tc_checkIntegerValueListTemplate8_2dyn() runs on A
819{
820 var template RoI tl_RoI4 := {1, ?, 3};
821 var template integer tl_i8 := (100,all from t_RoI4);
822 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
823 var RoI vl_badValues := { };
824 f_checkIntegerTemplate(tl_i8,vl_goodValues,vl_badValues);
825}
826
827//=== i9 ===
828testcase tc_checkIntegerValueListTemplate9_eq_dyn() runs on A{
829 var template integer tl_i9 := (100,all from t_RoI4,-1);
830 f_checkIntTemplateEquivalence(tl_i9,t_i9_eq);
831}
832
833testcase tc_checkIntegerValueListTemplate9_eq_2dyn() runs on A
834{
835 var template RoI tl_RoI4 := {1, ?, 3};
836 var template integer tl_i9 := (100,all from t_RoI4,-1);
837 f_checkIntTemplateEquivalence(tl_i9,t_i9_eq);
838}
839
840testcase tc_checkIntegerValueListTemplate9_dyn() runs on A
841{
842 var template integer tl_i9 := (100,all from t_RoI4,-1);
843 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
844 var RoI vl_badValues := { };
845 f_checkIntegerTemplate(tl_i9,vl_goodValues,vl_badValues);
846}
847
848testcase tc_checkIntegerValueListTemplate9_2dyn() runs on A
849{
850 var template RoI tl_RoI4 := {1, ?, 3};
851 var template integer tl_i9 := (100,all from tl_RoI4,-1);
852 var RoI vl_goodValues := {-1,0,1,2,3,4,5,500,5000};
853 var RoI vl_badValues := { };
854 f_checkIntegerTemplate(tl_i9,vl_goodValues,vl_badValues);
855}
856
857//=== 10 ===
858//More complex example
859
860//== 10 eq ==
861testcase tc_RoITemplate10_eq() runs on A
862{
863 f_checkRoITemplateEquivalence(t_roiComplex1,t_roiComplex1_eq);
864}
865
866testcase tc_checkIntegerValueListTemplate10_eq() runs on A
867{
868 f_checkIntTemplateEquivalence(t_complex1,t_complex1_eq);
869}
870
871//local template
872testcase tc_checkIntegerValueListTemplate10_eq_local() runs on A
873{
874 template integer tl_complex1 := (all from t_roiComplex1);
875 f_checkIntTemplateEquivalence(tl_complex1,t_complex1_eq);
876}
877
878testcase tc_checkIntegerValueListTemplate10_eq_dyn() runs on A
879{
880 var template integer tl_complex1 := (all from t_roiComplex1);
881 f_checkIntTemplateEquivalence(tl_complex1,t_complex1_eq);
882}
883
884testcase tc_checkIntegerValueListTemplate10_eq_2dyn() runs on A
885{
886 var template RoI tl_roiComplex1 := { t_i0s, (all from t_SoI3) };
887 var template integer tl_complex1 := (all from tl_roiComplex1);
888 f_checkIntTemplateEquivalence(tl_complex1,t_complex1_eq);
889}
890
891testcase tc_checkIntegerValueListTemplate10_eq_3dyn() runs on A
892{
893 var template integer tl_i0s := (all from t_SoI1);
894 var template RoI tl_roiComplex1 := { tl_i0s, (all from t_SoI3) };
895 var template integer tl_complex1 := (all from tl_roiComplex1);
896 f_checkIntTemplateEquivalence(tl_complex1,t_complex1_eq);
897}
898
899testcase tc_checkIntegerValueListTemplate10_eq_4dyn() runs on A
900{
901 var template SoI tl_SoI1 := {1,2,(6..9)};
902 template SoI tl_SoI3 := {20,21,22};
903
904 var template integer tl_i0s := (all from tl_SoI1);
905 var template RoI tl_roiComplex1 := { tl_i0s, (all from tl_SoI3) };
906 var template integer tl_complex1 := (all from tl_roiComplex1);
907 f_checkIntTemplateEquivalence(tl_complex1,t_complex1_eq);
908}
909
910testcase tc_checkIntegerValueListTemplate10_eq_5dyn() runs on A
911{
912 var template SoI tl_SoI1 := {1,2,(6..9)};
913 var template SoI tl_SoI3 := {20,21,22}; //<=== !!! if this is local then the tc can be compiled
914
915 var template integer tl_i0s := (all from tl_SoI1);
916 var template RoI tl_roiComplex1 := { tl_i0s, (all from tl_SoI3) };//compile error
917 var template integer tl_complex1 := (all from tl_roiComplex1);
918 f_checkIntTemplateEquivalence(tl_complex1,t_complex1_eq);
919}
920//=== 10 check values ==
921testcase tc_checkIntegerValueListTemplate10() runs on A
922{
923 var RoI vl_goodValues := {1,2,6,7,8,9,20,21,22};
924 var RoI vl_badValues := { 0,3,4,5,10,19,23};
925 f_checkIntegerTemplate(t_complex1,vl_goodValues,vl_badValues);
926}
927
928testcase tc_checkIntegerValueListTemplate10_dyn() runs on A
929{
930 var template integer tl_complex1 := (all from t_roiComplex1);
931 var RoI vl_goodValues := {1,2,6,7,8,9,20,21,22};
932 var RoI vl_badValues := { 0,3,4,5,10,19,23};
933 f_checkIntegerTemplate(tl_complex1,vl_goodValues,vl_badValues);
934}
935
936testcase tc_checkIntegerValueListTemplate10_loc_dyn() runs on A
937{
938 template RoI tl_roiComplex1 := { t_i0s, (all from t_SoI3) }; //local template def
939 var template integer tl_complex1 := (all from tl_roiComplex1); //dyn template def
940
941 var RoI vl_goodValues := {1,2,6,7,8,9,20,21,22};
942 var RoI vl_badValues := { 0,3,4,5,10,19,23};
943 f_checkIntegerTemplate(tl_complex1,vl_goodValues,vl_badValues);
944}
945
946testcase tc_checkIntegerValueListTemplate10_2loc_2dyn () runs on A
947{
948 template SoI tl_SoI1 := {1,2,(6..9)}; //local template def
949 template SoI tl_SoI3 := {20,21,22}; //local template def
950 var template RoI tl_roiComplex1 := { (all from tl_SoI1), (all from tl_SoI3) };
951 var template integer tl_complex1 := (all from tl_roiComplex1);
952
953 var RoI vl_goodValues := {1,2,6,7,8,9,20,21,22};
954 var RoI vl_badValues := { 0,3,4,5,10,19,23};
955 f_checkIntegerTemplate(tl_complex1,vl_goodValues,vl_badValues);
956}
957
958testcase tc_checkIntegerValueListTemplate10_3loc_2dyn () runs on A
959{
960 template SoI tl_SoI1 := {1,2,(6..9)}; //local template def
961 template SoI tl_SoI3 := {20,21,22}; //local template def
962 template integer tl_i0s := (all from tl_SoI1); //local template def
963 var template RoI tl_roiComplex1 := { tl_i0s, (all from tl_SoI3) };
964 var template integer tl_complex1 := (all from tl_roiComplex1);
965
966 var RoI vl_goodValues := {1,2,6,7,8,9,20,21,22};
967 var RoI vl_badValues := { 0,3,4,5,10,19,23};
968 f_checkIntegerTemplate(tl_complex1,vl_goodValues,vl_badValues);
969}
970
971testcase tc_checkIntegerValueListTemplate10_1dyn_1loc_3dyn() runs on A
972{
973 var template SoI tl_SoI1 := {1,2,(6..9)};
974 template SoI tl_SoI3 := {20,21,22};
975 var template integer tl_i0s := (all from tl_SoI1);
976 var template RoI tl_roiComplex1 := { tl_i0s, (all from tl_SoI3) };
977 var template integer tl_complex1 := (all from tl_roiComplex1);
978
979 var RoI vl_goodValues := {1,2,6,7,8,9,20,21,22};
980 var RoI vl_badValues := { 0,3,4,5,10,19,23};
981 f_checkIntegerTemplate(tl_complex1,vl_goodValues,vl_badValues);
982}
983
984testcase tc_checkIntegerValueListTemplate10_2loc_3dyn () runs on A
985{
986 template SoI tl_SoI1 := {1,2,(6..9)};
987 template SoI tl_SoI3 := {20,21,22};
988 var template integer tl_i0s := (all from tl_SoI1);
989 var template RoI tl_roiComplex1 := { tl_i0s, (all from tl_SoI3) };
990 var template integer tl_complex1 := (all from tl_roiComplex1);
991 var RoI vl_goodValues := {1,2,6,7,8,9,20,21,22};
992 var RoI vl_badValues := { 0,3,4,5,10,19,23};
993 f_checkIntegerTemplate(tl_complex1,vl_goodValues,vl_badValues);
994}
995
996// The following two thestcases are critical:
997
998//PASS
999testcase tc_checkIntegerValueListTemplate10_6dyn() runs on A
1000{
1001 var template SoI tl_SoI1 := {1,2,(6..9)};
1002 var template SoI tl_SoI3 := {20,21,22};
1003 var template integer tl_i0s := (all from tl_SoI1);
1004 var template integer tl_i1s := (all from tl_SoI3); //<===this helps to compile
1005 var template RoI tl_roiComplex1 := { tl_i0s,tl_i1s};
1006 var template integer tl_complex1 := (all from tl_roiComplex1);
1007 var RoI vl_goodValues := {1,2,6,7,8,9,20,21,22};
1008 var RoI vl_badValues := { 0,3,4,5,10,19,23};
1009 f_checkIntegerTemplate(tl_complex1,vl_goodValues,vl_badValues);
1010}
1011
1012
1013testcase tc_checkIntegerValueListTemplate10_5dyn() runs on A
1014{
1015 var template SoI tl_SoI1 := {1,2,(6..9)};
1016 var template SoI tl_SoI3 := {20,21,22};
1017 var template integer tl_i0s := (all from tl_SoI1);
1018 var template RoI tl_roiComplex1 := { tl_i0s, (all from tl_SoI3) };
1019 var template integer tl_complex1 := (all from tl_roiComplex1);
1020
1021 var RoI vl_goodValues := {1,2,6,7,8,9,20,21,22};
1022 var RoI vl_badValues := { 0,3,4,5,10,19,23};
1023 f_checkIntegerTemplate(tl_complex1,vl_goodValues,vl_badValues);
1024}
1025
1026
1027testcase tc_checkIntegerValueListTemplate10_4dyn() runs on A
1028{
1029 var template SoI tl_SoI1 := {1,2,(6..9)};
1030 var template SoI tl_SoI3 := {20,21,22};
1031 var template RoI tl_roiComplex1 := { (all from tl_SoI1), (all from tl_SoI3) };
1032 var template integer tl_complex1 := (all from tl_roiComplex1);
1033
1034 var RoI vl_goodValues := {1,2,6,7,8,9,20,21,22};
1035 var RoI vl_badValues := { 0,3,4,5,10,19,23};
1036 f_checkIntegerTemplate(tl_complex1,vl_goodValues,vl_badValues);
1037}
1038
1039//+++++++++ NEGATIVE TEST+++++++++++++++++++++++++
1040
1041// see: TTCN3_SA_13_TD.script
1042
1043//====== Dynamic Templates for Set Of Integer =====
1044
1045//=== i0s ===
1046//t_i0s_eq := ( 1,2,(6..9));
1047
1048testcase tc_checkIntegerValueListTemplate0s_eq_dyn() runs on A{
1049 var template integer tl_i0s := (all from t_SoI1);
1050 f_checkIntTemplateEquivalence(tl_i0s,t_i0s_eq);
1051}
1052
1053testcase tc_checkIntegerValueListTemplate0s_eq_2dyn() runs on A{
1054 var template SoI tl_SoI1 := {1,2,(6..9)};
1055 var template integer tl_i0s := (all from tl_SoI1);
1056 f_checkIntTemplateEquivalence(tl_i0s,t_i0s_eq);
1057}
1058
1059testcase tc_checkIntegerValueListTemplate0s_dyn() runs on A
1060{
1061 var template integer tl_i0s := (all from t_SoI1);
1062 var RoI vl_goodValues := { 1,2,6,7,8,9};
1063 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,100,101,102,200,1000, 100000000000000};
1064 f_checkIntegerTemplate(tl_i0s,vl_goodValues,vl_badValues);
1065}
1066
1067testcase tc_checkIntegerValueListTemplate0s_2dyn() runs on A
1068{
1069 var template SoI tl_SoI1 := {1,2,(6..9)};
1070 var template integer tl_i0s := (all from tl_SoI1);
1071 var RoI vl_goodValues := { 1,2,6,7,8,9};
1072 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,100,101,102,200,1000, 100000000000000};
1073 f_checkIntegerTemplate(tl_i0s,vl_goodValues,vl_badValues);
1074}
1075
1076//=== i1s ==
1077//t_i1s_eq := ( 1,2,(6..9),100);
1078testcase tc_checkIntegerValueListTemplate1s_eq_dyn() runs on A{
1079 var template integer tl_i1s := (all from t_SoI1, 100);
1080 f_checkIntTemplateEquivalence(tl_i1s,t_i1s_eq);
1081}
1082
1083testcase tc_checkIntegerValueListTemplate1s_eq_2dyn() runs on A{
1084 var template SoI tl_SoI1 := {1,2,(6..9)};
1085 var template integer tl_i1s := (all from tl_SoI1, 100);
1086 f_checkIntTemplateEquivalence(tl_i1s,t_i1s_eq);
1087}
1088
1089
1090testcase tc_checkIntegerValueListTemplate1s_dyn() runs on A
1091{
1092 var template integer tl_i1s := (all from t_SoI1, 100);
1093 var RoI vl_goodValues := { 1,2,6,7,8,9,100};
1094 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
1095 f_checkIntegerTemplate(tl_i1s,vl_goodValues,vl_badValues);
1096}
1097
1098testcase tc_checkIntegerValueListTemplate1s_2dyn() runs on A
1099{
1100 var template SoI tl_SoI1 := {1,2,(6..9)};
1101 var template integer tl_i1s := (all from tl_SoI1, 100);
1102 var RoI vl_goodValues := { 1,2,6,7,8,9,100};
1103 var RoI vl_badValues := { -99,-10,-1,0,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000};
1104 f_checkIntegerTemplate(tl_i1s,vl_goodValues,vl_badValues);
1105}
1106
1107
1108//=========================================================
1109//===== Test for Record of charstring =====================
1110//=========================================================
1111
1112//=== cs1 ===
1113testcase tc_CharstringTemplate1_eq() runs on A
1114{
1115 f_checkCharstringTemplateEquivalence(t_cs1,t_cs1_eq);
1116}
1117
1118testcase tc_CharstringTemplate1_eq_local() runs on A
1119{
1120 template charstring tl_cs1 := ( all from t_RoCS1, "dog" );
1121 f_checkCharstringTemplateEquivalence(tl_cs1,t_cs1_eq);
1122}
1123
1124testcase tc_CharstringTemplate1_eq_dyn() runs on A
1125{
1126 var template charstring tl_cs1 := ( all from t_RoCS1, "dog" );
1127 f_checkCharstringTemplateEquivalence(tl_cs1,t_cs1_eq);
1128}
1129
1130testcase tc_CharstringTemplate1_eq_2dyn() runs on A
1131{
1132 var template RoCS tl_RoCS1 := { "apple","banana","","pear"};
1133 var template charstring tl_cs1 := ( all from tl_RoCS1, "dog" );
1134 f_checkCharstringTemplateEquivalence(tl_cs1,t_cs1_eq);
1135}
1136
1137testcase tc_CharstringTemplate1() runs on A
1138{
1139 var RoCS vl_goodValues := { "apple","banana","","pear", "dog" };
1140 var RoCS vl_badValues := { "house","apples" };
1141 f_checkCharstringTemplate(t_cs1,vl_goodValues,vl_badValues);
1142}
1143
1144testcase tc_CharstringTemplate1_local() runs on A
1145{
1146 template charstring tl_cs1 := ( all from t_RoCS1, "dog" )
1147 var RoCS vl_goodValues := { "apple","banana","","pear", "dog" };
1148 var RoCS vl_badValues := { "house","apples" };
1149 f_checkCharstringTemplate(tl_cs1,vl_goodValues,vl_badValues);
1150}
1151
1152testcase tc_CharstringTemplate1_dyn() runs on A
1153{
1154 var template charstring tl_cs1 := ( all from t_RoCS1, "dog" )
1155 var RoCS vl_goodValues := { "apple","banana","","pear", "dog" };
1156 var RoCS vl_badValues := { "house","apples" };
1157 f_checkCharstringTemplate(tl_cs1,vl_goodValues,vl_badValues);
1158}
1159
1160testcase tc_CharstringTemplate1_2dyn() runs on A
1161{
1162 var template RoCS tl_RoCS1 := { "apple","banana","","pear"};
1163 var template charstring tl_cs1 := ( all from tl_RoCS1, "dog" )
1164 var RoCS vl_goodValues := { "apple","banana","","pear", "dog" };
1165 var RoCS vl_badValues := { "house","apples" };
1166 f_checkCharstringTemplate(tl_cs1,vl_goodValues,vl_badValues);
1167}
1168
1169//=== cs2 ===
1170testcase tc_CharstringTemplate2_eq() runs on A
1171{
1172 f_checkCharstringTemplateEquivalence(t_cs2,t_cs2_eq);
1173}
1174
1175testcase tc_CharstringTemplate2_eq_local() runs on A
1176{
1177 template charstring tl_cs2 := ( "treeeeeeeeeeeeee",all from t_RoCS1, "dog", all from t_RoCS2);
1178 f_checkCharstringTemplateEquivalence(tl_cs2,t_cs2_eq);
1179}
1180
1181testcase tc_CharstringTemplate2_eq_dyn() runs on A
1182{
1183 var template charstring tl_cs2 := ( "treeeeeeeeeeeeee",all from t_RoCS1, "dog", all from t_RoCS2);
1184 f_checkCharstringTemplateEquivalence(tl_cs2,t_cs2_eq);
1185}
1186
1187testcase tc_CharstringTemplate2_eq_2dyn() runs on A
1188{
1189 var template RoCS tl_RoCS1 := { "apple","banana","","pear"};
1190 var template RoCS tl_RoCS2 := { "apples","bananas","","pears"};
1191 var template charstring tl_cs2 := ( "treeeeeeeeeeeeee",all from tl_RoCS1, "dog", all from tl_RoCS2);
1192 f_checkCharstringTemplateEquivalence(tl_cs2,t_cs2_eq);
1193}
1194testcase tc_CharstringTemplate2() runs on A
1195{
1196 var RoCS vl_goodValues := { "apple","banana","","pear", "dog", "treeeeeeeeeeeeee","apples","bananas","pears" };
1197 var RoCS vl_badValues := { "house","applesss","tree","a","app","appl","pple" };
1198 f_checkCharstringTemplate(t_cs2,vl_goodValues,vl_badValues);
1199}
1200//=========================================================
1201//================== Test for Octetstring =================
1202//=========================================================
1203
1204//== 1 ===
1205//( all from t_RoOS1 )
1206//('ABBA'O,'BABA'O,'FFFF'O,'00'O,'0B'O)
1207testcase tc_OctetstringTemplate1_eq() runs on A
1208{
1209 f_checkOctetstringTemplateEquivalence(t_os1,t_os1_eq);
1210}
1211
1212testcase tc_OctetstringTemplate1() runs on A
1213{
1214
1215 var RoOS vl_goodValues := { 'ABBA'O,'BABA'O,'FFFF'O,'00'O,'0B'O };
1216 var RoOS vl_badValues := { ''O,'0000'O,'00FF'O,'AA'O,'00ABBA'O };
1217 f_checkOctetstringTemplate(t_os1,vl_goodValues,vl_badValues);
1218}
1219
1220testcase tc_OctetstringTemplate1_eq_local() runs on A
1221{
1222 template octetstring tl_os1 := ( all from t_RoOS1 );
1223 f_checkOctetstringTemplateEquivalence(tl_os1,t_os1_eq);
1224}
1225
1226testcase tc_OctetstringTemplate1_eq_dyn() runs on A
1227{
1228 var template octetstring tl_os1 := ( all from t_RoOS1 );
1229 f_checkOctetstringTemplateEquivalence(tl_os1,t_os1_eq);
1230}
1231
1232testcase tc_OctetstringTemplate1_eq_local_dyn() runs on A
1233{
1234 template RoOS tl_RoOS1 := {'ABBA'O,'BABA'O,'FFFF'O,'00'O,'0B'O}
1235 var template octetstring tl_os1 := ( all from tl_RoOS1 );
1236 f_checkOctetstringTemplateEquivalence(tl_os1,t_os1_eq);
1237}
1238
1239testcase tc_OctetstringTemplate1_eq_2dyn() runs on A
1240{
1241 var template RoOS tl_RoOS1 := {'ABBA'O,'BABA'O,'FFFF'O,'00'O,'0B'O}
1242 var template octetstring tl_os1 := ( all from tl_RoOS1 );
1243 f_checkOctetstringTemplateEquivalence(tl_os1,t_os1_eq);
1244}
1245
1246testcase tc_OctetstringTemplate1_dyn() runs on A
1247{
1248 var RoOS vl_goodValues := { 'ABBA'O,'BABA'O,'FFFF'O,'00'O,'0B'O };
1249 var RoOS vl_badValues := { ''O,'0000'O,'00FF'O,'AA'O,'00ABBA'O };
1250 f_checkOctetstringTemplate(t_os1,vl_goodValues,vl_badValues);
1251}
1252//=========================================================
1253//================== Test for Records =====================
1254//=========================================================
1255testcase tc_MyRecordTemplate1_eq() runs on A {
1256 f_checkMyRecordTemplateEquivalence(t_myrec1,t_myrec1_eq);
1257}
1258
1259testcase tc_MyRecordTemplate1() runs on A
1260{
1261 var RoMyRec vl_goodValues := {
1262 {i:=1,roi:={1,2,6},soi:={1,7,2} },
1263 {i:=2,roi:={1,2,7},soi:={1,9,2} } };
1264 var RoMyRec vl_badValues := {{omit,omit,omit} };
1265 f_checkMyRecTemplate(t_myrec1,vl_goodValues,vl_badValues);
1266}
1267
1268testcase tc_MyRecordTemplate2_eq() runs on A {
1269 f_checkMyRecordTemplateEquivalence(t_myrec2,t_myrec2_eq);
1270}
1271
1272testcase tc_MyRecordTemplate3_eq() runs on A {
1273 f_checkMyRecordTemplateEquivalence(t_myrec3,t_myrec3_eq);
1274}
1275
1276//=========================================================
1277//================== Test for Union =====================
1278//=========================================================
1279testcase tc_MyUnionTemplate1i_eq() runs on A {
1280 f_checkMyUnionTemplateEquivalence(t_myunion1i,t_myunion1i_eq);
1281}
1282
1283testcase tc_MyUnionTemplate1i() runs on A
1284{
1285 var RoMyUnion vl_goodValues := {{i:=1},{i:=2},{i:=6},{i:=7},{i:=8},{i:=9},{i:=100}} ;
1286 var RoMyUnion vl_badValues := {{i:=0},{i:=3},{roi:={}},{roi:={1,2}}};
1287 f_checkMyUnionTemplate(t_myunion1i,vl_goodValues,vl_badValues);
1288}
1289testcase tc_MyUnionTemplate1roi() runs on A
1290{
1291 var RoMyUnion vl_goodValues := {
1292 { roi:={1,2} },{roi:={1,2}},{roi:={1,6}},{roi:={2,7}},{roi:={100,100}} };
1293 var RoMyUnion vl_badValues := {{roi:={1}},{roi:={1,4}}, {roi:={2,3}},{roi:={1,2,3}},{roi:={1,2,6,101}},{roi:={1,2,6,100}} };
1294 f_checkMyUnionTemplate(t_myunion1roi,vl_goodValues,vl_badValues);
1295}
1296testcase tc_MyUnionTemplate1soi() runs on A
1297{
1298 var RoMyUnion vl_goodValues := {
1299 { soi:={1,2} },{soi:={1,2}},{soi:={1,6}},{soi:={2,7}},{soi:={100,100}} };
1300 var RoMyUnion vl_badValues := { {soi:={}},{soi:={1,3}},{soi:={1,101}} };
1301 f_checkMyUnionTemplate(t_myunion1soi,vl_goodValues,vl_badValues);
1302}
1303testcase tc_MyUnionTemplate2i_eq() runs on A {
1304 f_checkMyUnionTemplateEquivalence(t_myunion2i,t_myunion2i_eq);
1305}
1306testcase tc_MyUnionTemplate2roi_eq() runs on A {
1307 f_checkMyUnionTemplateEquivalence(t_myunion2roi,t_myunion2roi_eq);
1308}
1309testcase tc_MyUnionTemplate2soi_eq() runs on A {
1310 f_checkMyUnionTemplateEquivalence(t_myunion2soi,t_myunion2soi_eq);
1311}
1312testcase tc_MyUnionTemplate3_eq() runs on A {
1313 f_checkMyUnionTemplateEquivalence(t_myunion3,t_myunion3_eq);
1314}
1315
1316//==== function reference =====
1317testcase tc_functionRef_rof_eq() runs on A {
1318 f_checkMyFunctionRefTemplateEquivalence( t_fref_int2int,t_fref_int2int_eq);
1319}
1320
3f84031e 1321// all from with length restriction
1322// 1. the target of 'all from' is foldable (known at compile-time)
1323testcase tc_varTemplate_len_res_foldable() runs on A
1324{
1325 template RoI tl_foldable := { 6, 9 };
1326 var template RoI tl_len_res := { 2, all from tl_foldable } length (3);
1327 var template RoI tl_len_res_eq := { 2, 6, 9 } length (3);
1328 f_checkRoITemplateEquivalence(tl_len_res, tl_len_res_eq);
1329}
1330
1331// 2. the target of 'all from' is unfoldable (not known at compile-time)
1332testcase tc_varTemplate_len_res_unfoldable() runs on A
1333{
1334 var template RoI tl_unfoldable := { 6, 9 };
1335 var template RoI tl_len_res := { 2, all from tl_unfoldable } length (3);
1336 var template RoI tl_len_res_eq := { 2, 6, 9 } length (3);
1337 f_checkRoITemplateEquivalence(tl_len_res, tl_len_res_eq);
1338}
1339
1340// HU21359 Length of record of template containing 'all from' is invalid
1341template RoI t_ints_1 := { 1 };
1342template RoI t_ints_2 := { 2, 3 };
1343
1344function modify (template RoI p1, template RoI p2)
1345return template RoI
1346{
1347 return { all from p1, all from p2 };
1348}
1349
1350testcase tc_HU21359() runs on A {
1351 var template RoI vt_res := modify(t_ints_1, t_ints_2);
1352 var template RoI vt_exp := { 1, 2, 3 };
1353 f_checkRoITemplateEquivalence(vt_res, vt_exp);
1354}
1355
970ed795
EL
1356
1357// control part is NOT used during the test!
1358control {
1359 // execute(tc_checkIntegerValueListTemplate_eq());
1360 execute(tc_checkIntegerValueListTemplate0());
1361 execute(tc_checkIntegerValueListTemplate1());
1362 execute(tc_checkIntegerValueListTemplate2());
1363 execute(tc_checkIntegerValueListTemplate3());
1364 execute(tc_checkIntegerValueListTemplate4());
1365 execute(tc_checkIntegerValueListTemplate5());
1366 execute(tc_checkIntegerValueListTemplate6());
1367
1368 execute(tc_checkIntegerValueListTemplate1s());
1369 execute(tc_checkIntegerValueListTemplate2s());
1370 execute(tc_checkIntegerValueListTemplate3s());
1371 execute(tc_checkIntegerValueListTemplate4s());
1372 execute(tc_checkIntegerValueListTemplate5s());
1373 execute(tc_checkIntegerValueListTemplate6s());
1374
1375 execute(tc_CharstringTemplate1());
1376 execute(tc_CharstringTemplate2());
1377}
1378
1379}
This page took 0.074121 seconds and 5 git commands to generate.