1 /******************************************************************************
2 * Copyright (c) 2000-2015 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
7 ******************************************************************************/
11 //************************* Functions ******************************
14 function f_checkIntegerTemplate(in template integer pl_template,in RoI pl_goodValues, in RoI pl_badValues) {
16 action("template=", pl_template, " will be checked against ",pl_goodValues);
18 var integer N:=sizeof(pl_goodValues);
19 for(var integer i:=0;i<N;i:=i+1) {
20 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
21 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
24 action("template=", pl_template, " will be checked against ",pl_badValues);
25 N:=sizeof(pl_badValues);
26 for(var integer i:=0;i<N;i:=i+1) {
27 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
28 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
32 with { extension "transparent" }
34 function f_checkCharstringTemplate(in template charstring pl_template,in RoCS pl_goodValues, in RoCS pl_badValues) {
36 action("template=", pl_template, " will be checked against ",pl_goodValues);
38 var integer N:=sizeof(pl_goodValues);
39 for(var integer i:=0;i<N;i:=i+1) {
40 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
41 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
44 action("template=", pl_template, " will be checked against ",pl_badValues);
45 N:=sizeof(pl_badValues);
46 for(var integer i:=0;i<N;i:=i+1) {
47 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
48 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
52 with { extension "transparent" }
54 function f_checkOctetstringTemplate(in template octetstring pl_template,in RoOS pl_goodValues, in RoOS pl_badValues) {
56 action("template=", pl_template, " will be checked against ",pl_goodValues);
58 var integer N:=sizeof(pl_goodValues);
59 for(var integer i:=0;i<N;i:=i+1) {
60 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
61 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
64 action("template=", pl_template, " will be checked against ",pl_badValues);
65 N:=sizeof(pl_badValues);
66 for(var integer i:=0;i<N;i:=i+1) {
67 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
68 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
72 function f_checkRoITemplate(in template RoI pl_template,in RoRoI pl_goodValues, in RoRoI pl_badValues) {
74 action("template=", pl_template, " will be checked against ",pl_goodValues);
76 var integer N:=sizeof(pl_goodValues);
77 for(var integer i:=0;i<N;i:=i+1) {
78 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
79 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
82 action("template=", pl_template, " will be checked against ",pl_badValues);
83 N:=sizeof(pl_badValues);
84 for(var integer i:=0;i<N;i:=i+1) {
85 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
86 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
90 with { extension "transparent" }
92 function f_checkSoITemplate(in template SoI pl_template,in RoSoI pl_goodValues, in RoSoI pl_badValues) {
94 action("template=", pl_template, " will be checked against ",pl_goodValues);
96 var integer N:=sizeof(pl_goodValues);
97 for(var integer i:=0;i<N;i:=i+1) {
98 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
99 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
102 action("template=", pl_template, " will be checked against ",pl_badValues);
103 N:=sizeof(pl_badValues);
104 for(var integer i:=0;i<N;i:=i+1) {
105 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
106 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
110 with { extension "transparent" }
112 function f_checkMyRecTemplate(in template MyRecord pl_template,in RoMyRec pl_goodValues, in RoMyRec pl_badValues) {
114 action("template=", pl_template, " will be checked against ",pl_goodValues);
116 var integer N:=sizeof(pl_goodValues);
117 for(var integer i:=0;i<N;i:=i+1) {
118 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
119 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
122 action("template=", pl_template, " will be checked against ",pl_badValues);
123 N:=sizeof(pl_badValues);
124 for(var integer i:=0;i<N;i:=i+1) {
125 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
126 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
131 function f_checkMyUnionTemplate(in template MyUnion pl_template,in RoMyUnion pl_goodValues, in RoMyUnion pl_badValues) {
133 action("template=", pl_template, " will be checked against ",pl_goodValues);
135 var integer N:=sizeof(pl_goodValues);
136 for(var integer i:=0;i<N;i:=i+1) {
137 if (match(pl_goodValues[i], pl_template)) { setverdict(pass); }
138 else { setverdict(fail,pl_goodValues[i], " should match ", pl_template); }
141 action("template=", pl_template, " will be checked against ",pl_badValues);
142 N:=sizeof(pl_badValues);
143 for(var integer i:=0;i<N;i:=i+1) {
144 if (not match(pl_badValues[i], pl_template)) { setverdict(pass); }
145 else { setverdict(fail,pl_badValues[i], " should not match ", pl_template); }
149 //==== Equivalence ====
151 function f_checkSoITemplateEquivalence(in template SoI pl_template1, in template SoI pl_template2) {
152 action("template1=",pl_template1," check against ",pl_template2);
153 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
155 with { extension "transparent" }
157 function f_checkRoITemplateEquivalence(in template RoI pl_template1, in template RoI pl_template2) {
158 action("template1=",pl_template1," check against ",pl_template2);
159 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
161 with { extension "transparent" }
163 function f_checkRoCSTemplateEquivalence(in template RoCS pl_template1, in template RoCS pl_template2) {
164 action("template1=",pl_template1," check against ",pl_template2);
165 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
167 function f_checkIntTemplateEquivalence(in template integer pl_template1, in template integer pl_template2) {
168 action("template1=",pl_template1," check against ",pl_template2);
169 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
171 with { extension "transparent" }
173 function f_checkCharstringTemplateEquivalence(in template charstring pl_template1, in template charstring pl_template2) {
174 action("template1=",pl_template1," check against ",pl_template2);
175 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
177 with { extension "transparent" }
179 function f_checkOctetstringTemplateEquivalence(in template octetstring pl_template1, in template octetstring pl_template2) {
180 action("template1=",pl_template1," check against ",pl_template2);
181 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
183 with { extension "transparent" }
185 function f_checkMyRecordTemplateEquivalence(in template MyRecord pl_template1, in template MyRecord pl_template2) {
186 action("template1=",pl_template1," check against ",pl_template2);
187 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
189 with { extension "transparent" }
191 function f_checkMyUnionTemplateEquivalence(in template MyUnion pl_template1, in template MyUnion pl_template2) {
192 action("template1=",pl_template1," check against ",pl_template2);
193 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
195 with { extension "transparent" }
197 function f_checkMyFunctionRefTemplateEquivalence(in template F_int2int pl_template1, in template F_int2int pl_template2) {
198 action("template1=",pl_template1," check against ",pl_template2);
199 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
201 with { extension "transparent" }
203 function f_checkMyRoFRefTemplateEquivalence(in template RoF_int2int pl_template1, in template RoF_int2int pl_template2) {
204 action("template1=",pl_template1," check against ",pl_template2);
205 if(log2str(pl_template1)==log2str(pl_template2)) {setverdict(pass);} else {setverdict(fail,"template1=",pl_template1," should match against ",pl_template2 );}
207 with { extension "transparent" }
209 function f_createIntegerWithAllFromFromInTemplateFromRoi(in template RoI pl_template1, inout template integer pl_template2) {
210 pl_template2:= (all from pl_template1);
213 function f_createIntegerWithAllFromFromInOutTemplateFromRoi(inout template RoI pl_template1, inout template integer pl_template2) {
214 pl_template2:= (all from pl_template1);
217 function f_createIntegerWithAllFromFromInTemplateFromSoi(in template SoI pl_template1, inout template integer pl_template2) {
218 pl_template2:= (all from pl_template1);
221 function f_createIntegerWithAllFromFromInOutTemplateFromSoi(inout template SoI pl_template1, inout template integer pl_template2) {
222 pl_template2:= (all from pl_template1);
225 //====== function references =======
226 function f_int2int_1(in integer pl_i) return integer { log("f_int2int_1 called with ", pl_i);return 1;}
227 function f_int2int_2(in integer pl_i) return integer { log("f_int2int_2 called with ", pl_i);return 2;}