1 /******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
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
12 ******************************************************************************/
14 import from types all;
16 //************************* Functions ******************************
19 function f_checkIntegerTemplate(in template integer pl_template,in RoI pl_goodValues, in RoI pl_badValues) {
21 action("template=", pl_template, " will be checked against ",pl_goodValues);
23 var integer N:=sizeof(pl_goodValues);
24 for(var integer i:=0;i<N;i:=i+1) {
25 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
26 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
29 action("template=", pl_template, " will be checked against ",pl_badValues);
30 N:=sizeof(pl_badValues);
31 for(var integer i:=0;i<N;i:=i+1) {
32 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
33 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
37 with { extension "transparent" }
39 function f_checkCharstringTemplate(in template charstring pl_template,in RoCS pl_goodValues, in RoCS pl_badValues) {
41 action("template=", pl_template, " will be checked against ",pl_goodValues);
43 var integer N:=sizeof(pl_goodValues);
44 for(var integer i:=0;i<N;i:=i+1) {
45 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
46 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
49 action("template=", pl_template, " will be checked against ",pl_badValues);
50 N:=sizeof(pl_badValues);
51 for(var integer i:=0;i<N;i:=i+1) {
52 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
53 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
57 with { extension "transparent" }
59 function f_checkOctetstringTemplate(in template octetstring pl_template,in RoOS pl_goodValues, in RoOS pl_badValues) {
61 action("template=", pl_template, " will be checked against ",pl_goodValues);
63 var integer N:=sizeof(pl_goodValues);
64 for(var integer i:=0;i<N;i:=i+1) {
65 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
66 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
69 action("template=", pl_template, " will be checked against ",pl_badValues);
70 N:=sizeof(pl_badValues);
71 for(var integer i:=0;i<N;i:=i+1) {
72 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
73 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
77 function f_checkRoITemplate(in template RoI pl_template,in RoRoI pl_goodValues, in RoRoI pl_badValues) {
79 action("template=", pl_template, " will be checked against ",pl_goodValues);
81 var integer N:=sizeof(pl_goodValues);
82 for(var integer i:=0;i<N;i:=i+1) {
83 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
84 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
87 action("template=", pl_template, " will be checked against ",pl_badValues);
88 N:=sizeof(pl_badValues);
89 for(var integer i:=0;i<N;i:=i+1) {
90 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
91 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
95 with { extension "transparent" }
97 function f_checkSoITemplate(in template SoI pl_template,in RoSoI pl_goodValues, in RoSoI pl_badValues) {
99 action("template=", pl_template, " will be checked against ",pl_goodValues);
101 var integer N:=sizeof(pl_goodValues);
102 for(var integer i:=0;i<N;i:=i+1) {
103 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
104 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
107 action("template=", pl_template, " will be checked against ",pl_badValues);
108 N:=sizeof(pl_badValues);
109 for(var integer i:=0;i<N;i:=i+1) {
110 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
111 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
115 with { extension "transparent" }
117 function f_checkMyRecTemplate(in template MyRecord pl_template,in RoMyRec pl_goodValues, in RoMyRec pl_badValues) {
119 action("template=", pl_template, " will be checked against ",pl_goodValues);
121 var integer N:=sizeof(pl_goodValues);
122 for(var integer i:=0;i<N;i:=i+1) {
123 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
124 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
127 action("template=", pl_template, " will be checked against ",pl_badValues);
128 N:=sizeof(pl_badValues);
129 for(var integer i:=0;i<N;i:=i+1) {
130 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
131 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
136 function f_checkMyUnionTemplate(in template MyUnion pl_template,in RoMyUnion pl_goodValues, in RoMyUnion pl_badValues) {
138 action("template=", pl_template, " will be checked against ",pl_goodValues);
140 var integer N:=sizeof(pl_goodValues);
141 for(var integer i:=0;i<N;i:=i+1) {
142 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
143 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
146 action("template=", pl_template, " will be checked against ",pl_badValues);
147 N:=sizeof(pl_badValues);
148 for(var integer i:=0;i<N;i:=i+1) {
149 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
150 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
154 //==== Equivalence ====
156 function f_checkSoITemplateEquivalence(in template SoI pl_template1, in template SoI pl_template2) {
157 action("template1=",pl_template1," check against ",pl_template2);
158 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
160 with { extension "transparent" }
162 function f_checkRoITemplateEquivalence(in template RoI pl_template1, in template RoI pl_template2) {
163 action("template1=",pl_template1," check against ",pl_template2);
164 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
166 with { extension "transparent" }
168 function f_checkRoCSTemplateEquivalence(in template RoCS pl_template1, in template RoCS pl_template2) {
169 action("template1=",pl_template1," check against ",pl_template2);
170 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
172 function f_checkIntTemplateEquivalence(in template integer pl_template1, in template integer pl_template2) {
173 action("template1=",pl_template1," check against ",pl_template2);
174 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
176 with { extension "transparent" }
178 function f_checkCharstringTemplateEquivalence(in template charstring pl_template1, in template charstring pl_template2) {
179 action("template1=",pl_template1," check against ",pl_template2);
180 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
182 with { extension "transparent" }
184 function f_checkOctetstringTemplateEquivalence(in template octetstring pl_template1, in template octetstring pl_template2) {
185 action("template1=",pl_template1," check against ",pl_template2);
186 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
188 with { extension "transparent" }
190 function f_checkMyRecordTemplateEquivalence(in template MyRecord pl_template1, in template MyRecord pl_template2) {
191 action("template1=",pl_template1," check against ",pl_template2);
192 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
194 with { extension "transparent" }
196 function f_checkMyUnionTemplateEquivalence(in template MyUnion pl_template1, in template MyUnion pl_template2) {
197 action("template1=",pl_template1," check against ",pl_template2);
198 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
200 with { extension "transparent" }
202 function f_checkMyFunctionRefTemplateEquivalence(in template F_int2int pl_template1, in template F_int2int pl_template2) {
203 action("template1=",pl_template1," check against ",pl_template2);
204 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
206 with { extension "transparent" }
208 function f_checkMyRoFRefTemplateEquivalence(in template RoF_int2int pl_template1, in template RoF_int2int pl_template2) {
209 action("template1=",pl_template1," check against ",pl_template2);
210 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
212 with { extension "transparent" }
214 function f_createIntegerWithAllFromFromInTemplateFromRoi(in template RoI pl_template1, inout template integer pl_template2) {
215 pl_template2:= (all from pl_template1);
218 function f_createIntegerWithAllFromFromInOutTemplateFromRoi(inout template RoI pl_template1, inout template integer pl_template2) {
219 pl_template2:= (all from pl_template1);
222 function f_createIntegerWithAllFromFromInTemplateFromSoi(in template SoI pl_template1, inout template integer pl_template2) {
223 pl_template2:= (all from pl_template1);
226 function f_createIntegerWithAllFromFromInOutTemplateFromSoi(inout template SoI pl_template1, inout template integer pl_template2) {
227 pl_template2:= (all from pl_template1);
230 //====== function references =======
231 function f_int2int_1(in integer pl_i) return integer { log("f_int2int_1 called with ", pl_i);return 1;}
232 function f_int2int_2(in integer pl_i) return integer { log("f_int2int_2 called with ", pl_i);return 2;}