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 ******************************************************************************/
13 charstring tsp_1:="", tsp_2:="";
14 F tsp_3_1:={f1:={f2:={f3:="default1"}}};
15 F tsp_3_2:={f1:={f2:={f3:="default2"}}};
16 F tsp_3_3:={f1:={f2:={f3:="default3"}}};
17 RoC tsp_4 :={"default"}
18 RoRoF tsp_5_1:={{0.0}}, tsp_5_2:={{0.0}};
19 F2 tsp_30 :={ f3:="default"},tsp_31 :={ f3:="default"},tsp_32 :={ f3:="default"};
20 F2 tsp_33 :={ f3:="default"},tsp_34 :={ f3:="default"},tsp_35 :={ f3:="default"};
21 F2 tsp_36 :={ f3:="default"},tsp_37 :={ f3:="default"},tsp_38 :={ f3:="default"};
22 F2 tsp_39 :={ f3:="default"};
23 RoRoC tsp_41 :={},tsp_42 :={},tsp_43 :={},tsp_44 :={}, tsp_50:={};
24 E tsp_e1 :={ i:=0, f:=0.0,bs:='0'B,hs:='F'H,os:='00'O,cs:=""};
25 E tsp_e2 :={ i:=0, f:=0.0,bs:='0'B,hs:='F'H,os:='00'O,cs:=""};
26 E tsp_e3 :={ i:=0, f:=0.0,bs:='0'B,hs:='F'H,os:='00'O,cs:=""};
27 E tsp_e4 :={ i:=0, f:=0.0,bs:='0'B,hs:='F'H,os:='00'O,cs:=""};
29 U tsp_U_f:={ f:=0.0 };
30 U tsp_U_bs:={ bs:='0'B };
31 U tsp_U_hs:={ hs:='0'H };
32 U tsp_U_os:={ os:='00'O };
33 U tsp_U_cs1:={ cs:="" };
34 U tsp_U_cs2:={ cs:="" };
35 CR tsp_CR1:= CR_DEFAULT;
36 CR tsp_CR2:= CR_DEFAULT;
37 CR tsp_CR3:= CR_DEFAULT;
39 type component MyCT {}
41 type record of float RoF;
42 type record of RoF RoRoF;
43 type record of charstring RoC;
44 type record of RoC RoRoC;
47 type record F2 { charstring f3};
48 type record F1 { F2 f2 };
49 type record F { F1 f1 };
51 type record G { F1 f1, integer i};
52 type record H { F1 f1, integer i};
53 type record I { integer i }
55 //to check basic ttcn3 types:
74 //this record is constructed to reproduce the CR_TR00019403
76 bitstring rf_PowerCapability,
79 bitstring revisionLevel,
84 bitstring sm_Capability,
85 bitstring ss_ScreenIndicator,
86 bitstring ps_Capability,
88 ClassmarkInformationType classmarkInformationType2_oct5
91 type record ClassmarkInformationType {
102 const CR CLASSMARK2_GSM_ONLY :=
104 rf_PowerCapability := '000'B, // '000'B class1 (for GSM+DCS+PCS)
105 a5_1 := '0'B, //encryption algorithm A5/1 available ('1'B) or not ('0'B)
106 esind := '0'B,//controlled early classmark sending implemented ('1'B) or not ('0'B)
107 revisionLevel := '01'B, // '00'B reserved for phase1 (GSM+DCS)
109 fc := '0'B, // MS' support of E/R_GSM ('1'B) or not ('0'B)
110 vgcs := '0'B, // VGCS capability or notification wanted ('1'B) or not ('0'B)
111 vbs := '0'B, // VBS capability or notification wanted ('1'B) or not ('0'B)
112 sm_Capability := '1'B, // SM capbility present ('1'B) or not ('0'B)
113 ss_ScreenIndicator := '01'B, // '00'B default value of phase1 (GSM+DCS)
114 ps_Capability := '0'B, // ignored, if received
116 classmarkInformationType2_oct5 :=
128 const CR CR_DEFAULT := {
129 rf_PowerCapability := '000'B,
132 revisionLevel := '00'B,
137 sm_Capability := '0'B,
138 ss_ScreenIndicator := '00'B,
139 ps_Capability := '0'B,
141 classmarkInformationType2_oct5 :=
154 function f_checkCR(in CR pl_data, in template CR pl_expected_data) {
155 if( match(pl_data,pl_expected_data)) {
158 setverdict(fail,match(pl_data,pl_expected_data)) }
161 function f_checkE(in E pl_data, in template E pl_expected_data) {
162 if( match(pl_data,pl_expected_data)) {
165 setverdict(fail,match(pl_data,pl_expected_data)) }
168 function f_checkF(in F pl_data, in template F pl_expected_data) {
169 if( match(pl_data,pl_expected_data)) {
172 setverdict(fail,match(pl_data,pl_expected_data)) }
175 function f_checkF2(in F2 pl_data, in template F2 pl_expected_data) {
176 if( match(pl_data,pl_expected_data)) {
179 setverdict(fail,match(pl_data,pl_expected_data)) }
181 function f_checkRoC(in RoC pl_data, in template RoC pl_expected_data) {
182 if( match(pl_data,pl_expected_data)) {
185 setverdict(fail,match(pl_data,pl_expected_data)) }
188 function f_checkRoRoC(in RoRoC pl_data, in template RoRoC pl_expected_data) {
189 if( match(pl_data,pl_expected_data)) {
192 setverdict(fail,match(pl_data,pl_expected_data)) }
195 function f_checkRoRoF(in RoRoF pl_data, in template RoRoF pl_expected_data) {
196 if( match(pl_data,pl_expected_data)) {
199 setverdict(fail,match(pl_data,pl_expected_data)) }
202 function f_checkU(in U pl_data, in template U pl_expected_data) {
203 if( match(pl_data,pl_expected_data)) {
206 setverdict(fail,match(pl_data,pl_expected_data)) }
209 //==================================================
210 //=============== Testcases ========================
211 //==================================================
212 testcase tc_F_simple() runs on MyCT {
213 var template F vl_expected:={f1:={f2:={f3:= "a"}}};
214 f_checkF(tsp_3_1,vl_expected);
217 testcase tc_F_comments() runs on MyCT {
218 var template F vl_expected:={f1:={f2:={f3:= "a"}}};
219 f_checkF(tsp_3_2,vl_expected);
222 testcase tc_F_embedded1() runs on MyCT {
223 var template F vl_expected:={f1:={f2:={f3:= "abrakadabra"}}};
224 f_checkF(tsp_3_3,vl_expected);
227 testcase tc_RoC_comments() runs on MyCT {
228 var template RoC vl_expected:={ "asdf" };
229 f_checkRoC(tsp_4,vl_expected);
232 testcase tc_F2_30() runs on MyCT {
233 var template F2 vl_expected:={ f3:="1" };
234 f_checkF2(tsp_30,vl_expected);
237 testcase tc_F2_31() runs on MyCT {
238 var template F2 vl_expected:={ f3:="1" };
239 f_checkF2(tsp_31,vl_expected);
242 testcase tc_F2_32() runs on MyCT {
243 var template F2 vl_expected:={ f3:="1" };
244 f_checkF2(tsp_32,vl_expected);
248 testcase tc_F2_33() runs on MyCT {
249 var template F2 vl_expected:={ f3:="a" };
250 f_checkF2(tsp_33,vl_expected);
253 testcase tc_F2_34() runs on MyCT {
254 var template F2 vl_expected:={ f3:="a" };
255 f_checkF2(tsp_34,vl_expected);
258 testcase tc_F2_35() runs on MyCT {
259 var template F2 vl_expected:={ f3:="a" };
260 f_checkF2(tsp_35,vl_expected);
263 testcase tc_F2_36() runs on MyCT {
264 var template F2 vl_expected:={ f3:="a" };
265 f_checkF2(tsp_36,vl_expected);
268 testcase tc_F2_37() runs on MyCT {
269 var template F2 vl_expected:={ f3:="a" };
270 f_checkF2(tsp_37,vl_expected);
272 testcase tc_F2_38() runs on MyCT {
273 var template F2 vl_expected:={ f3:="a" };
274 f_checkF2(tsp_38,vl_expected);
277 testcase tc_F2_39() runs on MyCT {
278 var template F2 vl_expected:={ f3:="${DEF_20}" };
279 f_checkF2(tsp_39,vl_expected);
282 testcase tc_RoRoC_41() runs on MyCT {
283 var template RoRoC vl_expected:={ };
284 f_checkRoRoC(tsp_41,vl_expected);
286 testcase tc_RoRoC_42() runs on MyCT {
287 var template RoRoC vl_expected:={ };
288 f_checkRoRoC(tsp_42,vl_expected);
291 testcase tc_RoRoC_43() runs on MyCT {
292 var template RoRoC vl_expected:={ };
293 f_checkRoRoC(tsp_43,vl_expected);
295 testcase tc_RoRoC_44() runs on MyCT {
296 var template RoRoC vl_expected:={{},{},{},{},{}};
297 f_checkRoRoC(tsp_44,vl_expected);
300 testcase tc_RoRoC_50() runs on MyCT {
301 var template RoRoC vl_expected:={{},{},{},{}};
302 f_checkRoRoC(tsp_50,vl_expected);
305 //=====================================================
307 testcase tc_E1() runs on MyCT {
308 var template E vl_expected:= {
316 f_checkE(tsp_e1,vl_expected);
319 testcase tc_E2() runs on MyCT {
320 var template E vl_expected:=
321 {i:=1,f:=7.2,bs:='0011'B,hs:='123AF'H,os:='0123AF'O,cs:="abrakadabra"};
322 f_checkE(tsp_e2,vl_expected);
325 testcase tc_E3() runs on MyCT {
326 var template E vl_expected:=
327 {i:=1,f:=7.2,bs:='0011'B,hs:='123AF'H,os:='0123AF'O,cs:="""abrakadabra"""};
328 f_checkE(tsp_e3,vl_expected);
331 testcase tc_E4() runs on MyCT {
332 var template E vl_expected:=
333 {i:=1,f:=7.2,bs:='0011'B,hs:='123AF'H,os:='0123AF'O,cs:="abrakadabra"};
334 f_checkE(tsp_e4,vl_expected);
337 testcase tc_U_i() runs on MyCT {
338 var template U vl_expected:=
340 f_checkU(tsp_U_i,vl_expected);
343 testcase tc_U_f() runs on MyCT {
344 var template U vl_expected:=
346 f_checkU(tsp_U_f,vl_expected);
349 testcase tc_U_bs() runs on MyCT {
350 var template U vl_expected:=
352 f_checkU(tsp_U_bs,vl_expected);
355 testcase tc_U_hs() runs on MyCT {
356 var template U vl_expected:=
358 f_checkU(tsp_U_hs,vl_expected);
361 testcase tc_U_os() runs on MyCT {
362 var template U vl_expected:=
364 f_checkU(tsp_U_os,vl_expected);
367 testcase tc_U_cs1() runs on MyCT {
368 var template U vl_expected:=
369 {cs:= "abrakadabra" };
370 f_checkU(tsp_U_cs1,vl_expected);
373 testcase tc_U_cs2() runs on MyCT {
374 var template U vl_expected:=
375 {cs:= "abrakadabra" };
376 f_checkU(tsp_U_cs2,vl_expected);
379 testcase tc_CR_example1() runs on MyCT {
380 var template CR vl_expected:= CLASSMARK2_GSM_ONLY;
381 f_checkCR(tsp_CR1,vl_expected);
384 testcase tc_CR_example2() runs on MyCT {
385 var template CR vl_expected:= CLASSMARK2_GSM_ONLY;
386 f_checkCR(tsp_CR2,vl_expected);
389 testcase tc_CR_example3() runs on MyCT {
390 var template CR vl_expected:= CLASSMARK2_GSM_ONLY;
391 f_checkCR(tsp_CR3,vl_expected);
393 //==== CONTROL PART ====
396 execute(tc_F_simple());
397 execute(tc_F_comments());
398 execute(tc_F_embedded1());
399 execute(tc_RoC_comments());
410 execute(tc_RoRoC_41());
411 execute(tc_RoRoC_42());
412 execute(tc_RoRoC_43());
413 execute(tc_RoRoC_44());
414 execute(tc_RoRoC_50());
426 execute(tc_CR_example1());
427 execute(tc_CR_example2());
428 execute(tc_CR_example3());