1 .******************************************************************************
2 .* Copyright (c) 2000-2014 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 :docname.Test Description
12 :docno.7/152 91-CRL 113 200/2 Uen
16 :prep.ETH/XZR Jeno Balasko (+36 1 437 7760)
17 :appr.ETH/XZ (Gyula Koos)
20 :title.Test description - RAW coder
22 .*---------------------------------------------------------------------*
23 :h1.PREREQUISITES AND PREPARATIONS
24 .*---------------------------------------------------------------------*
25 .*---------------------------------------------------------------------*
26 :h2.Scope of the Test Object
27 .*---------------------------------------------------------------------*
29 This TD contains unified test cases related to TTCN3 Executor's RAW coder function.
30 The original test cases can be found in the RAW_EncDec_TD.script file.
31 The reason for the unification was to get a really fast version of the tests.
35 :p.:us.Revision Information:eus.
40 REV DATE PREPARED CHANGE
41 === ========== ======== ======
42 A 2003-10-31 ETHCSIR New document
43 B 2005-11-09 EKRISZA New tests and updates of the original tests.
44 C 2007-03-06 EDMDELI Implicit message encoding
45 D 2007-06-20 EDMDELI New testcase for implicit message encoding
46 E 2008-10-01 EFERKOV Big integers
47 F 2010-01-18 EKRISZA Updated for TITAN R8C
48 H 2010-08-13 EKRISZA Updated for TITAN R8E
49 J 2011-05-26 EKRISZA Added new test
50 K 2010-01-18 EKRISZA Updated for TITAN R8H
51 A 2011-12-12 EKRISZA Updated for release
52 PB1 2012-01-31 ETHBAAT Based on Test Description RAW coder, 7/152 91-CRL 113 200 Uen, file: RAW_EncDec_TD.script Testcases expecting "passed" have been merged
53 B 2013-01-17 EKRIPND Updated for release
54 PC1 2013-02-01 ETHBAAT Testcase for TR HQ49956 fixing added
58 .*---------------------------------------------------------------------*
60 .*---------------------------------------------------------------------*
61 :p.:us.Software Tools:eus.
68 .*---------------------------------------------------------------------*
69 :h1.REQUIREMENT-BASED TESTS
70 .*---------------------------------------------------------------------*
71 .*---------------------------------------------------------------------*
72 :h2.Testing FIELDLENGTH Attribute
73 .*---------------------------------------------------------------------*
74 .*---------------------------------------------------------------------*
76 .*---------------------------------------------------------------------*
83 type component TempComp {}
87 type integer RAW_PDU_1
88 with { encode "RAW"; variant "FIELDLENGTH(16)"};
89 external function enc_RAW_PDU_1(in RAW_PDU_1 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
90 external function dec_RAW_PDU_1(in octetstring stream) return RAW_PDU_1 with { extension "prototype(convert) decode(RAW)" }
92 testcase TC_FIELDLENGTH_16_for_integer() runs on TempComp {
93 const RAW_PDU_1 i := 255
94 const octetstring o := 'FF00'O
96 if ((enc_RAW_PDU_1(i) == o)and(dec_RAW_PDU_1(o) == i)) {setverdict(pass);}
97 else {setverdict(fail,"enc_RAW_PDU_1(i)= ", enc_RAW_PDU_1(i), "; dec_RAW_PDU_1(o)= ", dec_RAW_PDU_1(o));}
100 type integer RAW_PDU_2
101 with { encode "RAW"; variant "FIELDLENGTH(8)"};
102 external function enc_RAW_PDU_2(in RAW_PDU_2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
103 external function dec_RAW_PDU_2(in octetstring stream) return RAW_PDU_2 with { extension "prototype(convert) decode(RAW)" }
105 testcase TC_FIELDLENGTH_8_for_integer() runs on TempComp {
106 const RAW_PDU_2 i := 15
107 const octetstring o := '0F'O
109 if ((enc_RAW_PDU_2(i) == o)and(dec_RAW_PDU_2(o) == i)) {setverdict(pass);}
110 else {setverdict(fail,"enc_RAW_PDU_2(i)= ", enc_RAW_PDU_2(i), "; dec_RAW_PDU_2(o)= ", dec_RAW_PDU_2(o));}
115 type integer RAW_PDU_3
116 with { encode "RAW"; variant "FIELDLENGTH(4)"};
117 external function enc_RAW_PDU_3(in RAW_PDU_3 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
118 external function dec_RAW_PDU_3(in octetstring stream) return RAW_PDU_3 with { extension "prototype(convert) decode(RAW)" }
120 testcase TC_FIELDLENGTH_4_for_integer() runs on TempComp {
121 const RAW_PDU_3 i := 15
122 const octetstring o := '0F'O
124 if ((enc_RAW_PDU_3(i) == o)and(dec_RAW_PDU_3(o) == i)) {setverdict(pass);}
125 else {setverdict(fail,"enc_RAW_PDU_3(i)= ", enc_RAW_PDU_3(i), "; dec_RAW_PDU_3(o)= ", dec_RAW_PDU_3(o));}
130 testcase TC_FIELDLENGTH_16_for_integer_2() runs on TempComp {
131 const RAW_PDU_1 i := 4660
132 const octetstring o := '3412'O
134 if ((enc_RAW_PDU_1(i) == o)and(dec_RAW_PDU_1(o) == i)) {setverdict(pass);}
135 else {setverdict(fail,"enc_RAW_PDU_1(i)= ", enc_RAW_PDU_1(i), "; dec_RAW_PDU_1(o)= ", dec_RAW_PDU_1(o));}
140 type integer RAW_PDU_4
141 with { encode "RAW"; variant "FIELDLENGTH(32)"};
142 external function enc_RAW_PDU_4(in RAW_PDU_4 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
143 external function dec_RAW_PDU_4(in octetstring stream) return RAW_PDU_4 with { extension "prototype(convert) decode(RAW)" }
145 testcase TC_FIELDLENGTH_32_for_integer_1_bit_long() runs on TempComp {
146 const RAW_PDU_4 i := 1
147 const octetstring o := '01000000'O
149 if ((enc_RAW_PDU_4(i) == o)and(dec_RAW_PDU_4(o) == i)) {setverdict(pass);}
150 else {setverdict(fail,"enc_RAW_PDU_4(i)= ", enc_RAW_PDU_4(i), "; dec_RAW_PDU_4(o)= ", dec_RAW_PDU_4(o));}
155 type integer RAW_PDU_5
156 with { encode "RAW"; variant ""};
157 external function enc_RAW_PDU_5(in RAW_PDU_5 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
158 external function dec_RAW_PDU_5(in octetstring stream) return RAW_PDU_5 with { extension "prototype(convert) decode(RAW)" }
160 testcase TC_Default_FIELDLENGTH_for_integer() runs on TempComp {
161 const RAW_PDU_5 i := 255
162 const octetstring o := 'FF'O
164 if ((enc_RAW_PDU_5(i) == o)and(dec_RAW_PDU_5(o) == i)) {setverdict(pass);}
165 else {setverdict(fail,"enc_RAW_PDU_5(i)= ", enc_RAW_PDU_5(i), "; dec_RAW_PDU_5(o)= ", dec_RAW_PDU_5(o));}
170 type bitstring RAW_PDU_6
171 with { encode "RAW"; variant "FIELDLENGTH(8)"};
172 external function enc_RAW_PDU_6(in RAW_PDU_6 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
173 external function dec_RAW_PDU_6(in octetstring stream) return RAW_PDU_6 with { extension "prototype(convert) decode(RAW)" }
175 testcase TC_FIELDLENGTH_8_for_bitstring() runs on TempComp {
176 const RAW_PDU_6 i := '11110000'B
177 const octetstring o := 'F0'O
179 if ((enc_RAW_PDU_6(i) == o)and(dec_RAW_PDU_6(o) == i)) {setverdict(pass);}
180 else {setverdict(fail,"enc_RAW_PDU_6(i)= ", enc_RAW_PDU_6(i), "; dec_RAW_PDU_6(o)= ", dec_RAW_PDU_6(o));}
185 type bitstring RAW_PDU_7
186 with { encode "RAW"; variant "FIELDLENGTH(8)"};
187 external function enc_RAW_PDU_7(in RAW_PDU_7 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
188 external function dec_RAW_PDU_7(in octetstring stream) return RAW_PDU_7 with { extension "prototype(convert) decode(RAW)" }
190 testcase TC_FIELDLENGTH_8_for_bitstring_4_bits_long() runs on TempComp {
191 const RAW_PDU_7 i := '1111'B
192 const octetstring o := '0F'O
194 if ((enc_RAW_PDU_7(i) == o)and(dec_RAW_PDU_7(o) == '0000'B & i)) {setverdict(pass);}
195 else {setverdict(fail,"enc_RAW_PDU_7(i)= ", enc_RAW_PDU_7(i), "; dec_RAW_PDU_7(o)= ", dec_RAW_PDU_7(o));}
200 type bitstring RAW_PDU_8
201 with { encode "RAW"; variant "FIELDLENGTH(4)"};
202 external function enc_RAW_PDU_8(in RAW_PDU_8 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
203 external function dec_RAW_PDU_8(in octetstring stream) return RAW_PDU_8 with { extension "prototype(convert) decode(RAW)" }
205 testcase TC_FIELDLENGTH_4_for_bitstring() runs on TempComp {
206 const RAW_PDU_8 i := '1111'B
207 const octetstring o := '0F'O
209 if ((enc_RAW_PDU_8(i) == o)and(dec_RAW_PDU_8(o) == i)) {setverdict(pass);}
210 else {setverdict(fail,"enc_RAW_PDU_8(i)= ", enc_RAW_PDU_8(i), "; dec_RAW_PDU_8(o)= ", dec_RAW_PDU_8(o));}
215 type bitstring RAW_PDU_9
216 with { encode "RAW"; variant "FIELDLENGTH(16)"};
217 external function enc_RAW_PDU_9(in RAW_PDU_9 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
218 external function dec_RAW_PDU_9(in octetstring stream) return RAW_PDU_9 with { extension "prototype(convert) decode(RAW)" }
220 testcase TC_FIELDLENGTH_16_for_bitstring() runs on TempComp {
221 const RAW_PDU_9 i := '1111000001110000'B
222 const octetstring o := '70F0'O
224 if ((enc_RAW_PDU_9(i) == o)and(dec_RAW_PDU_9(o) == i)) {setverdict(pass);}
225 else {setverdict(fail,"enc_RAW_PDU_9(i)= ", enc_RAW_PDU_9(i), "; dec_RAW_PDU_9(o)= ", dec_RAW_PDU_9(o));}
230 type bitstring RAW_PDU_10
231 with { encode "RAW"; variant "FIELDLENGTH(24)"};
232 external function enc_RAW_PDU_10(in RAW_PDU_10 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
233 external function dec_RAW_PDU_10(in octetstring stream) return RAW_PDU_10 with { extension "prototype(convert) decode(RAW)" }
235 testcase TC_FIELDLENGTH_24_for_bitstring() runs on TempComp {
236 const RAW_PDU_10 i := '1111000001110000'B
237 const octetstring o := '70F000'O
239 if ((enc_RAW_PDU_10(i) == o)and(dec_RAW_PDU_10(o) =='00000000'B & i)) {setverdict(pass);}
240 else {setverdict(fail,"enc_RAW_PDU_10(i)= ", enc_RAW_PDU_10(i), "; dec_RAW_PDU_10(o)= ", dec_RAW_PDU_10(o));}
245 type bitstring RAW_PDU_11
246 with { encode "RAW"; variant "FIELDLENGTH(0)"};
247 external function enc_RAW_PDU_11(in RAW_PDU_11 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
248 external function dec_RAW_PDU_11(in octetstring stream) return RAW_PDU_11 with { extension "prototype(convert) decode(RAW)" }
250 testcase TC_FIELDLENGTH_0_for_bitstring() runs on TempComp {
251 const RAW_PDU_11 i := '1111000001110000'B
252 const octetstring o := '70F0'O
254 if ((enc_RAW_PDU_11(i) == o)and(dec_RAW_PDU_11(o) == i)) {setverdict(pass);}
255 else {setverdict(fail,"enc_RAW_PDU_11(i)= ", enc_RAW_PDU_11(i), "; dec_RAW_PDU_11(o)= ", dec_RAW_PDU_11(o));}
260 type bitstring RAW_PDU_12
261 with { encode "RAW"; variant ""};
262 external function enc_RAW_PDU_12(in RAW_PDU_12 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
263 external function dec_RAW_PDU_12(in octetstring stream) return RAW_PDU_12 with { extension "prototype(convert) decode(RAW)" }
265 testcase TC_DEFAULT_FIELDLENGTH_for_bitstring() runs on TempComp {
266 const RAW_PDU_12 i := '1111000001110000'B
267 const octetstring o := '70F0'O
269 if ((enc_RAW_PDU_12(i) == o)and(dec_RAW_PDU_12(o) == i)) {setverdict(pass);}
270 else {setverdict(fail,"enc_RAW_PDU_12(i)= ", enc_RAW_PDU_12(i), "; dec_RAW_PDU_12(o)= ", dec_RAW_PDU_12(o));}
275 type bitstring RAW_PDU_13
276 with { encode "RAW"; variant "FIELDLENGTH(32)"};
277 external function enc_RAW_PDU_13(in RAW_PDU_13 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
278 external function dec_RAW_PDU_13(in octetstring stream) return RAW_PDU_13 with { extension "prototype(convert) decode(RAW)" }
280 testcase TC_FIELDLENGTH_32_for_bitstring_4_bits_long() runs on TempComp {
281 const RAW_PDU_13 i := '1111'B
282 const octetstring o := '0F000000'O
284 if ((enc_RAW_PDU_13(i) == o)and(dec_RAW_PDU_13(o) == '0000000000000000000000000000'B & i)) {setverdict(pass);}
285 else {setverdict(fail,"enc_RAW_PDU_13(i)= ", enc_RAW_PDU_13(i), "; dec_RAW_PDU_13(o)= ", dec_RAW_PDU_13(o));}
290 type octetstring RAW_PDU_14
291 with { encode "RAW"; variant "FIELDLENGTH(1)"};
292 external function enc_RAW_PDU_14(in RAW_PDU_14 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
293 external function dec_RAW_PDU_14(in octetstring stream) return RAW_PDU_14 with { extension "prototype(convert) decode(RAW)" }
295 testcase TC_FIELDLENGTH_1_for_octetstring() runs on TempComp {
296 const RAW_PDU_14 i := '0F'O
297 const octetstring o := '0F'O
299 if ((enc_RAW_PDU_14(i) == o)and(dec_RAW_PDU_14(o) == i)) {setverdict(pass);}
300 else {setverdict(fail,"enc_RAW_PDU_14(i)= ", enc_RAW_PDU_14(i), "; dec_RAW_PDU_14(o)= ", dec_RAW_PDU_14(o));}
305 type octetstring RAW_PDU_15
306 with { encode "RAW"; variant "FIELDLENGTH(2)"};
307 external function enc_RAW_PDU_15(in RAW_PDU_15 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
308 external function dec_RAW_PDU_15(in octetstring stream) return RAW_PDU_15 with { extension "prototype(convert) decode(RAW)" }
310 testcase TC_FIELDLENGTH_2_for_octetstring() runs on TempComp {
311 const RAW_PDU_15 i := '1234'O
312 const octetstring o := '1234'O
314 if ((enc_RAW_PDU_15(i) == o)and(dec_RAW_PDU_15(o) == i)) {setverdict(pass);}
315 else {setverdict(fail,"enc_RAW_PDU_15(i)= ", enc_RAW_PDU_15(i), "; dec_RAW_PDU_15(o)= ", dec_RAW_PDU_15(o));}
320 type octetstring RAW_PDU_16
321 with { variant "FIELDLENGTH(2)";
322 variant "BYTEORDER (first)";
325 external function enc_RAW_PDU_16(in RAW_PDU_16 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
326 external function dec_RAW_PDU_16(in octetstring stream) return RAW_PDU_16 with { extension "prototype(convert) decode(RAW)" }
328 testcase TC_FIELDLENGTH_2_and_BYTEORDER_first_for_octetstring() runs on TempComp {
329 const RAW_PDU_16 i := '1234'O
330 const octetstring o := '1234'O
332 if ((enc_RAW_PDU_16(i) == o)and(dec_RAW_PDU_16(o) == i)) {setverdict(pass);}
333 else {setverdict(fail,"enc_RAW_PDU_16(i)= ", enc_RAW_PDU_16(i), "; dec_RAW_PDU_16(o)= ", dec_RAW_PDU_16(o));}
338 type octetstring RAW_PDU_17
339 with { variant "FIELDLENGTH(2)";
340 variant "BYTEORDER (last)";
343 external function enc_RAW_PDU_17(in RAW_PDU_17 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
344 external function dec_RAW_PDU_17(in octetstring stream) return RAW_PDU_17 with { extension "prototype(convert) decode(RAW)" }
346 testcase TC_FIELDLENGTH_2_and_BYTEORDER_last_for_octetstring() runs on TempComp {
347 const RAW_PDU_17 i := '1234'O
348 const octetstring o := '3412'O
350 if ((enc_RAW_PDU_17(i) == o)and(dec_RAW_PDU_17(o) == i)) {setverdict(pass);}
351 else {setverdict(fail,"enc_RAW_PDU_17(i)= ", enc_RAW_PDU_17(i), "; dec_RAW_PDU_17(o)= ", dec_RAW_PDU_17(o));}
356 type octetstring RAW_PDU_18
357 with { variant "FIELDLENGTH(4)";
358 variant "BYTEORDER (first)";
361 external function enc_RAW_PDU_18(in RAW_PDU_18 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
362 external function dec_RAW_PDU_18(in octetstring stream) return RAW_PDU_18 with { extension "prototype(convert) decode(RAW)" }
364 testcase TC_FIELDLENGTH_4_and_BYTEORDER_first_for_octetstring() runs on TempComp {
365 const RAW_PDU_18 i := '12345678'O
366 const octetstring o := '12345678'O
368 if ((enc_RAW_PDU_18(i) == o)and(dec_RAW_PDU_18(o) == i)) {setverdict(pass);}
369 else {setverdict(fail,"enc_RAW_PDU_18(i)= ", enc_RAW_PDU_18(i), "; dec_RAW_PDU_18(o)= ", dec_RAW_PDU_18(o));}
374 testcase TC_FIELDLENGTH_4_for_octetstring_3_octets_long() runs on TempComp {
375 const RAW_PDU_18 i := '123456'O
376 const octetstring o := '12345600'O
378 if ((enc_RAW_PDU_18(i) == o)and(dec_RAW_PDU_18(o) == i & '00'O)) {setverdict(pass);}
379 else {setverdict(fail,"enc_RAW_PDU_18(i)= ", enc_RAW_PDU_18(i), "; dec_RAW_PDU_18(o)= ", dec_RAW_PDU_18(o));}
384 type octetstring RAW_PDU_19
385 with { variant "FIELDLENGTH(5)";
388 external function enc_RAW_PDU_19(in RAW_PDU_19 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
389 external function dec_RAW_PDU_19(in octetstring stream) return RAW_PDU_19 with { extension "prototype(convert) decode(RAW)" }
391 testcase TC_FIELDLENGTH_5_for_octetstring_2_octets_long() runs on TempComp {
392 const RAW_PDU_19 i := '1234'O
393 const octetstring o := '1234000000'O
395 if ((enc_RAW_PDU_19(i) == o)and(dec_RAW_PDU_19(o) == i& '000000'O )) {setverdict(pass);}
396 else {setverdict(fail,"enc_RAW_PDU_19(i)= ", enc_RAW_PDU_19(i), "; dec_RAW_PDU_19(o)= ", dec_RAW_PDU_19(o));}
401 type octetstring RAW_PDU_20
402 with { variant "FIELDLENGTH(4)";
403 variant "BYTEORDER (last)";
406 external function enc_RAW_PDU_20(in RAW_PDU_20 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
407 external function dec_RAW_PDU_20(in octetstring stream) return RAW_PDU_20 with { extension "prototype(convert) decode(RAW)" }
409 testcase TC_FIELDLENGTH_4_and_BYTEORDER_last_for_octetstring() runs on TempComp {
410 const RAW_PDU_20 i := '12345678'O
411 const octetstring o := '78563412'O
413 if ((enc_RAW_PDU_20(i) == o)and(dec_RAW_PDU_20(o) == i)) {setverdict(pass);}
414 else {setverdict(fail,"enc_RAW_PDU_20(i)= ", enc_RAW_PDU_20(i), "; dec_RAW_PDU_20(o)= ", dec_RAW_PDU_20(o));}
419 testcase TC_FIELDLENGTH_4_and_BYTEORDER_last_for_octetstring_3_octets_long() runs on TempComp {
420 const RAW_PDU_20 i := '123456'O
421 const octetstring o := '00563412'O
423 if ((enc_RAW_PDU_20(i) == o)and(dec_RAW_PDU_20(o) == i & '00'O)) {setverdict(pass);}
424 else {setverdict(fail,"enc_RAW_PDU_20(i)= ", enc_RAW_PDU_20(i), "; dec_RAW_PDU_20(o)= ", dec_RAW_PDU_20(o));}
429 type octetstring RAW_PDU_21
433 external function enc_RAW_PDU_21(in RAW_PDU_21 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
434 external function dec_RAW_PDU_21(in octetstring stream) return RAW_PDU_21 with { extension "prototype(convert) decode(RAW)" }
436 testcase TC_Default_FIELDLENGTH_for_octetstring() runs on TempComp {
437 const RAW_PDU_21 i := '123456'O
438 const octetstring o := '123456'O
440 if ((enc_RAW_PDU_21(i) == o)and(dec_RAW_PDU_21(o) == i)) {setverdict(pass);}
441 else {setverdict(fail,"enc_RAW_PDU_21(i)= ", enc_RAW_PDU_21(i), "; dec_RAW_PDU_21(o)= ", dec_RAW_PDU_21(o));}
446 type octetstring RAW_PDU_22
447 with { variant "FIELDLENGTH(0)";
450 external function enc_RAW_PDU_22(in RAW_PDU_22 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
451 external function dec_RAW_PDU_22(in octetstring stream) return RAW_PDU_22 with { extension "prototype(convert) decode(RAW)" }
453 testcase TC_FIELDLENGTH_0_for_octetstring() runs on TempComp {
454 const RAW_PDU_22 i := '1234'O
455 const octetstring o := '1234'O
457 if ((enc_RAW_PDU_22(i) == o)and(dec_RAW_PDU_22(o) == i)) {setverdict(pass);}
458 else {setverdict(fail,"enc_RAW_PDU_22(i)= ", enc_RAW_PDU_22(i), "; dec_RAW_PDU_22(o)= ", dec_RAW_PDU_22(o));}
463 type hexstring RAW_PDU_23
464 with { variant "FIELDLENGTH(4)";
467 external function enc_RAW_PDU_23(in RAW_PDU_23 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
468 external function dec_RAW_PDU_23(in octetstring stream) return RAW_PDU_23 with { extension "prototype(convert) decode(RAW)" }
470 testcase TC_FIELDLENGTH_4_for_hexstring() runs on TempComp {
471 const RAW_PDU_23 i := '1234'H
472 const octetstring o := '2143'O
474 if ((enc_RAW_PDU_23(i) == o)and(dec_RAW_PDU_23(o) == i)) {setverdict(pass);}
475 else {setverdict(fail,"enc_RAW_PDU_23(i)= ", enc_RAW_PDU_23(i), "; dec_RAW_PDU_23(o)= ", dec_RAW_PDU_23(o));}
480 type hexstring RAW_PDU_24
481 with { variant "FIELDLENGTH(8)";
484 external function enc_RAW_PDU_24(in RAW_PDU_24 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
485 external function dec_RAW_PDU_24(in octetstring stream) return RAW_PDU_24 with { extension "prototype(convert) decode(RAW)" }
487 testcase TC_FIELDLENGTH_8_for_hexstring() runs on TempComp {
488 const RAW_PDU_24 i := '1234'H
489 const octetstring o := '21430000'O
491 if ((enc_RAW_PDU_24(i) == o)and(dec_RAW_PDU_24(o) == i & '0000'H)) {setverdict(pass);}
492 else {setverdict(fail,"enc_RAW_PDU_24(i)= ", enc_RAW_PDU_24(i), "; dec_RAW_PDU_24(o)= ", dec_RAW_PDU_24(o));}
498 type hexstring RAW_PDU_25
502 external function enc_RAW_PDU_25(in RAW_PDU_25 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
503 external function dec_RAW_PDU_25(in octetstring stream) return RAW_PDU_25 with { extension "prototype(convert) decode(RAW)" }
505 testcase TC_DEFAULT_FIELDLENGTH_for_hexstring() runs on TempComp {
506 const RAW_PDU_25 i := '12345670'H
507 const octetstring o := '21436507'O
509 if ((enc_RAW_PDU_25(i) == o)and(dec_RAW_PDU_25(o) == i)) {setverdict(pass);}
510 else {setverdict(fail,"enc_RAW_PDU_25(i)= ", enc_RAW_PDU_25(i), "; dec_RAW_PDU_25(o)= ", dec_RAW_PDU_25(o));}
515 type hexstring RAW_PDU_26
516 with { variant "FIELDLENGTH(0)";
519 external function enc_RAW_PDU_26(in RAW_PDU_26 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
520 external function dec_RAW_PDU_26(in octetstring stream) return RAW_PDU_26 with { extension "prototype(convert) decode(RAW)" }
522 testcase TC_FIELDLENGTH_0_for_hexstring() runs on TempComp {
523 const RAW_PDU_26 i := '123456'H
524 const octetstring o := '214365'O
526 if ((enc_RAW_PDU_26(i) == o)and(dec_RAW_PDU_26(o) == i)) {setverdict(pass);}
527 else {setverdict(fail,"enc_RAW_PDU_26(i)= ", enc_RAW_PDU_26(i), "; dec_RAW_PDU_26(o)= ", dec_RAW_PDU_26(o));}
532 type hexstring RAW_PDU_27
533 with { variant "FIELDLENGTH(12)";
536 external function enc_RAW_PDU_27(in RAW_PDU_27 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
537 external function dec_RAW_PDU_27(in octetstring stream) return RAW_PDU_27 with { extension "prototype(convert) decode(RAW)" }
539 testcase TC_FIELDLENGTH_12_for_hexstring_2_hex_long() runs on TempComp {
540 const RAW_PDU_27 i := '12'H
541 const octetstring o := '210000000000'O
543 if ((enc_RAW_PDU_27(i) == o)and(dec_RAW_PDU_27(o) == i & '0000000000'H)) {setverdict(pass);}
544 else {setverdict(fail,"enc_RAW_PDU_27(i)= ", enc_RAW_PDU_27(i), "; dec_RAW_PDU_27(o)= ", dec_RAW_PDU_27(o));}
549 type enumerated RAW_PDU_28
550 { zero, first, second, third, fourth, fifth, sixth , seventh, eight, nineth,
552 with { variant "FIELDLENGTH(4)" ;
554 external function enc_RAW_PDU_28(in RAW_PDU_28 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
555 external function dec_RAW_PDU_28(in octetstring stream) return RAW_PDU_28 with { extension "prototype(convert) decode(RAW)" }
557 testcase TC_FIELDLENGTH_4_for_enumerated() runs on TempComp {
558 const RAW_PDU_28 i := first
559 const octetstring o := '01'O
561 if ((enc_RAW_PDU_28(i) == o)and(dec_RAW_PDU_28(o) == i)) {setverdict(pass);}
562 else {setverdict(fail,"enc_RAW_PDU_28(i)= ", enc_RAW_PDU_28(i), "; dec_RAW_PDU_28(o)= ", dec_RAW_PDU_28(o));}
567 type enumerated RAW_PDU_29
568 { zero, first, second, third, fourth, fifth, sixth , seventh, eight, nineth,
570 with { variant "FIELDLENGTH(32)" ;
572 external function enc_RAW_PDU_29(in RAW_PDU_29 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
573 external function dec_RAW_PDU_29(in octetstring stream) return RAW_PDU_29 with { extension "prototype(convert) decode(RAW)" }
575 testcase TC_FIELDLENGTH_32_for_enumerated() runs on TempComp {
576 const RAW_PDU_29 i := first
577 const octetstring o := '01000000'O
579 if ((enc_RAW_PDU_29(i) == o)and(dec_RAW_PDU_29(o) == i)) {setverdict(pass);}
580 else {setverdict(fail,"enc_RAW_PDU_29(i)= ", enc_RAW_PDU_29(i), "; dec_RAW_PDU_29(o)= ", dec_RAW_PDU_29(o));}
585 type enumerated RAW_PDU_30
586 { zero, first, second, third, fourth, fifth, sixth , seventh, eight, nineth,
590 external function enc_RAW_PDU_30(in RAW_PDU_30 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
591 external function dec_RAW_PDU_30(in octetstring stream) return RAW_PDU_30 with { extension "prototype(convert) decode(RAW)" }
593 testcase TC_Default_FIELDLENGTH_for_enumerated() runs on TempComp {
594 const RAW_PDU_30 i := tenth
595 const octetstring o := '0A'O
597 if ((enc_RAW_PDU_30(i) == o)and(dec_RAW_PDU_30(o) == i)) {setverdict(pass);}
598 else {setverdict(fail,"enc_RAW_PDU_30(i)= ", enc_RAW_PDU_30(i), "; dec_RAW_PDU_30(o)= ", dec_RAW_PDU_30(o));}
603 type bitstring RAW_PDU_31 length (4);
604 external function enc_RAW_PDU_31(in RAW_PDU_31 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
605 external function dec_RAW_PDU_31(in octetstring stream) return RAW_PDU_31 with { extension "prototype(convert) decode(RAW)" }
607 testcase TC_FIELDLENGTH_with_length_restriction_bitstring() runs on TempComp {
608 const RAW_PDU_31 i := '1111'B
609 const octetstring o := '0F'O
611 if ((enc_RAW_PDU_31(i) == o)and(dec_RAW_PDU_31(o) == i)) {setverdict(pass);}
612 else {setverdict(fail,"enc_RAW_PDU_31(i)= ", enc_RAW_PDU_31(i), "; dec_RAW_PDU_31(o)= ", dec_RAW_PDU_31(o));}
617 type hexstring RAW_PDU_32 length (0);
618 external function enc_RAW_PDU_32(in RAW_PDU_32 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
619 external function dec_RAW_PDU_32(in octetstring stream) return RAW_PDU_32 with { extension "prototype(convert) decode(RAW)" }
621 testcase TC_FIELDLENGTH_with_length_restriction_hexstring() runs on TempComp {
622 const RAW_PDU_32 i := ''H
623 const octetstring o := ''O
625 if ((enc_RAW_PDU_32(i) == o)and(dec_RAW_PDU_32(o) == i)) {setverdict(pass);}
626 else {setverdict(fail,"enc_RAW_PDU_32(i)= ", enc_RAW_PDU_32(i), "; dec_RAW_PDU_32(o)= ", dec_RAW_PDU_32(o));}
631 type octetstring RAW_PDU_33 length (2 .. 2);
632 external function enc_RAW_PDU_33(in RAW_PDU_33 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
633 external function dec_RAW_PDU_33(in octetstring stream) return RAW_PDU_33 with { extension "prototype(convert) decode(RAW)" }
635 testcase TC_FIELDLENGTH_with_length_restriction_octetstring() runs on TempComp {
636 const RAW_PDU_33 i := '1122'O
637 const octetstring o := '1122'O
639 if ((enc_RAW_PDU_33(i) == o)and(dec_RAW_PDU_33(o) == i)) {setverdict(pass);}
640 else {setverdict(fail,"enc_RAW_PDU_33(i)= ", enc_RAW_PDU_33(i), "; dec_RAW_PDU_33(o)= ", dec_RAW_PDU_33(o));}
644 type record RAW_PDU_34 {bitstring b length(4), hexstring h length(5), octetstring o length(2 .. 2)}
645 with {encode "RAW"; variant ""};
646 external function enc_RAW_PDU_34(in RAW_PDU_34 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
647 external function dec_RAW_PDU_34(in octetstring stream) return RAW_PDU_34 with { extension "prototype(convert) decode(RAW)" }
649 testcase TC_FIELDLENGTH_with_length_restriction_record() runs on TempComp {
650 const RAW_PDU_34 i := {'1001'B,'12345'H, '1122'O}
651 const octetstring o := '1932541122'O
653 if ((enc_RAW_PDU_34(i) == o)and(dec_RAW_PDU_34(o) == i)) {setverdict(pass);}
654 else {setverdict(fail,"enc_RAW_PDU_34(i)= ", enc_RAW_PDU_34(i), "; dec_RAW_PDU_34(o)= ", dec_RAW_PDU_34(o));}
659 type bitstring btype_35 length (12 .. 12);
660 type record length (2 .. 2) of btype_35 RAW_PDU_35
661 with {encode "RAW"; variant ""};
662 external function enc_RAW_PDU_35(in RAW_PDU_35 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
663 external function dec_RAW_PDU_35(in octetstring stream) return RAW_PDU_35 with { extension "prototype(convert) decode(RAW)" }
665 testcase TC_FIELDLENGTH_with_length_restriction_record_of() runs on TempComp {
666 const RAW_PDU_35 i := {'000011111111'B, '111100001111'B}
667 const octetstring o := 'FFF0F0'O
669 if ((enc_RAW_PDU_35(i) == o)and(dec_RAW_PDU_35(o) == i)) {setverdict(pass);}
670 else {setverdict(fail,"enc_RAW_PDU_35(i)= ", enc_RAW_PDU_35(i), "; dec_RAW_PDU_35(o)= ", dec_RAW_PDU_35(o));}
675 type bitstring btype length (1)
676 type hexstring htype length (4)
677 type octetstring otype length (2 .. 2)
679 type set RAW_PDU_36 {hexstring h length(4), octetstring o length (2 .. 2), bitstring b length(1)}
680 with {encode "RAW"; variant ""};
681 external function enc_RAW_PDU_36(in RAW_PDU_36 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
682 external function dec_RAW_PDU_36(in octetstring stream) return RAW_PDU_36 with { extension "prototype(convert) decode(RAW)" }
684 testcase TC_FIELDLENGTH_with_length_restriction_set() runs on TempComp {
685 const RAW_PDU_36 i := {h := '1234'H, o := '1122'O, b := '1'B}
686 const octetstring o := '2143112201'O
688 if ((enc_RAW_PDU_36(i) == o)and(dec_RAW_PDU_36(o) == i)) {setverdict(pass);}
689 else {setverdict(fail,"enc_RAW_PDU_36(i)= ", enc_RAW_PDU_36(i), "; dec_RAW_PDU_36(o)= ", dec_RAW_PDU_36(o));}
694 type bitstring btype_37 length (12 .. 12);
695 type record length (2 .. 2) of btype_37 RAW_PDU_37
696 with {encode "RAW"; variant ""};
697 external function enc_RAW_PDU_37(in RAW_PDU_37 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
698 external function dec_RAW_PDU_37(in octetstring stream) return RAW_PDU_37 with { extension "prototype(convert) decode(RAW)" }
700 testcase TC_FIELDLENGTH_with_length_restriction_set_of() runs on TempComp {
701 const RAW_PDU_37 i := {'000011111111'B, '111100001111'B}
702 const octetstring o := 'FFF0F0'O
704 if ((enc_RAW_PDU_37(i) == o)and(dec_RAW_PDU_37(o) == i)) {setverdict(pass);}
705 else {setverdict(fail,"enc_RAW_PDU_37(i)= ", enc_RAW_PDU_37(i), "; dec_RAW_PDU_37(o)= ", dec_RAW_PDU_37(o));}
710 type bitstring RAW_PDU_38 length (9 .. 9)
711 with {encode "RAW"; variant "ALIGN(left)"};
712 external function enc_RAW_PDU_38(in RAW_PDU_38 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
713 external function dec_RAW_PDU_38(in octetstring stream) return RAW_PDU_38 with { extension "prototype(convert) decode(RAW)" }
715 testcase TC_FIELDLENGTH_with_length_restriction_and_align_bitstring() runs on TempComp {
716 const RAW_PDU_38 i := '111100001'B
717 const octetstring o := 'E101'O
719 if ((enc_RAW_PDU_38(i) == o)and(dec_RAW_PDU_38(o) == i)) {setverdict(pass);}
720 else {setverdict(fail,"enc_RAW_PDU_38(i)= ", enc_RAW_PDU_38(i), "; dec_RAW_PDU_38(o)= ", dec_RAW_PDU_38(o));}
725 type hexstring RAW_PDU_39 length (10 .. 10)
726 with {encode "RAW"; variant "ALIGN(right), BITORDERINOCTET(lsb)"};
727 external function enc_RAW_PDU_39(in RAW_PDU_39 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
728 external function dec_RAW_PDU_39(in octetstring stream) return RAW_PDU_39 with { extension "prototype(convert) decode(RAW)" }
730 testcase TC_FIELDLENGTH_with_length_restriction_and_align_hexstring() runs on TempComp {
731 const RAW_PDU_39 i := '0000012345'H
732 const octetstring o := '0000103254000000'O
734 if (dec_RAW_PDU_39(o) == i) {setverdict(pass);}
735 else {setverdict(fail,"enc_RAW_PDU_39(i)= ", enc_RAW_PDU_39(i), "; dec_RAW_PDU_39(o)= ", dec_RAW_PDU_39(o));}
740 type octetstring RAW_PDU_40 length (8 .. 8)
741 with {encode "RAW"; variant "ALIGN(left)"};
742 external function enc_RAW_PDU_40(in RAW_PDU_40 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
743 external function dec_RAW_PDU_40(in octetstring stream) return RAW_PDU_40 with { extension "prototype(convert) decode(RAW)" }
745 testcase TC_FIELDLENGTH_with_length_restriction_and_align_octetstring() runs on TempComp {
746 const RAW_PDU_40 i := '0102030400000000'O
747 const octetstring o := '010203040000000000000000000000'O
749 if (dec_RAW_PDU_40(o) == i) {setverdict(pass);}
750 else {setverdict(fail,"enc_RAW_PDU_40(i)= ", enc_RAW_PDU_40(i), "; dec_RAW_PDU_40(o)= ", dec_RAW_PDU_40(o));}
755 type integer RAW_PDU_41
756 with {encode "RAW"; variant "BYTEORDER (first)"};
757 external function enc_RAW_PDU_41(in RAW_PDU_41 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
758 external function dec_RAW_PDU_41(in octetstring stream) return RAW_PDU_41 with { extension "prototype(convert) decode(RAW)" }
760 testcase TC_BYTEORDER_first_for_integer_0() runs on TempComp {
761 const RAW_PDU_41 i := 0
762 const octetstring o := '00'O
764 if ((enc_RAW_PDU_41(i) == o)and(dec_RAW_PDU_41(o) == i)) {setverdict(pass);}
765 else {setverdict(fail,"enc_RAW_PDU_41(i)= ", enc_RAW_PDU_41(i), "; dec_RAW_PDU_41(o)= ", dec_RAW_PDU_41(o));}
770 testcase TC_BYTEORDER_first_for_integer_1() runs on TempComp {
771 const RAW_PDU_41 i := 1
772 const octetstring o := '01'O
774 if ((enc_RAW_PDU_41(i) == o)and(dec_RAW_PDU_41(o) == i)) {setverdict(pass);}
775 else {setverdict(fail,"enc_RAW_PDU_41(i)= ", enc_RAW_PDU_41(i), "; dec_RAW_PDU_41(o)= ", dec_RAW_PDU_41(o));}
780 testcase TC_BYTEORDER_first_for_integer_18() runs on TempComp {
781 const RAW_PDU_41 i := 18
782 const octetstring o := '12'O
784 if ((enc_RAW_PDU_41(i) == o)and(dec_RAW_PDU_41(o) == i)) {setverdict(pass);}
785 else {setverdict(fail,"enc_RAW_PDU_41(i)= ", enc_RAW_PDU_41(i), "; dec_RAW_PDU_41(o)= ", dec_RAW_PDU_41(o));}
790 type integer RAW_PDU_42
792 variant "FIELDLENGTH (8)" ;
793 variant "BYTEORDER (first)"};
794 external function enc_RAW_PDU_42(in RAW_PDU_42 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
795 external function dec_RAW_PDU_42(in octetstring stream) return RAW_PDU_42 with { extension "prototype(convert) decode(RAW)" }
797 testcase TC_BYTEORDER_first_and_fieldlength_8_for_integer() runs on TempComp {
798 const RAW_PDU_42 i := 15
799 const octetstring o := '0F'O
801 if ((enc_RAW_PDU_42(i) == o)and(dec_RAW_PDU_42(o) == i)) {setverdict(pass);}
802 else {setverdict(fail,"enc_RAW_PDU_42(i)= ", enc_RAW_PDU_42(i), "; dec_RAW_PDU_42(o)= ", dec_RAW_PDU_42(o));}
807 type integer RAW_PDU_43
809 variant "FIELDLENGTH (16)" ;
810 variant "BYTEORDER (first)"};
811 external function enc_RAW_PDU_43(in RAW_PDU_43 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
812 external function dec_RAW_PDU_43(in octetstring stream) return RAW_PDU_43 with { extension "prototype(convert) decode(RAW)" }
814 testcase TC_BYTEORDER_first_and_fieldlength_16_for_integer() runs on TempComp {
815 const RAW_PDU_43 i := 15
816 const octetstring o := '0F00'O
818 if ((enc_RAW_PDU_43(i) == o)and(dec_RAW_PDU_43(o) == i)) {setverdict(pass);}
819 else {setverdict(fail,"enc_RAW_PDU_43(i)= ", enc_RAW_PDU_43(i), "; dec_RAW_PDU_43(o)= ", dec_RAW_PDU_43(o));}
824 type integer RAW_PDU_44
826 variant "BYTEORDER (last)"};
827 external function enc_RAW_PDU_44(in RAW_PDU_44 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
828 external function dec_RAW_PDU_44(in octetstring stream) return RAW_PDU_44 with { extension "prototype(convert) decode(RAW)" }
830 testcase TC_BYTEORDER_last_for_integer_0() runs on TempComp {
831 const RAW_PDU_44 i := 0
832 const octetstring o := '00'O
834 if ((enc_RAW_PDU_44(i) == o)and(dec_RAW_PDU_44(o) == i)) {setverdict(pass);}
835 else {setverdict(fail,"enc_RAW_PDU_44(i)= ", enc_RAW_PDU_44(i), "; dec_RAW_PDU_44(o)= ", dec_RAW_PDU_44(o));}
840 testcase TC_BYTEORDER_last_for_integer_1() runs on TempComp {
841 const RAW_PDU_44 i := 1
842 const octetstring o := '01'O
844 if ((enc_RAW_PDU_44(i) == o)and(dec_RAW_PDU_44(o) == i)) {setverdict(pass);}
845 else {setverdict(fail,"enc_RAW_PDU_44(i)= ", enc_RAW_PDU_44(i), "; dec_RAW_PDU_44(o)= ", dec_RAW_PDU_44(o));}
850 testcase TC_BYTEORDER_last_for_integer_18() runs on TempComp {
851 const RAW_PDU_44 i := 18
852 const octetstring o := '12'O
854 if ((enc_RAW_PDU_44(i) == o)and(dec_RAW_PDU_44(o) == i)) {setverdict(pass);}
855 else {setverdict(fail,"enc_RAW_PDU_44(i)= ", enc_RAW_PDU_44(i), "; dec_RAW_PDU_44(o)= ", dec_RAW_PDU_44(o));}
860 type integer RAW_PDU_45
862 variant "FIELDLENGTH (8)" ;
863 variant "BYTEORDER (last)" };
864 external function enc_RAW_PDU_45(in RAW_PDU_45 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
865 external function dec_RAW_PDU_45(in octetstring stream) return RAW_PDU_45 with { extension "prototype(convert) decode(RAW)" }
867 testcase TC_BYTEORDER_last_and_fieldlength_8_for_integer() runs on TempComp {
868 const RAW_PDU_45 i := 15
869 const octetstring o := '0F'O
871 if ((enc_RAW_PDU_45(i) == o)and(dec_RAW_PDU_45(o) == i)) {setverdict(pass);}
872 else {setverdict(fail,"enc_RAW_PDU_45(i)= ", enc_RAW_PDU_45(i), "; dec_RAW_PDU_45(o)= ", dec_RAW_PDU_45(o));}
877 type integer RAW_PDU_46
879 variant "FIELDLENGTH (16)" ;
880 variant "BYTEORDER (last)" };
881 external function enc_RAW_PDU_46(in RAW_PDU_46 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
882 external function dec_RAW_PDU_46(in octetstring stream) return RAW_PDU_46 with { extension "prototype(convert) decode(RAW)" }
884 testcase TC_BYTEORDER_last_and_fieldlength_16_for_integer() runs on TempComp {
885 const RAW_PDU_46 i := 15
886 const octetstring o := '000F'O
888 if ((enc_RAW_PDU_46(i) == o)and(dec_RAW_PDU_46(o) == i)) {setverdict(pass);}
889 else {setverdict(fail,"enc_RAW_PDU_46(i)= ", enc_RAW_PDU_46(i), "; dec_RAW_PDU_46(o)= ", dec_RAW_PDU_46(o));}
894 type bitstring RAW_PDU_47
896 variant "FIELDLENGTH(16)" ;
897 variant "BYTEORDER (first)" };
898 external function enc_RAW_PDU_47(in RAW_PDU_47 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
899 external function dec_RAW_PDU_47(in octetstring stream) return RAW_PDU_47 with { extension "prototype(convert) decode(RAW)" }
901 testcase TC_BYTEORDER_first_for_bitstring() runs on TempComp {
902 const RAW_PDU_47 i := '0000000100000010'B
903 const octetstring o := '0201'O
905 if ((enc_RAW_PDU_47(i) == o)and(dec_RAW_PDU_47(o) == i)) {setverdict(pass);}
906 else {setverdict(fail,"enc_RAW_PDU_47(i)= ", enc_RAW_PDU_47(i), "; dec_RAW_PDU_47(o)= ", dec_RAW_PDU_47(o));}
912 type bitstring RAW_PDU_48
914 variant "FIELDLENGTH(16)" ;
915 variant "BYTEORDER (last)" };
916 external function enc_RAW_PDU_48(in RAW_PDU_48 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
917 external function dec_RAW_PDU_48(in octetstring stream) return RAW_PDU_48 with { extension "prototype(convert) decode(RAW)" }
919 testcase TC_BYTEORDER_last_for_bitstring() runs on TempComp {
920 const RAW_PDU_48 i := '0000000100000010'B
921 const octetstring o := '0102'O
923 if ((enc_RAW_PDU_48(i) == o)and(dec_RAW_PDU_48(o) == i)) {setverdict(pass);}
924 else {setverdict(fail,"enc_RAW_PDU_48(i)= ", enc_RAW_PDU_48(i), "; dec_RAW_PDU_48(o)= ", dec_RAW_PDU_48(o));}
929 type octetstring RAW_PDU_49
931 variant "BYTEORDER (first)"};
932 external function enc_RAW_PDU_49(in RAW_PDU_49 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
933 external function dec_RAW_PDU_49(in octetstring stream) return RAW_PDU_49 with { extension "prototype(convert) decode(RAW)" }
935 testcase TC_BYTEORDER_first_for_octetstring() runs on TempComp {
936 const RAW_PDU_49 i := '1234'O
937 const octetstring o := '1234'O
939 if ((enc_RAW_PDU_49(i) == o)and(dec_RAW_PDU_49(o) == i)) {setverdict(pass);}
940 else {setverdict(fail,"enc_RAW_PDU_49(i)= ", enc_RAW_PDU_49(i), "; dec_RAW_PDU_49(o)= ", dec_RAW_PDU_49(o));}
945 type octetstring RAW_PDU_50
947 variant "BYTEORDER (last)"};
948 external function enc_RAW_PDU_50(in RAW_PDU_50 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
949 external function dec_RAW_PDU_50(in octetstring stream) return RAW_PDU_50 with { extension "prototype(convert) decode(RAW)" }
951 testcase TC_BYTEORDER_last_for_octetstring() runs on TempComp {
952 const RAW_PDU_50 i := '1234'O
953 const octetstring o := '3412'O
955 if ((enc_RAW_PDU_50(i) == o)and(dec_RAW_PDU_50(o) == i)) {setverdict(pass);}
956 else {setverdict(fail,"enc_RAW_PDU_50(i)= ", enc_RAW_PDU_50(i), "; dec_RAW_PDU_50(o)= ", dec_RAW_PDU_50(o));}
961 type enumerated RAW_PDU_51
962 { zero, first, second, third, fourth, fifth, sixth , seventh, eight, nineth,
965 variant "FIELDLENGTH(16)" ;
966 variant "BYTEORDER (first) "};
967 external function enc_RAW_PDU_51(in RAW_PDU_51 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
968 external function dec_RAW_PDU_51(in octetstring stream) return RAW_PDU_51 with { extension "prototype(convert) decode(RAW)" }
970 testcase TC_BYTEORDER_first_for_enumerated() runs on TempComp {
971 const RAW_PDU_51 i := first
972 const octetstring o := '0100'O
974 if ((enc_RAW_PDU_51(i) == o)and(dec_RAW_PDU_51(o) == i)) {setverdict(pass);}
975 else {setverdict(fail,"enc_RAW_PDU_51(i)= ", enc_RAW_PDU_51(i), "; dec_RAW_PDU_51(o)= ", dec_RAW_PDU_51(o));}
980 type enumerated RAW_PDU_52
981 { zero, first, second, third, fourth, fifth, sixth , seventh, eight, nineth,
984 variant "FIELDLENGTH(16)" ;
985 variant "BYTEORDER (last) "};
986 external function enc_RAW_PDU_52(in RAW_PDU_52 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
987 external function dec_RAW_PDU_52(in octetstring stream) return RAW_PDU_52 with { extension "prototype(convert) decode(RAW)" }
989 testcase TC_BYTEORDER_last_for_enumerated() runs on TempComp {
990 const RAW_PDU_52 i := first
991 const octetstring o := '0001'O
993 if ((enc_RAW_PDU_52(i) == o)and(dec_RAW_PDU_52(o) == i)) {setverdict(pass);}
994 else {setverdict(fail,"enc_RAW_PDU_52(i)= ", enc_RAW_PDU_52(i), "; dec_RAW_PDU_52(o)= ", dec_RAW_PDU_52(o));}
999 type hexstring RAW_PDU_53
1000 with { encode "RAW"; variant "BYTEORDER(first)"};
1001 external function enc_RAW_PDU_53(in RAW_PDU_53 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1002 external function dec_RAW_PDU_53(in octetstring stream) return RAW_PDU_53 with { extension "prototype(convert) decode(RAW)" }
1004 testcase TC_BYTEORDER_first_for_hexstring() runs on TempComp {
1005 const RAW_PDU_53 i := '1234567890'H
1006 const octetstring o := '2143658709'O
1008 if ((enc_RAW_PDU_53(i) == o)and(dec_RAW_PDU_53(o) == i)) {setverdict(pass);}
1009 else {setverdict(fail,"enc_RAW_PDU_53(i)= ", enc_RAW_PDU_53(i), "; dec_RAW_PDU_53(o)= ", dec_RAW_PDU_53(o));}
1014 type hexstring RAW_PDU_54
1015 with { encode "RAW"; variant "BYTEORDER(last)"};
1016 external function enc_RAW_PDU_54(in RAW_PDU_54 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1017 external function dec_RAW_PDU_54(in octetstring stream) return RAW_PDU_54 with { extension "prototype(convert) decode(RAW)" }
1019 testcase TC_BYTEORDER_last_for_hexstring() runs on TempComp {
1020 const RAW_PDU_54 i := '1234567890'H
1021 const octetstring o := '0987654321'O
1023 if ((enc_RAW_PDU_54(i) == o)and(dec_RAW_PDU_54(o) == i)) {setverdict(pass);}
1024 else {setverdict(fail,"enc_RAW_PDU_54(i)= ", enc_RAW_PDU_54(i), "; dec_RAW_PDU_54(o)= ", dec_RAW_PDU_54(o));}
1028 type integer RAW_PDU_56
1029 with { encode "RAW";
1030 variant "FIELDLENGTH(8)" ;
1031 variant "BITORDERINFIELD(lsb)"};
1033 external function enc_RAW_PDU_56(in RAW_PDU_56 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1034 external function dec_RAW_PDU_56(in octetstring stream) return RAW_PDU_56 with { extension "prototype(convert) decode(RAW)" }
1036 testcase TC_BITORDERINFIELD_lsb_for_integer_8() runs on TempComp{
1037 const RAW_PDU_56 i := 15
1038 const octetstring o := '0F'O
1039 if ((enc_RAW_PDU_56(i) == o)and(dec_RAW_PDU_56(o) == i)) {setverdict(pass);}
1040 else {setverdict(fail);}
1043 type integer RAW_PDU_57
1044 with { encode "RAW";
1045 variant "FIELDLENGTH(8)" ;
1046 variant "BITORDERINFIELD(msb)"};
1048 external function enc_RAW_PDU_57(in RAW_PDU_57 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1049 external function dec_RAW_PDU_57(in octetstring stream) return RAW_PDU_57 with { extension "prototype(convert) decode(RAW)" }
1051 testcase TC_BITORDERINFIELD_msb_for_integer_8() runs on TempComp{
1052 const RAW_PDU_57 i := 15
1053 const octetstring o := 'F0'O
1054 if ((enc_RAW_PDU_57(i) == o)and(dec_RAW_PDU_57(o) == i)) {setverdict(pass);}
1055 else {setverdict(fail);}
1058 type integer RAW_PDU_58
1059 with { encode "RAW";
1060 variant "FIELDLENGTH(16)" ;
1061 variant "BITORDERINFIELD(lsb)"};
1063 external function enc_RAW_PDU_58(in RAW_PDU_58 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1064 external function dec_RAW_PDU_58(in octetstring stream) return RAW_PDU_58 with { extension "prototype(convert) decode(RAW)" }
1066 testcase TC_BITORDERINFIELD_lsb_for_integer_16() runs on TempComp{
1067 const RAW_PDU_58 i := 4660
1068 const octetstring o := '3412'O
1069 if ((enc_RAW_PDU_58(i) == o)and(dec_RAW_PDU_58(o) == i)) {setverdict(pass);}
1070 else {setverdict(fail);}
1073 type integer RAW_PDU_59
1074 with { encode "RAW";
1075 variant "FIELDLENGTH(16)" ;
1076 variant "BITORDERINFIELD(msb)"};
1078 external function enc_RAW_PDU_59(in RAW_PDU_59 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1079 external function dec_RAW_PDU_59(in octetstring stream) return RAW_PDU_59 with { extension "prototype(convert) decode(RAW)" }
1081 testcase TC_BITORDERINFIELD_msb_for_integer_16() runs on TempComp{
1082 const RAW_PDU_59 i := 4660
1083 const octetstring o := '482C'O
1084 if ((enc_RAW_PDU_59(i) == o)and(dec_RAW_PDU_59(o) == i)) {setverdict(pass);}
1085 else {setverdict(fail);}
1088 type octetstring RAW_PDU_60
1089 with { encode "RAW";
1090 variant "FIELDLENGTH(1)" ;
1091 variant "BITORDERINFIELD(lsb)"};
1093 external function enc_RAW_PDU_60(in RAW_PDU_60 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1094 external function dec_RAW_PDU_60(in octetstring stream) return RAW_PDU_60 with { extension "prototype(convert) decode(RAW)" }
1096 testcase TC_BITORDERINFIELD_lsb_for_octetstring_1() runs on TempComp{
1097 const RAW_PDU_60 i := '0F'O
1098 const octetstring o := '0F'O
1099 if ((enc_RAW_PDU_60(i) == o)and(dec_RAW_PDU_60(o) == i)) {setverdict(pass);}
1100 else {setverdict(fail);}
1103 type octetstring RAW_PDU_61
1104 with { encode "RAW";
1105 variant "FIELDLENGTH(1)" ;
1106 variant "BITORDERINFIELD(msb)"};
1108 external function enc_RAW_PDU_61(in RAW_PDU_61 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1109 external function dec_RAW_PDU_61(in octetstring stream) return RAW_PDU_61 with { extension "prototype(convert) decode(RAW)" }
1111 testcase TC_BITORDERINFIELD_msb_for_octetstring_1() runs on TempComp{
1112 const RAW_PDU_61 i := '0F'O
1113 const octetstring o := 'F0'O
1114 if ((enc_RAW_PDU_61(i) == o)and(dec_RAW_PDU_61(o) == i)) {setverdict(pass);}
1115 else {setverdict(fail);}
1118 type octetstring RAW_PDU_62
1119 with { encode "RAW";
1120 variant "FIELDLENGTH(2)" ;
1121 variant "BITORDERINFIELD(lsb)"};
1123 external function enc_RAW_PDU_62(in RAW_PDU_62 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1124 external function dec_RAW_PDU_62(in octetstring stream) return RAW_PDU_62 with { extension "prototype(convert) decode(RAW)" }
1126 testcase TC_BITORDERINFIELD_lsb_for_octetstring_2() runs on TempComp{
1127 const RAW_PDU_62 i := '1234'O
1128 const octetstring o := '1234'O
1129 if ((enc_RAW_PDU_62(i) == o)and(dec_RAW_PDU_62(o) == i)) {setverdict(pass);}
1130 else {setverdict(fail);}
1133 type octetstring RAW_PDU_63
1134 with { encode "RAW";
1135 variant "FIELDLENGTH(2)" ;
1136 variant "BITORDERINFIELD(msb)"};
1138 external function enc_RAW_PDU_63(in RAW_PDU_63 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1139 external function dec_RAW_PDU_63(in octetstring stream) return RAW_PDU_63 with { extension "prototype(convert) decode(RAW)" }
1141 testcase TC_BITORDERINFIELD_msb_for_octetstring_2() runs on TempComp{
1142 const RAW_PDU_63 i := '1234'O
1143 const octetstring o := '2C48'O
1144 if ((enc_RAW_PDU_63(i) == o)and(dec_RAW_PDU_63(o) == i)) {setverdict(pass);}
1145 else {setverdict(fail);}
1148 type bitstring RAW_PDU_64
1149 with { encode "RAW";
1150 variant "FIELDLENGTH(8)" ;
1151 variant "BITORDERINFIELD(lsb)"};
1153 external function enc_RAW_PDU_64(in RAW_PDU_64 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1154 external function dec_RAW_PDU_64(in octetstring stream) return RAW_PDU_64 with { extension "prototype(convert) decode(RAW)" }
1156 testcase TC_BITORDERINFIELD_lsb_for_bitstring_8() runs on TempComp{
1157 const RAW_PDU_64 i := '00000011'B
1158 const octetstring o := '03'O
1159 if ((enc_RAW_PDU_64(i) == o)and(dec_RAW_PDU_64(o) == i)) {setverdict(pass);}
1160 else {setverdict(fail);}
1163 type bitstring RAW_PDU_65
1164 with { encode "RAW";
1165 variant "FIELDLENGTH(8)" ;
1166 variant "BITORDERINFIELD(msb)"};
1168 external function enc_RAW_PDU_65(in RAW_PDU_65 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1169 external function dec_RAW_PDU_65(in octetstring stream) return RAW_PDU_65 with { extension "prototype(convert) decode(RAW)" }
1171 testcase TC_BITORDERINFIELD_msb_for_bitstring_8() runs on TempComp{
1172 const RAW_PDU_65 i := '00000011'B
1173 const octetstring o := 'C0'O
1174 if ((enc_RAW_PDU_65(i) == o)and(dec_RAW_PDU_65(o) == i)) {setverdict(pass);}
1175 else {setverdict(fail);}
1178 type bitstring RAW_PDU_66
1179 with { encode "RAW";
1180 variant "FIELDLENGTH(16)" ;
1181 variant "BITORDERINFIELD(lsb)"};
1183 external function enc_RAW_PDU_66(in RAW_PDU_66 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1184 external function dec_RAW_PDU_66(in octetstring stream) return RAW_PDU_66 with { extension "prototype(convert) decode(RAW)" }
1186 testcase TC_BITORDERINFIELD_lsb_for_bitstring_16() runs on TempComp {
1187 const RAW_PDU_66 i := '0001111100110001'B
1188 const octetstring o := '311F'O
1189 if ((enc_RAW_PDU_66(i) == o)and(dec_RAW_PDU_66(o) == i)) {setverdict(pass);}
1190 else {setverdict(fail);}
1193 type bitstring RAW_PDU_67
1194 with { encode "RAW";
1195 variant "FIELDLENGTH(16)" ;
1196 variant "BITORDERINFIELD(msb)"};
1198 external function enc_RAW_PDU_67(in RAW_PDU_67 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1199 external function dec_RAW_PDU_67(in octetstring stream) return RAW_PDU_67 with { extension "prototype(convert) decode(RAW)" }
1201 testcase TC_BITORDERINFIELD_msb_for_bitstring_16() runs on TempComp{
1202 const RAW_PDU_67 i := '0001111100110001'B
1203 const octetstring o := 'F88C'O
1204 if ((enc_RAW_PDU_67(i) == o)and(dec_RAW_PDU_67(o) == i)) {setverdict(pass);}
1205 else {setverdict(fail);}
1210 type enumerated RAW_PDU_68
1211 { zero, first, second, third, fourth, fifth, sixth , seventh, eight, nineth,
1213 with { encode "RAW";
1214 variant "FIELDLENGTH(4)" ;
1215 variant "BITORDERINFIELD (lsb) "};
1219 external function enc_RAW_PDU_68(in RAW_PDU_68 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1220 external function dec_RAW_PDU_68(in octetstring stream) return RAW_PDU_68 with { extension "prototype(convert) decode(RAW)" }
1222 testcase TC_BITORDERINFIELD_lsb_for_enumerated_4() runs on TempComp{
1223 const RAW_PDU_68 i := first
1224 const octetstring o := '01'O
1225 if ((enc_RAW_PDU_68(i) == o)and(dec_RAW_PDU_68(o) == i )) {setverdict(pass);}
1226 else {setverdict(fail);}
1229 type enumerated RAW_PDU_69
1230 { zero, first, second, third, fourth, fifth, sixth , seventh, eight, nineth,
1232 with { encode "RAW";
1233 variant "FIELDLENGTH(8)" ;
1234 variant "BITORDERINFIELD (msb) "};
1238 external function enc_RAW_PDU_69(in RAW_PDU_69 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1239 external function dec_RAW_PDU_69(in octetstring stream) return RAW_PDU_69 with { extension "prototype(convert) decode(RAW)" }
1241 testcase TC_BITORDERINFIELD_msb_for_enumerated_8() runs on TempComp{
1242 const RAW_PDU_69 i := first;
1243 const octetstring o := '80'O;
1244 if ((enc_RAW_PDU_69(i) == o)and(dec_RAW_PDU_69(o) == i )) {setverdict(pass);}
1245 else {setverdict(fail);}
1249 type hexstring RAW_PDU_70
1250 with { encode "RAW"; variant "BITORDERINFIELD(lsb)"};
1254 external function enc_RAW_PDU_70(in RAW_PDU_70 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1255 external function dec_RAW_PDU_70(in octetstring stream) return RAW_PDU_70 with { extension "prototype(convert) decode(RAW)" }
1257 testcase TC_BITORDERINFIELD_lsb_for_hexstring() runs on TempComp{
1258 const RAW_PDU_70 i := '1234'H
1259 const octetstring o := '2143'O
1260 if ((enc_RAW_PDU_70(i) == o)and(dec_RAW_PDU_70(o) == i )) {setverdict(pass);}
1261 else {setverdict(fail);}
1264 type hexstring RAW_PDU_71
1265 with { encode "RAW"; variant "BITORDERINFIELD(msb)"};
1269 external function enc_RAW_PDU_71(in RAW_PDU_71 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1270 external function dec_RAW_PDU_71(in octetstring stream) return RAW_PDU_71 with { extension "prototype(convert) decode(RAW)" }
1272 testcase TC_BITORDERINFIELD_msb_for_hexstring() runs on TempComp {
1273 const RAW_PDU_71 i := '1234'H
1274 const octetstring o := 'C284'O
1275 if ((enc_RAW_PDU_71(i) == o)and(dec_RAW_PDU_71(o) == i )) {setverdict(pass);}
1276 else {setverdict(fail);}
1279 //Testing BITORDERINOCTET Attribute:
1281 type integer RAW_PDU_72
1282 with { encode "RAW";
1283 variant "FIELDLENGTH(8)" ;
1284 variant "BITORDERINOCTET(lsb)"};
1286 external function enc_RAW_PDU_72(in RAW_PDU_72 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1287 external function dec_RAW_PDU_72(in octetstring stream) return RAW_PDU_72 with { extension "prototype(convert) decode(RAW)" }
1289 testcase TC_BITORDERINOCTET_lsb_for_integer_8() runs on TempComp{
1290 const RAW_PDU_72 i := 15;
1291 const octetstring o := '0F'O;
1292 if ((enc_RAW_PDU_72(i) == o)and(dec_RAW_PDU_72(o) == i )) {setverdict(pass);}
1293 else {setverdict(fail);}
1296 type integer RAW_PDU_73
1297 with { encode "RAW";
1298 variant "FIELDLENGTH(8)" ;
1299 variant "BITORDERINOCTET(msb)"};
1301 external function enc_RAW_PDU_73(in RAW_PDU_73 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1302 external function dec_RAW_PDU_73(in octetstring stream) return RAW_PDU_73 with { extension "prototype(convert) decode(RAW)" }
1304 testcase TC_BITORDERINOCTET_msb_for_integer_8() runs on TempComp{
1305 const RAW_PDU_73 i := 15
1306 const octetstring o := 'F0'O
1307 if ((enc_RAW_PDU_73(i) == o)and(dec_RAW_PDU_73(o) == i )) {setverdict(pass);}
1308 else {setverdict(fail);}
1311 type integer RAW_PDU_74
1312 with { encode "RAW";
1313 variant "FIELDLENGTH(16)" ;
1314 variant "BITORDERINOCTET(lsb)"};
1316 external function enc_RAW_PDU_74(in RAW_PDU_74 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1317 external function dec_RAW_PDU_74(in octetstring stream) return RAW_PDU_74 with { extension "prototype(convert) decode(RAW)" }
1319 testcase TC_BITORDERINOCTET_lsb_for_integer_16() runs on TempComp{
1320 const RAW_PDU_74 i := 4660
1321 const octetstring o := '3412'O
1322 if ((enc_RAW_PDU_74(i) == o)and(dec_RAW_PDU_74(o) == i )) {setverdict(pass);}
1323 else {setverdict(fail);}
1326 type integer RAW_PDU_75
1327 with { encode "RAW";
1328 variant "FIELDLENGTH(16)" ;
1329 variant "BITORDERINOCTET(msb)"};
1331 external function enc_RAW_PDU_75(in RAW_PDU_75 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1332 external function dec_RAW_PDU_75(in octetstring stream) return RAW_PDU_75 with { extension "prototype(convert) decode(RAW)" }
1334 testcase TC_BITORDERINOCTET_msb_for_integer_16() runs on TempComp{
1335 const RAW_PDU_75 i := 4660
1336 const octetstring o := '2C48'O
1337 if ((enc_RAW_PDU_75(i) == o)and(dec_RAW_PDU_75(o) == i )) {setverdict(pass);}
1338 else {setverdict(fail);}
1341 type octetstring RAW_PDU_76
1342 with { encode "RAW";
1343 variant "FIELDLENGTH(1)" ;
1344 variant "BITORDERINOCTET(lsb)"
1347 external function enc_RAW_PDU_76(in RAW_PDU_76 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1348 external function dec_RAW_PDU_76(in octetstring stream) return RAW_PDU_76 with { extension "prototype(convert) decode(RAW)" }
1350 testcase TC_BITORDERINOCTET_lsb_for_octetstring_1() runs on TempComp{
1351 const RAW_PDU_76 i := '0F'O
1352 const octetstring o := '0F'O
1353 if ((enc_RAW_PDU_76(i) == o)and(dec_RAW_PDU_76(o) == i )) {setverdict(pass);}
1354 else {setverdict(fail);}
1357 type octetstring RAW_PDU_77
1358 with { encode "RAW";
1359 variant "FIELDLENGTH(1)" ;
1360 variant "BITORDERINOCTET(msb)"
1363 external function enc_RAW_PDU_77(in RAW_PDU_77 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1364 external function dec_RAW_PDU_77(in octetstring stream) return RAW_PDU_77 with { extension "prototype(convert) decode(RAW)" }
1366 testcase TC_BITORDERINOCTET_msb_for_octetstring_1() runs on TempComp{
1367 const RAW_PDU_77 i := '0F'O
1368 const octetstring o := 'F0'O
1369 if ((enc_RAW_PDU_77(i) == o)and(dec_RAW_PDU_77(o) == i )) {setverdict(pass);}
1370 else {setverdict(fail);}
1373 type octetstring RAW_PDU_78
1374 with { encode "RAW";
1375 variant "FIELDLENGTH(2)" ;
1376 variant "BITORDERINOCTET(lsb)"
1379 external function enc_RAW_PDU_78(in RAW_PDU_78 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1380 external function dec_RAW_PDU_78(in octetstring stream) return RAW_PDU_78 with { extension "prototype(convert) decode(RAW)" }
1382 testcase TC_BITORDERINOCTET_lsb_for_octetstring_2() runs on TempComp{
1383 const RAW_PDU_78 i := '1234'O
1384 const octetstring o := '1234'O
1385 if ((enc_RAW_PDU_78(i) == o)and(dec_RAW_PDU_78(o) == i )) {setverdict(pass);}
1386 else {setverdict(fail);}
1389 type octetstring RAW_PDU_79
1390 with { encode "RAW";
1391 variant "FIELDLENGTH(2)" ;
1392 variant "BITORDERINOCTET(msb)"
1395 external function enc_RAW_PDU_79(in RAW_PDU_79 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1396 external function dec_RAW_PDU_79(in octetstring stream) return RAW_PDU_79 with { extension "prototype(convert) decode(RAW)" }
1398 testcase TC_BITORDERINOCTET_msb_for_octetstring_2() runs on TempComp{
1399 const RAW_PDU_79 i := '1234'O
1400 const octetstring o := '482C'O
1401 if ((enc_RAW_PDU_79(i) == o)and(dec_RAW_PDU_79(o) == i )) {setverdict(pass);}
1402 else {setverdict(fail);}
1405 type bitstring RAW_PDU_80
1406 with { encode "RAW";
1407 variant "FIELDLENGTH(8)" ;
1408 variant "BITORDERINOCTET(lsb)"
1410 external function enc_RAW_PDU_80(in RAW_PDU_80 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1411 external function dec_RAW_PDU_80(in octetstring stream) return RAW_PDU_80 with { extension "prototype(convert) decode(RAW)" }
1413 testcase TC_BITORDERINOCTET_lsb_for_bitstring_8() runs on TempComp{
1414 const RAW_PDU_80 i := '00000011'B
1415 const octetstring o := '03'O
1416 if ((enc_RAW_PDU_80(i) == o)and(dec_RAW_PDU_80(o) == i )) {setverdict(pass);}
1417 else {setverdict(fail);}
1420 type bitstring RAW_PDU_81
1421 with { encode "RAW";
1422 variant "FIELDLENGTH(8)" ;
1423 variant "BITORDERINOCTET(msb)"
1425 external function enc_RAW_PDU_81(in RAW_PDU_81 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1426 external function dec_RAW_PDU_81(in octetstring stream) return RAW_PDU_81 with { extension "prototype(convert) decode(RAW)" }
1428 testcase TC_BITORDERINOCTET_msb_for_bitstring_8() runs on TempComp{
1429 const RAW_PDU_81 i := '00000011'B
1430 const octetstring o := 'C0'O
1431 if ((enc_RAW_PDU_81(i) == o)and(dec_RAW_PDU_81(o) == i )) {setverdict(pass);}
1432 else {setverdict(fail);}
1435 type bitstring RAW_PDU_82
1436 with { encode "RAW";
1437 variant "FIELDLENGTH(16)" ;
1438 variant "BITORDERINOCTET(lsb)"
1440 external function enc_RAW_PDU_82(in RAW_PDU_82 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1441 external function dec_RAW_PDU_82(in octetstring stream) return RAW_PDU_82 with { extension "prototype(convert) decode(RAW)" }
1443 testcase TC_BITORDERINOCTET_lsb_for_bitstring_16() runs on TempComp{
1444 const RAW_PDU_82 i := '0001111100110001'B
1445 const octetstring o := '311F'O
1446 if ((enc_RAW_PDU_82(i) == o)and(dec_RAW_PDU_82(o) == i )) {setverdict(pass);}
1447 else {setverdict(fail);}
1450 type bitstring RAW_PDU_83
1451 with { encode "RAW";
1452 variant "FIELDLENGTH(16)" ;
1453 variant "BITORDERINOCTET(msb)"
1455 external function enc_RAW_PDU_83(in RAW_PDU_83 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1456 external function dec_RAW_PDU_83(in octetstring stream) return RAW_PDU_83 with { extension "prototype(convert) decode(RAW)" }
1458 testcase TC_BITORDERINOCTET_msb_for_bitstring_16() runs on TempComp{
1459 const RAW_PDU_83 i := '0001111100110001'B
1460 const octetstring o := '8CF8'O
1461 if ((enc_RAW_PDU_83(i) == o)and(dec_RAW_PDU_83(o) == i )) {setverdict(pass);}
1462 else {setverdict(fail);}
1465 type enumerated RAW_PDU_84
1466 { zero, first, second, third, fourth, fifth, sixth , seventh, eight, nineth,
1468 with { encode "RAW";
1469 variant "FIELDLENGTH(4)" ;
1470 variant "BITORDERINOCTET (lsb) "
1473 external function enc_RAW_PDU_84(in RAW_PDU_84 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1474 external function dec_RAW_PDU_84(in octetstring stream) return RAW_PDU_84 with { extension "prototype(convert) decode(RAW)" }
1476 testcase TC_BITORDERINOCTET_lsb_for_enumerated() runs on TempComp{
1477 const RAW_PDU_84 i := first
1478 const octetstring o := '01'O
1479 if ((enc_RAW_PDU_84(i) == o)and(dec_RAW_PDU_84(o) == i )) {setverdict(pass);}
1480 else {setverdict(fail);}
1483 type enumerated RAW_PDU_85
1484 { zero, first, second, third, fourth, fifth, sixth , seventh, eight, nineth,
1486 with { encode "RAW";
1487 variant "FIELDLENGTH(8)" ;
1488 variant "BITORDERINOCTET (msb) "
1491 external function enc_RAW_PDU_85(in RAW_PDU_85 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1492 external function dec_RAW_PDU_85(in octetstring stream) return RAW_PDU_85 with { extension "prototype(convert) decode(RAW)" }
1494 testcase TC_BITORDERINOCTET_msb_for_enumerated() runs on TempComp{
1495 const RAW_PDU_85 i := first
1496 const octetstring o := '80'O
1498 if ((enc_RAW_PDU_85(i) == o)and(dec_RAW_PDU_85(o) == i )) {setverdict(pass);}
1499 else {setverdict(fail);}
1502 type hexstring RAW_PDU_86
1503 with { encode "RAW"; variant "BITORDERINOCTET(lsb)"};
1505 external function enc_RAW_PDU_86(in RAW_PDU_86 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1506 external function dec_RAW_PDU_86(in octetstring stream) return RAW_PDU_86 with { extension "prototype(convert) decode(RAW)" }
1508 testcase TC_BITORDERINOCTET_lsb_for_hexstring() runs on TempComp{
1509 const RAW_PDU_86 i := '1234'H
1510 const octetstring o := '2143'O
1511 if ((enc_RAW_PDU_86(i) == o)and(dec_RAW_PDU_86(o) == i )) {setverdict(pass);}
1512 else {setverdict(fail);}
1515 type hexstring RAW_PDU_87
1516 with { encode "RAW"; variant "BITORDERINOCTET(msb)"};
1518 external function enc_RAW_PDU_87(in RAW_PDU_87 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1519 external function dec_RAW_PDU_87(in octetstring stream) return RAW_PDU_87 with { extension "prototype(convert) decode(RAW)" }
1521 testcase TC_BITORDERINOCTET_msb_for_hexstring() runs on TempComp{
1522 const RAW_PDU_87 i := '1234'H
1523 const octetstring o := '84C2'O
1524 if ((enc_RAW_PDU_87(i) == o)and(dec_RAW_PDU_87(o) == i )) {setverdict(pass);}
1525 else {setverdict(fail);}
1528 type integer RAW_PDU_88
1529 with { encode "RAW";
1530 variant "FIELDLENGTH(8)" ;
1531 variant "COMP( nosign ) "
1533 external function enc_RAW_PDU_88(in RAW_PDU_88 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1534 external function dec_RAW_PDU_88(in octetstring stream) return RAW_PDU_88 with { extension "prototype(convert) decode(RAW)" }
1536 testcase TC_COMP_nosign_for_positive_integer_8() runs on TempComp{
1537 const RAW_PDU_88 i := 2
1538 const octetstring o := '02'O
1539 if ((enc_RAW_PDU_88(i) == o)and(dec_RAW_PDU_88(o) == i )) {setverdict(pass);}
1540 else {setverdict(fail);}
1543 type integer RAW_PDU_89
1544 with { encode "RAW";
1545 variant "FIELDLENGTH(8)" ;
1546 variant "COMP( signbit ) "
1548 external function enc_RAW_PDU_89(in RAW_PDU_89 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1549 external function dec_RAW_PDU_89(in octetstring stream) return RAW_PDU_89 with { extension "prototype(convert) decode(RAW)" }
1551 testcase TC_COMP_signbit_for_positive_integer_8() runs on TempComp{
1552 const RAW_PDU_89 i := 2
1553 const octetstring o := '02'O
1554 if ((enc_RAW_PDU_89(i) == o)and(dec_RAW_PDU_89(o) == i )) {setverdict(pass);}
1555 else {setverdict(fail);}
1558 testcase TC_COMP_signbit_for_negative_integer_8() runs on TempComp{
1559 const RAW_PDU_89 i := -2
1560 const octetstring o := '82'O
1561 if ((enc_RAW_PDU_89(i) == o)and(dec_RAW_PDU_89(o) == i )) {setverdict(pass);}
1562 else {setverdict(fail);}
1565 type integer RAW_PDU_90
1566 with { encode "RAW";
1567 variant "FIELDLENGTH(8)" ;
1568 variant "COMP( 2scompl ) "
1571 external function enc_RAW_PDU_90(in RAW_PDU_90 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1572 external function dec_RAW_PDU_90(in octetstring stream) return RAW_PDU_90 with { extension "prototype(convert) decode(RAW)" }
1574 testcase TC_COMP_2scompl_for_positive_integer_8() runs on TempComp{
1575 const RAW_PDU_90 i := 2
1576 const octetstring o := '02'O
1577 if ((enc_RAW_PDU_90(i) == o)and(dec_RAW_PDU_90(o) == i )) {setverdict(pass);}
1578 else {setverdict(fail);}
1581 testcase TC_COMP_2scompl_for_negative_integer_8() runs on TempComp{
1582 const RAW_PDU_90 i := -2
1583 const octetstring o := 'FE'O
1584 if ((enc_RAW_PDU_90(i) == o)and(dec_RAW_PDU_90(o) == i )) {setverdict(pass);}
1585 else {setverdict(fail);}
1588 // PADDING for integer
1592 type record RAW_PDU_91
1597 with { variant (int3) "FIELDLENGTH (4)" ;
1598 variant (int1) "PADDING( yes ) " ;
1599 variant (int2) "FIELDLENGTH (4)" ;
1600 variant (int2) "PADDING( yes ) " ;
1601 variant (int3) "FIELDLENGTH (4)" ;
1602 variant (int3) "PADDING( no ) " ;
1603 variant (int4) "FIELDLENGTH (4)" ;
1604 variant (int4) "PADDING( no ) " ; }
1605 } with {encode "RAW" };
1607 external function enc_RAW_PDU_91(in RAW_PDU_91 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1608 external function dec_RAW_PDU_91(in octetstring stream) return RAW_PDU_91 with { extension "prototype(convert) decode(RAW)" }
1610 testcase TC_PADDING_for_integer() runs on TempComp{
1619 const octetstring o := '010243'O
1621 if ((enc_RAW_PDU_91(i) == o)and(dec_RAW_PDU_91(o) == i )) {setverdict(pass);}
1622 else {setverdict(fail);}
1625 // PADDING for bitstring
1628 type record RAW_PDU_92
1633 with { variant (bit1) "FIELDLENGTH(4)" ;
1634 variant (bit1) "PADDING( yes ) " ;
1635 variant (bit2) "FIELDLENGTH(4)" ;
1636 variant (bit2) "PADDING( yes ) " ;
1637 variant (bit3) "FIELDLENGTH(4)" ;
1638 variant (bit3) "PADDING( no ) " ;
1639 variant (bit4) "FIELDLENGTH(4)" ;
1640 variant (bit4) "PADDING( no ) " ;
1642 } with {encode "RAW"}
1645 external function enc_RAW_PDU_92(in RAW_PDU_92 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1646 external function dec_RAW_PDU_92(in octetstring stream) return RAW_PDU_92 with { extension "prototype(convert) decode(RAW)" }
1648 testcase TC_PADDING_for_bitstring() runs on TempComp{
1651 i := { bit1 := '0001'B ,
1655 const octetstring o := '010243'O;
1657 if ((enc_RAW_PDU_92(i) == o)and(dec_RAW_PDU_92(o) == i )) {setverdict(pass);}
1658 else {setverdict(fail);}
1661 // PADDING for enumerated
1665 type enumerated enumerated1
1666 { zero, first, second, third, fourth, fifth }
1668 type enumerated enumerated2
1669 { tenth, eleventh, twelfth, thirteenth, fourthteenth, fifteenth }
1671 type enumerated enumerated3
1672 { twenty, twentyfirst, twentysecond, twentythird, twentyfourth, twentyfifth }
1674 type enumerated enumerated4
1675 { thirty, thirtyfirst, thirtysecond, thirtythird, thirtyfourth, thirtyfifth }
1678 type record RAW_PDU_93
1679 { enumerated1 enum1 ,
1683 with { variant (enum1) "FIELDLENGTH(4)" ;
1684 variant (enum1) "PADDING( yes ) " ;
1685 variant (enum2) "FIELDLENGTH(4)" ;
1686 variant (enum2) "PADDING( yes ) " ;
1687 variant (enum3) "FIELDLENGTH(4)" ;
1688 variant (enum3) "PADDING( no ) " ;
1689 variant (enum4) "FIELDLENGTH(4)" ;
1690 variant (enum4) "PADDING( no ) " ;
1692 } with {encode "RAW" };
1694 external function enc_RAW_PDU_93(in RAW_PDU_93 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1695 external function dec_RAW_PDU_93(in octetstring stream) return RAW_PDU_93 with { extension "prototype(convert) decode(RAW)" }
1697 testcase TC_PADDING_for_enumerated() runs on TempComp{
1699 i := { enum1 := first ,
1701 enum3 := twentythird ,
1702 enum4 := thirtyfourth }
1704 const octetstring o := '010243'O
1706 if ((enc_RAW_PDU_93(i) == o)and(dec_RAW_PDU_93(o) == i )) {setverdict(pass);}
1707 else {setverdict(fail);}
1710 // PADDING for hexstring
1714 type record RAW_PDU_94
1719 with { encode "RAW";
1720 variant (hex1) "FIELDLENGTH(1)" ;
1721 variant (hex1) "PADDING( yes ) " ;
1722 variant (hex2) "FIELDLENGTH(1)" ;
1723 variant (hex2) "PADDING( yes ) " ;
1724 variant (hex3) "FIELDLENGTH(1)" ;
1725 variant (hex3) "PADDING( no ) " ;
1726 variant (hex4) "FIELDLENGTH(1)" ;
1727 variant (hex4) "PADDING( no ) " ;
1729 } with {encode "RAW" }
1731 external function enc_RAW_PDU_94(in RAW_PDU_94 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1732 external function dec_RAW_PDU_94(in octetstring stream) return RAW_PDU_94 with { extension "prototype(convert) decode(RAW)" }
1734 testcase TC_PADDING_for_hexstring() runs on TempComp{
1736 i := { hex1 := '1'H ,
1741 const octetstring o := '010243'O
1743 if ((enc_RAW_PDU_94(i) == o)and(dec_RAW_PDU_94(o) == i )) {setverdict(pass);}
1744 else {setverdict(fail);}
1747 // PREPADDING(yes) for bitstring
1749 type bitstring RAW_PDU_95 length (3)
1750 with {encode "RAW"; variant "PREPADDING(yes)"}
1752 external function enc_RAW_PDU_95(in RAW_PDU_95 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1753 external function dec_RAW_PDU_95(in octetstring stream) return RAW_PDU_95 with { extension "prototype(convert) decode(RAW)" }
1755 testcase TC_PREPADDING_yes_for_bitstring() runs on TempComp{
1756 const RAW_PDU_95 i := '101'B
1757 const octetstring o := '05'O
1759 if ((enc_RAW_PDU_95(i) == o)and(dec_RAW_PDU_95(o) == i )) {setverdict(pass);}
1760 else {setverdict(fail);}
1763 // PREPADDING(yes) for hexstring
1765 type hexstring RAW_PDU_96 length (1)
1766 with {encode "RAW"; variant "PREPADDING(yes)"}
1768 external function enc_RAW_PDU_96(in RAW_PDU_96 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1769 external function dec_RAW_PDU_96(in octetstring stream) return RAW_PDU_96 with { extension "prototype(convert) decode(RAW)" }
1771 testcase TC_PREPADDING_yes_for_hexstring() runs on TempComp{
1772 const RAW_PDU_96 i := 'F'H
1773 const octetstring o := '0F'O
1775 if ((enc_RAW_PDU_96(i) == o)and(dec_RAW_PDU_96(o) == i )) {setverdict(pass);}
1776 else {setverdict(fail);}
1779 // PREPADDING(word16) for octetstring
1781 type octetstring otype1
1782 with {encode "RAW"; variant "PREPADDING(word16)"}
1783 type hexstring htype1 length (3)
1784 type record RAW_PDU_97 { htype1 h, otype1 o}
1785 with {encode "RAW"; variant ""}
1787 external function enc_RAW_PDU_97(in RAW_PDU_97 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1788 external function dec_RAW_PDU_97(in octetstring stream) return RAW_PDU_97 with { extension "prototype(convert) decode(RAW)" }
1790 testcase TC_PREPADDING_word16_for_octetstring() runs on TempComp{
1791 const RAW_PDU_97 i := {'AAA'H,'FF'O}
1792 const octetstring o := 'AA0AFF'O
1794 if ((enc_RAW_PDU_97(i) == o)and(dec_RAW_PDU_97(o) == i )) {setverdict(pass);}
1795 else {setverdict(fail);}
1798 // PREPADDING(word16) for record of
1801 with {encode "RAW"; variant "FIELDLENGTH(3)"}
1802 type record length (1) of itype1 rtype1
1803 with {encode "RAW"; variant "PREPADDING(word16)"}
1805 type record RAW_PDU_98 {itype1 r1, rtype1 r2}
1806 with {encode "RAW"; variant ""}
1808 external function enc_RAW_PDU_98(in RAW_PDU_98 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1809 external function dec_RAW_PDU_98(in octetstring stream) return RAW_PDU_98 with { extension "prototype(convert) decode(RAW)" }
1811 testcase TC_PREPADDING_word16_for_record_of() runs on TempComp{
1812 const RAW_PDU_98 i := {4,{7}}
1813 const octetstring o := '040007'O
1815 if ((enc_RAW_PDU_98(i) == o)and(dec_RAW_PDU_98(o) == i )) {setverdict(pass);}
1816 else {setverdict(fail);}
1819 // PREPADDING(dword32) for set of
1820 type bitstring BIT3 length (3)
1821 type record length (2) of BIT3 rtype2
1822 with {encode "RAW"; variant "PREPADDING(dword32)"}
1824 type record RAW_PDU_99 {BIT3 r1, rtype2 r2}
1825 with {encode "RAW"; variant ""}
1827 external function enc_RAW_PDU_99(in RAW_PDU_99 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1828 external function dec_RAW_PDU_99(in octetstring stream) return RAW_PDU_99 with { extension "prototype(convert) decode(RAW)" }
1830 testcase TC_PREPADDING_dword32_for_set_of() runs on TempComp{
1831 const RAW_PDU_99 i := {'100'B,{'111'B, '101'B}}
1832 const octetstring o := '040000002F'O
1834 if ((enc_RAW_PDU_99(i) == o)and(dec_RAW_PDU_99(o) == i )) {setverdict(pass);}
1835 else {setverdict(fail);}
1838 // PREPADDING(dword32) for record
1840 //type bitstring BIT3 length (3)
1842 type record stype1 {BIT3 s1, BIT3 s2}
1843 with {encode "RAW"; variant "PREPADDING(dword32)"}
1845 type record RAW_PDU_100 {stype1 r1, stype1 r2, stype1 r3}
1846 with {encode "RAW"; variant ""}
1848 external function enc_RAW_PDU_100(in RAW_PDU_100 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1849 external function dec_RAW_PDU_100(in octetstring stream) return RAW_PDU_100 with { extension "prototype(convert) decode(RAW)" }
1851 testcase TC_PREPADDING_dword32_for_record() runs on TempComp{
1852 const RAW_PDU_100 i := {{'111'B,'111'B},{'110'B,'000'B},{'111'B,'111'B}}
1853 const octetstring o := '3F000000060000003F'O
1855 if ((enc_RAW_PDU_100(i) == o)and(dec_RAW_PDU_100(o) == i )) {setverdict(pass);}
1856 else {setverdict(fail);}
1859 // PREPADDING(word16) for set
1861 //type bitstring BIT3 length (3)
1863 type set stype2 {BIT3 s1}
1864 with {encode "RAW"; variant "PREPADDING(word16)"}
1866 type record RAW_PDU_101 {stype2 r1, stype2 r2, stype2 r3}
1867 with {encode "RAW"; variant ""}
1869 external function enc_RAW_PDU_101(in RAW_PDU_101 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1870 external function dec_RAW_PDU_101(in octetstring stream) return RAW_PDU_101 with { extension "prototype(convert) decode(RAW)" }
1872 testcase TC_PREPADDING_word16_for_set() runs on TempComp{
1873 const RAW_PDU_101 i := {{s1:='111'B},{s1:='110'B},{s1:='111'B}}
1874 const octetstring o := '0700060007'O
1876 if ((enc_RAW_PDU_101(i) == o)and(dec_RAW_PDU_101(o) == i )) {setverdict(pass);}
1877 else {setverdict(fail);}
1880 // PREPADDING(word16) for union
1882 type hexstring HEX1 length (1)
1884 type union utype1 {BIT3 u1, HEX1 u2}
1885 with {encode "RAW"; variant "PREPADDING(word16)"}
1887 type record RAW_PDU_102 {utype1 r1, utype1 r2, utype1 r3}
1888 with {encode "RAW"; variant ""}
1890 external function enc_RAW_PDU_102(in RAW_PDU_102 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1891 external function dec_RAW_PDU_102(in octetstring stream) return RAW_PDU_102 with { extension "prototype(convert) decode(RAW)" }
1893 testcase TC_PREPADDING_word16_for_union() runs on TempComp{
1894 const RAW_PDU_102 i := {{u1:='111'B},{u1:='010'B},{u1:='111'B}}
1895 const octetstring o := '0700020007'O
1897 if ((enc_RAW_PDU_102(i) == o)and(dec_RAW_PDU_102(o) == i )) {setverdict(pass);}
1898 else {setverdict(fail);}
1901 // PADDING_PATTERN for record of
1904 with {encode "RAW"; variant "FIELDLENGTH(3)"}
1905 type record length (1) of itype2 rtype
1906 with {encode "RAW"; variant "PREPADDING(yes), PADDING_PATTERN('1'B)"}
1908 type record RAW_PDU_103 {itype2 r1, rtype r2}
1909 with {encode "RAW"; variant ""}
1911 external function enc_RAW_PDU_103(in RAW_PDU_103 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1912 external function dec_RAW_PDU_103(in octetstring stream) return RAW_PDU_103 with { extension "prototype(convert) decode(RAW)" }
1914 testcase TC_PADDING_PATTERN_for_record_of() runs on TempComp{
1915 const RAW_PDU_103 i := {4,{7}};
1916 const octetstring o := 'FC07'O;
1918 if ((enc_RAW_PDU_103(i) == o)and(dec_RAW_PDU_103(o) == i )) {setverdict(pass);}
1919 else {setverdict(fail);}
1922 // PADDING_PATTERN for set of:
1923 type set length (2) of BIT3 rtype3
1924 with {encode "RAW"; variant "PREPADDING(yes), PADDING_PATTERN('10000'B)"}
1926 type record RAW_PDU_104 {BIT3 r1, rtype3 r2}
1927 with {encode "RAW"; variant ""}
1929 external function enc_RAW_PDU_104(in RAW_PDU_104 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1930 external function dec_RAW_PDU_104(in octetstring stream) return RAW_PDU_104 with { extension "prototype(convert) decode(RAW)" }
1932 testcase TC_PADDING_PATTERN_for_set_of() runs on TempComp{
1933 const RAW_PDU_104 i := {'100'B,{'111'B, '101'B}}
1934 const octetstring o := '842F'O
1936 if ((enc_RAW_PDU_104(i) == o)and(dec_RAW_PDU_104(o) == i )) {setverdict(pass);}
1937 else {setverdict(fail);}
1940 // PADDING_PATTERN for record:
1942 type bitstring BIT9 length (9)
1944 type record stype3 {BIT9 s1, BIT9 s2}
1945 with {encode "RAW"; variant "PREPADDING(40), PADDING_PATTERN('100000'B)"}
1947 type record RAW_PDU_105 {stype3 r1, stype3 r2, stype3 r3}
1948 with {encode "RAW"; variant ""}
1950 external function enc_RAW_PDU_105(in RAW_PDU_105 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1951 external function dec_RAW_PDU_105(in octetstring stream) return RAW_PDU_105 with { extension "prototype(convert) decode(RAW)" }
1953 testcase TC_PADDING_PATTERN_for_record() runs on TempComp{
1954 const RAW_PDU_105 i := {{'111000111'B,'111000111'B},{'111111111'B,'111111111'B},{'111000111'B,'111000111'B}};
1955 const octetstring o := 'C78F832008FFFF832008C78F03'O ;
1957 if ((enc_RAW_PDU_105(i) == o)and(dec_RAW_PDU_105(o) == i )) {setverdict(pass);}
1958 else {setverdict(fail);}
1961 //PADDING_PATTERN for set
1962 type hexstring HEX3 length (3)
1963 type set stype4 {HEX3 s1}
1964 with {encode "RAW"; variant "PREPADDING(15), PADDING_PATTERN('10001'B)"}
1966 type record RAW_PDU_106 {stype4 r1, stype4 r2, stype4 r3}
1967 with {encode "RAW"; variant ""}
1969 external function enc_RAW_PDU_106(in RAW_PDU_106 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1970 external function dec_RAW_PDU_106(in octetstring stream) return RAW_PDU_106 with { extension "prototype(convert) decode(RAW)" }
1972 testcase TC_PADDING_PATTERN_for_set() runs on TempComp{
1973 const RAW_PDU_106 i := {{s1:='FFF'H},{s1:='FFF'H},{s1:='FFF'H}}
1974 const octetstring o := 'FF9FFFCFFF03'O
1976 if ((enc_RAW_PDU_106(i) == o)and(dec_RAW_PDU_106(o) == i )) {setverdict(pass);}
1977 else {setverdict(fail);}
1980 // PADDING_PATTERN for union:
1981 type octetstring OCT2 length (2)
1983 type union utype2 {OCT2 u1, hexstring u2}
1984 with {encode "RAW"; variant "PREPADDING(256),PADDING_PATTERN('11001'B)"}
1986 type record RAW_PDU_107 {utype2 r1, utype2 r2, utype2 r3}
1987 with {encode "RAW"; variant ""}
1989 external function enc_RAW_PDU_107(in RAW_PDU_107 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
1990 external function dec_RAW_PDU_107(in octetstring stream) return RAW_PDU_107 with { extension "prototype(convert) decode(RAW)" }
1992 testcase TC_PADDING_PATTERN_for_union() runs on TempComp{
1993 const RAW_PDU_107 i := {{u1:='AABB'O},{u1:='CCDD'O},{u1:='EEFF'O}}
1994 const octetstring o := 'AABB39E79C73CE39E79C73CE39E79C73CE39E79C73CE39E79C73CE39E79C73CECCDD39E79C73CE39E79C73CE39E79C73CE39E79C73CE39E79C73CE39E79C73CEEEFF'O
1996 if ((enc_RAW_PDU_107(i) == o)and(dec_RAW_PDU_107(o) == i )) {setverdict(pass);}
1997 else {setverdict(fail);}
2000 // PADDALL with PADDING Attribute - record
2001 type bitstring BIT1 length (1)
2003 type record stype5 {BIT1 s1, BIT1 s2}
2004 with {encode "RAW"; variant "PADDING(yes), PADDALL"}
2006 type record RAW_PDU_108 {stype5 r1, stype5 r2, stype5 r3}
2007 with {encode "RAW"; variant ""}
2009 external function enc_RAW_PDU_108(in RAW_PDU_108 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2010 external function dec_RAW_PDU_108(in octetstring stream) return RAW_PDU_108 with { extension "prototype(convert) decode(RAW)" }
2012 testcase TC_PADDALL_with_PADDING_Attribute_record() runs on TempComp{
2013 const RAW_PDU_108 i := {{'1'B,'1'B},{'1'B,'1'B},{'1'B,'1'B}};
2014 const octetstring o := '010101010101'O;
2016 if ((enc_RAW_PDU_108(i) == o)and(dec_RAW_PDU_108(o) == i )) {setverdict(pass);}
2017 else {setverdict(fail);}
2020 //PADDALL with PADDING Attribute - set
2022 //type bitstring BIT3 length (3)
2024 type set stype6 {BIT3 s1, BIT3 s2}
2025 with {encode "RAW"; variant "PADDING(4), PADDALL"}
2027 type set RAW_PDU_109 {stype6 r1, stype6 r2}
2028 with {encode "RAW"; variant "PADDING(dword32), PADDALL"}
2030 external function enc_RAW_PDU_109(in RAW_PDU_109 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2031 external function dec_RAW_PDU_109(in octetstring stream) return RAW_PDU_109 with { extension "prototype(convert) decode(RAW)" }
2033 testcase TC_PADDALL_with_PADDING_Attribute_set() runs on TempComp{
2034 const RAW_PDU_109 i := {r1:={s1:='111'B,s2:='101'B},r2:={s1:='111'B,s2:='101'B}}
2035 const octetstring o := '57570000'O;
2037 if ((enc_RAW_PDU_109(i) == o)and(dec_RAW_PDU_109(o) == i )) {setverdict(pass);}
2038 else {setverdict(fail);}
2041 // PADDALL with PREPADDING Attribute - record
2043 //type hexstring HEX1 length (1)
2045 type record stype7 {HEX1 s1, HEX1 s2}
2047 type record RAW_PDU_110 {stype7 r1, stype7 r2, stype7 r3}
2048 with {encode "RAW"; variant "PREPADDING(12), PADDALL"}
2050 external function enc_RAW_PDU_110(in RAW_PDU_110 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2051 external function dec_RAW_PDU_110(in octetstring stream) return RAW_PDU_110 with { extension "prototype(convert) decode(RAW)" }
2053 testcase TC_PADDALL_with_PREPADDING_Attribute_record() runs on TempComp{
2054 const RAW_PDU_110 i := {{'A'H,'B'H},{'A'H,'B'H},{'A'H,'B'H}}
2055 const octetstring o := 'BAA00BBA'O
2057 if ((enc_RAW_PDU_110(i) == o)and(dec_RAW_PDU_110(o) == i )) {setverdict(pass);}
2058 else {setverdict(fail);}
2061 // PADDALL with PREPADDING Attribute - set
2062 //type hexstring HEX1 length (1)
2064 type set stype8 {HEX1 s1, HEX1 s2, HEX1 s3}
2065 with {encode "RAW"; variant "PREPADDING(12), PADDALL"}
2067 type set RAW_PDU_111 {stype8 r1, stype8 r2}
2068 with {encode "RAW"; variant "PREPADDING(36), PADDALL, PADDING_PATTERN('1111'B)"}
2070 external function enc_RAW_PDU_111(in RAW_PDU_111 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2071 external function dec_RAW_PDU_111(in octetstring stream) return RAW_PDU_111 with { extension "prototype(convert) decode(RAW)" }
2073 testcase TC_PADDALL_with_PREPADDING_Attribute_set() runs on TempComp{
2074 const RAW_PDU_111 i := { r1:={s1:='A'H,s2:='B'H,s3:='C'H},
2075 r2:={s1:='A'H,s2:='B'H,s3:='C'H}}
2076 const octetstring o := '0AB000FCAF000BC0'O
2078 if ((enc_RAW_PDU_111(i) == o)and(dec_RAW_PDU_111(o) == i )) {setverdict(pass);}
2079 else {setverdict(fail);}
2082 //==== Testing PTROFFSET Attribute ===
2084 // PTROFFSET is set to default base
2085 type bitstring BIT4 length (4)
2086 //type hexstring HEX1 length (1)
2087 type octetstring OCT3 length (3)
2092 with {variant "FIELDLENGTH(8)" };
2094 type record RAW_PDU_112 {
2100 with { variant (ptr1) "POINTERTO(field1)";
2101 variant (ptr1) "UNIT(1)";
2102 variant (ptr1) "PTROFFSET(ptr1)";
2103 variant (ptr2) "POINTERTO(field2)";
2104 variant (ptr2) "UNIT(1)"
2105 variant (ptr2) "PTROFFSET(ptr2)"}
2107 } with {encode "RAW" };
2109 external function enc_RAW_PDU_112(in RAW_PDU_112 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2110 external function dec_RAW_PDU_112(in octetstring stream) return RAW_PDU_112 with { extension "prototype(convert) decode(RAW)" }
2112 testcase TC_PTROFFSET_is_set_to_default_base() runs on TempComp{
2113 const RAW_PDU_112 i := {16,12,'0110'B,'1001'B}
2114 const octetstring o := '100C96'O
2116 if ((enc_RAW_PDU_112(i) == o)and(dec_RAW_PDU_112(o) == i )) {setverdict(pass);}
2117 else {setverdict(fail);}
2120 // PTROFFSET is set to the beginning of record
2122 //type bitstring BIT3 length (3)
2123 //type hexstring HEX1 length (1)
2124 //type octetstring OCT3 length (3)
2129 //with { encode "RAW"; variant "FIELDLENGTH(8)" };
2132 type record RAW_PDU_113 {
2141 with { variant (ptr1) "POINTERTO(field1)";
2142 variant (ptr1) "UNIT(1)";
2143 variant (ptr1) "PTROFFSET(ptr1)";
2144 variant (ptr2) "POINTERTO(field2)";
2145 variant (ptr2) "UNIT(1)";
2146 variant (ptr2) "PTROFFSET(ptr1)";
2147 variant (ptr3) "POINTERTO(field3)";
2148 variant (ptr3) "UNIT(1)";
2149 variant (ptr3) "PTROFFSET(ptr1)"}
2151 } with {encode "RAW" };
2153 external function enc_RAW_PDU_113(in RAW_PDU_113 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2154 external function dec_RAW_PDU_113(in octetstring stream) return RAW_PDU_113 with { extension "prototype(convert) decode(RAW)" }
2156 testcase TC_PTROFFSET_is_set_to_the_beginning_of_record() runs on TempComp{
2157 const RAW_PDU_113 i := {24,27,31,'111'B,'A'H,'010203'O}
2158 const octetstring o := '181B1FD7008101'O
2160 if ((enc_RAW_PDU_113(i) == o)and(dec_RAW_PDU_113(o) == i )) {setverdict(pass);}
2161 else {setverdict(fail);}
2164 // PTROFFSET is set to data field
2166 //type bitstring BIT3 length (3)
2167 //type hexstring HEX1 length (1)
2168 //type octetstring OCT3 length (3)
2173 //with { variant "FIELDLENGTH(8)" };
2176 type record RAW_PDU_114 {
2185 with { variant (ptr1) "POINTERTO(field1)";
2186 variant (ptr1) "UNIT(1)";
2187 variant (ptr1) "PTROFFSET(field1)";
2188 variant (ptr2) "POINTERTO(field2)";
2189 variant (ptr2) "UNIT(1)";
2190 variant (ptr2) "PTROFFSET(field1)";
2191 variant (ptr3) "POINTERTO(field3)";
2192 variant (ptr3) "UNIT(1)";
2193 variant (ptr3) "PTROFFSET(field1)"}
2195 } with {encode "RAW" };
2197 external function enc_RAW_PDU_114(in RAW_PDU_114 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2198 external function dec_RAW_PDU_114(in octetstring stream) return RAW_PDU_114 with { extension "prototype(convert) decode(RAW)" }
2200 testcase TC_PTROFFSET_is_set_to_data_field() runs on TempComp{
2201 const RAW_PDU_114 i := {0,3,7,'111'B,'A'H,'010203'O}
2202 const octetstring o := '000307D7008101'O
2204 if ((enc_RAW_PDU_114(i) == o)and(dec_RAW_PDU_114(o) == i )) {setverdict(pass);}
2205 else {setverdict(fail);}
2208 // ==== Testing HEXORDER Attribute ===
2210 //HEXORDER(low) for hexstring
2211 type hexstring RAW_PDU_115
2212 with { encode "RAW"; variant "HEXORDER(low)"};
2214 external function enc_RAW_PDU_115(in RAW_PDU_115 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2215 external function dec_RAW_PDU_115(in octetstring stream) return RAW_PDU_115 with { extension "prototype(convert) decode(RAW)" }
2217 testcase TC_HEXORDER_low_for_hexstring() runs on TempComp{
2218 const RAW_PDU_115 i := '1234567890'H
2219 const octetstring o := '2143658709'O
2221 if ((enc_RAW_PDU_115(i) == o)and(dec_RAW_PDU_115(o) == i )) {setverdict(pass);}
2222 else {setverdict(fail);}
2225 //HEXORDER(high) for hexstring
2227 type hexstring RAW_PDU_116
2228 with { encode "RAW"; variant "HEXORDER(high)"};
2230 external function enc_RAW_PDU_116(in RAW_PDU_116 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2231 external function dec_RAW_PDU_116(in octetstring stream) return RAW_PDU_116 with { extension "prototype(convert) decode(RAW)" }
2233 testcase TC_HEXORDER_high_for_hexstring() runs on TempComp{
2234 const RAW_PDU_116 i := '1234567890'H
2235 const octetstring o := '1234567890'O
2237 if ((enc_RAW_PDU_116(i) == o)and(dec_RAW_PDU_116(o) == i )) {setverdict(pass);}
2238 else {setverdict(fail);}
2241 // EXTENSION_BIT(no) for octetstring
2243 type octetstring RAW_PDU_117n
2244 with { encode "RAW"; variant "EXTENSION_BIT(no)"};
2246 external function enc_RAW_PDU_117n(in RAW_PDU_117n pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2247 external function dec_RAW_PDU_117n(in octetstring stream) return RAW_PDU_117n with { extension "prototype(convert) decode(RAW)" }
2249 testcase TC_EXTENSION_BIT_no_for_octetstring() runs on TempComp{
2250 const RAW_PDU_117n i := '1234567890'O
2251 const octetstring o := '1234567890'O
2253 if ((enc_RAW_PDU_117n(i) == o)and(dec_RAW_PDU_117n(o) == i )) {setverdict(pass);}
2254 else {setverdict(fail);}
2257 // EXTENSION_BIT(yes) for octetstring
2259 type octetstring RAW_PDU_117
2260 with { encode "RAW"; variant "EXTENSION_BIT(yes)"};
2262 external function enc_RAW_PDU_117(in RAW_PDU_117 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2263 external function dec_RAW_PDU_117(in octetstring stream) return RAW_PDU_117 with { extension "prototype(convert) decode(RAW)" }
2265 testcase TC_EXTENSION_BIT_yes_for_octetstring() runs on TempComp{
2266 const RAW_PDU_117 i := '010203040500'O
2267 const octetstring o := '010203040580'O
2269 if ((enc_RAW_PDU_117(i) == o)and(dec_RAW_PDU_117(o) == '010203040580'O )) {setverdict(pass);}
2270 else {setverdict(fail);}
2273 // EXTENSION_BIT(reverse) for octetstring
2275 type octetstring RAW_PDU_118
2276 with { encode "RAW"; variant "EXTENSION_BIT(reverse)"};
2278 external function enc_RAW_PDU_118(in RAW_PDU_118 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2279 external function dec_RAW_PDU_118(in octetstring stream) return RAW_PDU_118 with { extension "prototype(convert) decode(RAW)" }
2281 testcase TC_EXTENSION_BIT_reverse_for_octetstring() runs on TempComp{
2282 const RAW_PDU_118 i := '010203040500'O
2283 const octetstring o := '818283848500'O
2285 if ((enc_RAW_PDU_118(i) == o)and(dec_RAW_PDU_118(o) == '818283848500'O )) {setverdict(pass);}
2286 else {setverdict(fail);}
2289 // EXTENSION_BIT(yes) for record of octetstring
2291 type octetstring OCT1
2292 with { encode "RAW"; variant "FIELDLENGTH(1)"};
2294 type record of OCT1 RAW_PDU_119
2295 with { encode "RAW"; variant "EXTENSION_BIT(yes)"};
2297 external function enc_RAW_PDU_119(in RAW_PDU_119 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2298 external function dec_RAW_PDU_119(in octetstring stream) return RAW_PDU_119 with { extension "prototype(convert) decode(RAW)" }
2300 testcase TC_EXTENSION_BIT_yes_for_record_of_octetstring() runs on TempComp{
2301 const RAW_PDU_119 i := {'84'O, '00'O}
2302 const octetstring o := '0480'O
2304 if ((enc_RAW_PDU_119(i) == o)) {setverdict(pass);}
2305 else {setverdict(fail);}
2308 // EXTENSION_BIT(reverse) for record of octetstring
2309 //type octetstring OCT1
2310 //with { encode "RAW"; variant "FIELDLENGTH(1)"};
2312 type record of OCT1 RAW_PDU_119r
2313 with { encode "RAW"; variant "EXTENSION_BIT(reverse)"};
2315 external function enc_RAW_PDU_119r(in RAW_PDU_119r pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2316 external function dec_RAW_PDU_119r(in octetstring stream) return RAW_PDU_119r with { extension "prototype(convert) decode(RAW)" }
2318 testcase TC_EXTENSION_BIT_reverse_for_record_of_octetstring() runs on TempComp{
2319 const RAW_PDU_119r i := {'80'O}
2320 const octetstring o := '00'O
2322 if ((enc_RAW_PDU_119r(i) == o)and(dec_RAW_PDU_119r(o) == i )) {setverdict(pass);}
2323 else {setverdict(fail);}
2326 // EXTENSION_BIT(no) for record of octetstring
2327 //type octetstring OCT1
2328 //with { encode "RAW"; variant "FIELDLENGTH(1)"};
2330 type record of OCT1 RAW_PDU_120
2331 with { encode "RAW"; variant "EXTENSION_BIT(no)"};
2333 external function enc_RAW_PDU_120(in RAW_PDU_120 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2334 external function dec_RAW_PDU_120(in octetstring stream) return RAW_PDU_120 with { extension "prototype(convert) decode(RAW)" }
2336 testcase TC_EXTENSION_BIT_no_for_record_of_octetstring() runs on TempComp{
2337 const RAW_PDU_120 i := {'84'O, '05'O}
2338 const octetstring o := '8405'O
2340 if ((enc_RAW_PDU_120(i) == o)and(dec_RAW_PDU_120(o) == i )) {setverdict(pass);}
2341 else {setverdict(fail);}
2344 // EXTENSION_BIT(yes) for record of bitstring
2346 type bitstring BIT3_
2347 with { encode "RAW"; variant "FIELDLENGTH(3)"};
2349 type record of BIT3_ RAW_PDU_121
2350 with { encode "RAW"; variant "EXTENSION_BIT(yes)"};
2352 external function enc_RAW_PDU_121(in RAW_PDU_121 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2353 external function dec_RAW_PDU_121(in octetstring stream) return RAW_PDU_121 with { extension "prototype(convert) decode(RAW)" }
2355 testcase TC_EXTENSION_BIT_yes_for_record_of_bitstring() runs on TempComp{
2356 const RAW_PDU_121 i := {'111'B, '000'B, '111'B}
2357 const octetstring o := 'C301'O
2359 if ((enc_RAW_PDU_121(i) == o)) {setverdict(pass);}
2360 else {setverdict(fail);}
2363 //EXTENSION_BIT(reverse) for record of bitstring
2365 //type bitstring BIT3
2366 //with { encode "RAW"; variant "FIELDLENGTH(3)"};
2368 type record of BIT3_ RAW_PDU_122
2369 with { encode "RAW"; variant "EXTENSION_BIT(reverse)"};
2371 external function enc_RAW_PDU_122(in RAW_PDU_122 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2372 external function dec_RAW_PDU_122(in octetstring stream) return RAW_PDU_122 with { extension "prototype(convert) decode(RAW)" }
2374 testcase TC_EXTENSION_BIT_reverse_for_record_of_bitstring() runs on TempComp{
2375 const RAW_PDU_122 i := {'111'B, '000'B, '111'B}
2376 const octetstring o := 'E700'O
2378 if ((enc_RAW_PDU_122(i) == o)) {setverdict(pass);}
2379 else {setverdict(fail);}
2382 // EXTENSION_BIT(yes) for set of bitstring
2384 type set of BIT3 RAW_PDU_123
2385 with { encode "RAW"; variant "EXTENSION_BIT(yes)"};
2387 external function enc_RAW_PDU_123(in RAW_PDU_123 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2388 external function dec_RAW_PDU_123(in octetstring stream) return RAW_PDU_123 with { extension "prototype(convert) decode(RAW)" }
2390 testcase TC_EXTENSION_BIT_yes_for_set_of_bitstring() runs on TempComp{
2391 const RAW_PDU_123 i := {'111'B, '000'B, '111'B}
2392 const octetstring o := 'C301'O
2394 if ((enc_RAW_PDU_123(i) == o)) {setverdict(pass);}
2395 else {setverdict(fail);}
2398 // EXTENSION_BIT(reverse) for set of bitstring
2400 type set of BIT3 RAW_PDU_124
2401 with { encode "RAW"; variant "EXTENSION_BIT(reverse)"};
2403 external function enc_RAW_PDU_124(in RAW_PDU_124 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2404 external function dec_RAW_PDU_124(in octetstring stream) return RAW_PDU_124 with { extension "prototype(convert) decode(RAW)" }
2406 testcase TC_EXTENSION_BIT_reverse_for_set_of_bitstring() runs on TempComp{
2407 const RAW_PDU_124 i := {'111'B, '000'B, '111'B}
2408 const octetstring o := 'E700'O
2410 if ((enc_RAW_PDU_124(i) == o)) {setverdict(pass);}
2411 else {setverdict(fail);}
2416 // EXTENSION_BIT(yes) for set of hexstring
2418 type set of hexstring RAW_PDU_125
2419 with { encode "RAW"; variant "EXTENSION_BIT(yes)"};
2421 external function enc_RAW_PDU_125(in RAW_PDU_125 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2422 external function dec_RAW_PDU_125(in octetstring stream) return RAW_PDU_125 with { extension "prototype(convert) decode(RAW)" }
2424 testcase TC_EXTENSION_BIT_yes_for_set_of_hexstring() runs on TempComp{
2425 const RAW_PDU_125 i := {'F'H, '0'H, 'F'H}
2426 const octetstring o := '070F'O
2428 if ((enc_RAW_PDU_125(i) == o)) {setverdict(pass);}
2429 else {setverdict(fail);}
2432 // EXTENSION_BIT(reverse) for set of hexstring
2434 type set of hexstring RAW_PDU_126
2435 with { encode "RAW"; variant "EXTENSION_BIT(reverse)"};
2437 external function enc_RAW_PDU_126(in RAW_PDU_126 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2438 external function dec_RAW_PDU_126(in octetstring stream) return RAW_PDU_126 with { extension "prototype(convert) decode(RAW)" }
2440 testcase TC_EXTENSION_BIT_reverse_for_set_of_hexstring() runs on TempComp{
2441 const RAW_PDU_126 i := {'F'H, '00'H, 'FFF'H}
2442 const octetstring o := '0FF87F'O;
2444 if ((enc_RAW_PDU_126(i) == o)) {setverdict(pass);}
2445 else {setverdict(fail);}
2448 // Test of record with EXTENSION_BIT 1
2452 type bitstring BIT1_
2453 with { variant "FIELDLENGTH(1)" } ;
2455 type bitstring BIT7_
2456 with { variant "FIELDLENGTH(7)" } ;
2458 type octetstring OCT3_
2459 with { variant "FIELDLENGTH(3)" } ;
2464 BIT1_ extensionbit }
2465 with { variant "EXTENSION_BIT (yes)"};
2470 BIT1_ extensionbit }
2471 with { variant "EXTENSION_BIT (yes)"};
2476 BIT1_ extensionbit }
2477 with { variant "EXTENSION_BIT (yes)"};
2482 BIT1_ extensionbit ,
2484 octetstring more_extension optional }
2485 with { variant "EXTENSION_BIT (yes)";
2486 variant (more_extension) "EXTENSION_BIT (yes)"};
2491 BIT1_ extensionbit ,
2493 octetstring more_extension optional }
2494 with { variant "EXTENSION_BIT (yes)";
2495 variant (more_extension) "EXTENSION_BIT (yes)"};
2500 BIT1_ extensionbit ,
2502 octetstring more_extension optional }
2503 with { variant "EXTENSION_BIT (yes)";
2504 variant (more_extension) "EXTENSION_BIT (yes)"};
2507 type record RAW_PDU_127
2511 Octet2 oct2 optional ,
2512 Octet3 oct3 optional }
2513 with { variant (length1) "LENGTHTO(oct1 , oct2 , oct3 )" }
2515 } with {encode "RAW"}
2517 external function enc_RAW_PDU_127(in RAW_PDU_127 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2518 external function dec_RAW_PDU_127(in octetstring stream) return RAW_PDU_127 with { extension "prototype(convert) decode(RAW)" }
2520 testcase TC_record_with_EXTENSION_BIT_1() runs on TempComp{
2523 i := { octstr := '123456'O ,
2526 { data := '0000001'B ,
2527 extensionbit := '0'B ,
2529 { data := '0000001'B ,
2530 extensionbit := '0'B } ,
2531 more_extension := '000080'O } ,
2533 { data := '0000010'B ,
2534 extensionbit := '0'B ,
2536 { data := '0000010'B ,
2537 extensionbit := '0'B } ,
2538 more_extension := '000080'O } ,
2540 { data := '0000011'B ,
2541 extensionbit := '0'B ,
2543 { data := '0000011'B ,
2544 extensionbit := '0'B } ,
2545 more_extension := '000080'O } }
2547 const octetstring o :='1234560F010100008002020000800303000080'O
2549 if ((enc_RAW_PDU_127(i) == o)and(dec_RAW_PDU_127(o) == i )) {setverdict(pass);}
2550 else {setverdict(fail);}
2553 // Test of record with EXTENSION_BIT 2
2555 //external function enc_RAW_PDU_127(in RAW_PDU_127 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2556 //external function dec_RAW_PDU_127(in octetstring stream) return RAW_PDU_128 with { extension "prototype(convert) decode(RAW)" }
2558 testcase TC_record_with_EXTENSION_BIT_2() runs on TempComp{
2560 i := { octstr := '123456'O ,
2563 { data := '0000001'B ,
2564 extensionbit := '0'B ,
2566 { data := '0000001'B ,
2567 extensionbit := '0'B } ,
2568 more_extension := '000080'O } ,
2570 { data := '0000010'B ,
2571 extensionbit := '0'B ,
2573 { data := '0000010'B ,
2574 extensionbit := '1'B } ,
2575 more_extension := omit } ,
2577 { data := '0000011'B ,
2578 extensionbit := '0'B ,
2580 { data := '0000011'B ,
2581 extensionbit := '0'B } ,
2582 more_extension := '000080'O } }
2585 const octetstring o :='1234560C010100008002820303000080'O
2587 if ((enc_RAW_PDU_127(i) == o)and(dec_RAW_PDU_127(o) == i )) {setverdict(pass);}
2588 else {setverdict(fail);}
2591 // Test of record with EXTENSION_BIT 3
2593 testcase TC_record_with_EXTENSION_BIT_3() runs on TempComp{
2595 i := { octstr := '123456'O ,
2598 { data := '0000001'B ,
2599 extensionbit := '0'B ,
2601 { data := '0000001'B ,
2602 extensionbit := '0'B } ,
2603 more_extension := '000080'O } ,
2605 { data := '0000010'B ,
2606 extensionbit := '0'B ,
2608 { data := '0000010'B ,
2609 extensionbit := '1'B } ,
2610 more_extension := omit } ,
2612 { data := '0000011'B ,
2613 extensionbit := '0'B ,
2615 { data := '0000011'B ,
2616 extensionbit := '1'B } ,
2617 more_extension := omit } }
2619 const octetstring o :='12345609010100008002820383'O
2621 if ((enc_RAW_PDU_127(i) == o)and(dec_RAW_PDU_127(o) == i )) {setverdict(pass);}
2622 else {setverdict(fail);}
2625 // Test of record with EXTENSION_BIT 4
2627 testcase TC_record_with_EXTENSION_BIT_4() runs on TempComp{
2629 i := { octstr := '123456'O ,
2632 { data := '0000001'B ,
2633 extensionbit := '0'B ,
2635 { data := '0000001'B ,
2636 extensionbit := '1'B } ,
2637 more_extension := omit } ,
2639 { data := '0000010'B ,
2640 extensionbit := '0'B ,
2642 { data := '0000010'B ,
2643 extensionbit := '1'B } ,
2644 more_extension := omit } ,
2646 { data := '0000011'B ,
2647 extensionbit := '0'B ,
2649 { data := '0000011'B ,
2650 extensionbit := '1'B } ,
2651 more_extension := omit } }
2653 const octetstring o :='12345606018102820383'O
2655 if ((enc_RAW_PDU_127(i) == o)and(dec_RAW_PDU_127(o) == i )) {setverdict(pass);}
2656 else {setverdict(fail);}
2659 // Test of record with EXTENSION_BIT 5
2661 testcase TC_record_with_EXTENSION_BIT_5() runs on TempComp{
2663 i := { octstr := '123456'O ,
2666 { data := '0000001'B ,
2667 extensionbit := '0'B ,
2669 { data := '0000001'B ,
2670 extensionbit := '1'B } ,
2671 more_extension := omit } ,
2673 { data := '0000010'B ,
2674 extensionbit := '0'B ,
2676 { data := '0000010'B ,
2677 extensionbit := '1'B } ,
2678 more_extension := omit } ,
2681 const octetstring o :='1234560401810282'O
2684 if ((enc_RAW_PDU_127(i) == o)and(dec_RAW_PDU_127(o) == i )) {setverdict(pass);}
2685 else {setverdict(fail);}
2688 // Test of record with EXTENSION_BIT 6
2689 testcase TC_record_with_EXTENSION_BIT_6() runs on TempComp{
2691 i := { octstr := '123456'O ,
2694 { data := '0000001'B ,
2695 extensionbit := '0'B ,
2697 { data := '0000001'B ,
2698 extensionbit := '1'B } ,
2699 more_extension := omit } ,
2703 const octetstring o :='123456020181'O
2705 if ((enc_RAW_PDU_127(i) == o)and(dec_RAW_PDU_127(o) == i )) {setverdict(pass);}
2706 else {setverdict(fail);}
2709 // Test of record with EXTENSION_BIT 7
2710 testcase TC_record_with_EXTENSION_BIT_7() runs on TempComp{
2712 i := { octstr := '123456'O ,
2715 { data := '0000001'B ,
2716 extensionbit := '0'B ,
2718 { data := '0000001'B ,
2719 extensionbit := '0'B } ,
2720 more_extension := '000080'O } ,
2722 { data := '0000010'B ,
2723 extensionbit := '0'B ,
2725 { data := '0000010'B ,
2726 extensionbit := '0'B } ,
2727 more_extension := '000080'O } ,
2729 { data := '0000011'B ,
2730 extensionbit := '0'B ,
2732 { data := '0000011'B ,
2733 extensionbit := '0'B } ,
2734 more_extension := '000080'O } }
2736 const octetstring o :='1234560F010100008002020000800303000080'O
2738 if ((enc_RAW_PDU_127(i) == o)and(dec_RAW_PDU_127(o) == i )) {setverdict(pass);}
2739 else {setverdict(fail);}
2742 // Test of record with EXTENSION_BIT 8
2743 testcase TC_record_with_EXTENSION_BIT_8() runs on TempComp{
2745 i := { octstr := '123456'O ,
2748 { data := '0000001'B ,
2749 extensionbit := '0'B ,
2751 { data := '0000001'B ,
2752 extensionbit := '0'B } ,
2753 more_extension := '000080'O } ,
2757 const octetstring o :='123456050101000080'O
2759 if ((enc_RAW_PDU_127(i) == o)and(dec_RAW_PDU_127(o) == i )) {setverdict(pass);}
2760 else {setverdict(fail);}
2763 // Test of record with EXTENSION_BIT 9
2764 testcase TC_record_with_EXTENSION_BIT_9() runs on TempComp{
2766 i := { octstr := '123456'O ,
2769 { data := '0000001'B ,
2770 extensionbit := '0'B ,
2772 { data := '0000001'B ,
2773 extensionbit := '0'B } ,
2774 more_extension := '000080'O } ,
2776 { data := '0000010'B ,
2777 extensionbit := '0'B ,
2779 { data := '0000010'B ,
2780 extensionbit := '0'B } ,
2781 more_extension := '000080'O } ,
2784 const octetstring o :='1234560A01010000800202000080'O
2786 if ((enc_RAW_PDU_127(i) == o)and(dec_RAW_PDU_127(o) == i )) {setverdict(pass);}
2787 else {setverdict(fail);}
2790 // EXTENSION_BIT_GROUP(no)
2794 //type bitstring BIT1 length(1);
2795 //type bitstring BIT7 length(7);
2797 type record RAW_PDU_128 {
2804 }with { variant "EXTENSION_BIT_GROUP(no, field1, ext3)"};
2806 }with {encode "RAW"}
2808 external function enc_RAW_PDU_128(in RAW_PDU_128 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2809 external function dec_RAW_PDU_128(in octetstring stream) return RAW_PDU_128 with { extension "prototype(convert) decode(RAW)" }
2811 testcase TC_EXTENSION_BIT_GROUP_no() runs on TempComp{
2813 i := {'1111111'B, '0'B, '1110000'B, '0'B,'0001111'B,'0'B}
2814 const octetstring o := '7F700F'O
2816 if ((enc_RAW_PDU_128(i) == o)and(dec_RAW_PDU_128(o) == i )) {setverdict(pass);}
2817 else {setverdict(fail);}
2820 // EXTENSION_BIT_GROUP(yes)
2825 //type bitstring BIT1 length(1);
2826 //type bitstring BIT7 length(7);
2828 type record RAW_PDU_129 {
2835 }with { variant "EXTENSION_BIT_GROUP(yes, field1, ext2)"};
2837 }with {encode "RAW"}
2839 external function enc_RAW_PDU_129(in RAW_PDU_129 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2840 external function dec_RAW_PDU_129(in octetstring stream) return RAW_PDU_129 with { extension "prototype(convert) decode(RAW)" }
2842 testcase TC_EXTENSION_BIT_GROUP_yes() runs on TempComp{
2843 const RAW_PDU_129 i := {'1111111'B, '0'B, '1110000'B, '0'B,'0001111'B,'0'B};
2844 const octetstring o := '7FF00F'O;
2846 if ((enc_RAW_PDU_129(i) == o)) {setverdict(pass);}
2847 else {setverdict(fail);}
2850 // EXTENSION_BIT_GROUP(yes) - two groups
2854 //type bitstring BIT1 length(1);
2855 //type bitstring BIT7 length(7);
2857 type record RAW_PDU_130 {
2867 }with { variant "EXTENSION_BIT_GROUP(yes, field1, ext2)"
2868 variant "EXTENSION_BIT_GROUP(yes, field3, ext4)"};
2872 external function enc_RAW_PDU_130(in RAW_PDU_130 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2873 external function dec_RAW_PDU_130(in octetstring stream) return RAW_PDU_130 with { extension "prototype(convert) decode(RAW)" }
2875 testcase TC_EXTENSION_BIT_GROUP_yes_2_groups() runs on TempComp{
2876 const RAW_PDU_130 i := {'1111111'B, '0'B, '1110000'B, '0'B,'0001111'B,'0'B, '1111111'B, '0'B}
2877 const octetstring o := '7FF00FFF'O
2879 if ((enc_RAW_PDU_130(i) == o)) {setverdict(pass);}
2880 else {setverdict(fail);}
2883 // EXTENSION_BIT_GROUP(yes, reverse) - two groups
2887 //type bitstring BIT1 length(1);
2888 //type bitstring BIT7 length(7);
2890 type record RAW_PDU_131 {
2900 }with { variant "EXTENSION_BIT_GROUP(yes, field1, ext2)"
2901 variant "EXTENSION_BIT_GROUP(reverse, field3, ext4)"};
2905 external function enc_RAW_PDU_131(in RAW_PDU_131 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2906 external function dec_RAW_PDU_131(in octetstring stream) return RAW_PDU_131 with { extension "prototype(convert) decode(RAW)" }
2908 testcase TC_EXTENSION_BIT_GROUP_yes_reverse_2_groups() runs on TempComp{
2909 const RAW_PDU_131 i := {'1111111'B, '0'B, '1110000'B, '0'B,'0001111'B,'0'B, '1111111'B, '0'B}
2910 const octetstring o := '7FF08F7F'O
2912 if ((enc_RAW_PDU_131(i) == o)) {setverdict(pass);}
2913 else {setverdict(fail);}
2916 //==== Testing ALIGN Attribute ====
2918 //ALIGN(right) for octetstring
2920 type octetstring RAW_PDU_132
2921 with { encode "RAW";
2922 variant "FIELDLENGTH(4)";
2923 variant "ALIGN (right)"
2925 external function enc_RAW_PDU_132(in RAW_PDU_132 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2926 external function dec_RAW_PDU_132(in octetstring stream) return RAW_PDU_132 with { extension "prototype(convert) decode(RAW)" }
2928 testcase TC_ALIGN_right_for_octetstring() runs on TempComp{
2929 const RAW_PDU_132 i := '123456'O
2930 const octetstring o := '12345600'O
2932 if ((enc_RAW_PDU_132(i) == o)and((dec_RAW_PDU_132(o) == i & '00'O))) {setverdict(pass);}
2933 else {setverdict(fail);}
2936 //ALIGN(left) for octetstring
2938 type octetstring RAW_PDU_133
2939 with { encode "RAW";
2940 variant "FIELDLENGTH(4)";
2941 variant "ALIGN (left)"
2943 external function enc_RAW_PDU_133(in RAW_PDU_133 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2944 external function dec_RAW_PDU_133(in octetstring stream) return RAW_PDU_133 with { extension "prototype(convert) decode(RAW)" }
2946 testcase TC_ALIGN_left_for_octetstring() runs on TempComp{
2947 const RAW_PDU_133 i := '123456'O
2948 const octetstring o := '00123456'O
2950 if ((enc_RAW_PDU_133(i) == o)and((dec_RAW_PDU_133(o) == '00'O & i ))) {setverdict(pass);}
2951 else {setverdict(fail);}
2954 // ALIGN(right) for bitstring
2956 type bitstring RAW_PDU_134
2957 with { encode "RAW";
2958 variant "FIELDLENGTH(16)";
2959 variant "ALIGN (right)"
2962 external function enc_RAW_PDU_134(in RAW_PDU_134 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2963 external function dec_RAW_PDU_134(in octetstring stream) return RAW_PDU_134 with { extension "prototype(convert) decode(RAW)" }
2965 testcase TC_ALIGN_right_for_bitstring() runs on TempComp{
2966 const RAW_PDU_134 i := '11111111'B
2967 const octetstring o := 'FF00'O
2969 if ((enc_RAW_PDU_134(i) == o)and((dec_RAW_PDU_134(o) == '00000000'B & i ))) {setverdict(pass);}
2970 else {setverdict(fail);}
2973 // ALIGN(left) for bitstring
2975 type bitstring RAW_PDU_135
2976 with { encode "RAW";
2977 variant "FIELDLENGTH(16)";
2978 variant "ALIGN (left)"
2981 external function enc_RAW_PDU_135(in RAW_PDU_135 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
2982 external function dec_RAW_PDU_135(in octetstring stream) return RAW_PDU_135 with { extension "prototype(convert) decode(RAW)" }
2984 testcase TC_ALIGN_left_for_bitstring() runs on TempComp{
2985 const RAW_PDU_135 i := '11111111'B
2986 const octetstring o := '00FF'O
2988 if ((enc_RAW_PDU_135(i) == o)and((dec_RAW_PDU_135(o) == i & '00000000'B ))) {setverdict(pass);}
2989 else {setverdict(fail);}
2992 //======= Testing Compound types ======
2994 // Test of record with integer and octetstring
2998 type record RAW_PDU_136
3000 octetstring octstr }
3001 with { variant (int) "FIELDLENGTH(8)" ;
3002 variant (octstr) "FIELDLENGTH(2)" } ;
3006 external function enc_RAW_PDU_136(in RAW_PDU_136 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3007 external function dec_RAW_PDU_136(in octetstring stream) return RAW_PDU_136 with { extension "prototype(convert) decode(RAW)" }
3009 testcase TC_record_with_integer_and_octetstring() runs on TempComp{
3014 const octetstring o := '141234'O
3016 if ((enc_RAW_PDU_136(i) == o)and((dec_RAW_PDU_136(o) == i))) {setverdict(pass);}
3017 else {setverdict(fail);}
3020 // Test of record with default values in field
3023 type record RAW_PDU_137
3025 octetstring octstr }
3026 with { variant (int) "" ;
3027 variant (octstr) "FIELDLENGTH(2)" } ;
3031 external function enc_RAW_PDU_137(in RAW_PDU_137 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3032 external function dec_RAW_PDU_137(in octetstring stream) return RAW_PDU_137 with { extension "prototype(convert) decode(RAW)" }
3034 testcase TC_record_with_default_values_in_field() runs on TempComp{
3039 const octetstring o := '141234'O
3041 if ((enc_RAW_PDU_137(i) == o)and((dec_RAW_PDU_137(o) == i))) {setverdict(pass);}
3042 else {setverdict(fail);}
3045 // Test of record with bitstring
3049 type record RAW_PDU_138
3051 octetstring octstr ,
3055 with { variant (int) "" ;
3056 variant (octstr) "FIELDLENGTH(2)" ;
3057 variant (bit6) "FIELDLENGTH(6)" ;
3058 variant (bit2) "FIELDLENGTH(2)"
3063 external function enc_RAW_PDU_138(in RAW_PDU_138 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3064 external function dec_RAW_PDU_138(in octetstring stream) return RAW_PDU_138 with { extension "prototype(convert) decode(RAW)" }
3066 testcase TC_record_with_bitstring() runs on TempComp{
3074 const octetstring o := '1412343F'O
3076 if ((enc_RAW_PDU_138(i) == o)and((dec_RAW_PDU_138(o) == i))) {setverdict(pass);}
3077 else {setverdict(fail);}
3080 //Test of record with enumerated and fieldlength calculation
3084 type enumerated enum
3085 { zero, first, second, third, fourth, fifth, sixth, seventh, eighth, nineth,
3089 type record RAW_PDU_139
3091 octetstring octstr ,
3098 with {variant (int) "" ;
3099 variant (octstr) "FIELDLENGTH(2)" ;
3100 variant (bit6) "FIELDLENGTH(6)" ;
3101 variant (bit2) "FIELDLENGTH(2)" ;
3102 variant (enum1) "FIELDLENGTH(8)" ;
3103 variant (length1) "LENGTHTO(octN)" ;
3109 external function enc_RAW_PDU_139(in RAW_PDU_139 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3110 external function dec_RAW_PDU_139(in octetstring stream) return RAW_PDU_139 with { extension "prototype(convert) decode(RAW)" }
3112 testcase TC_record_with_enumerated_and_fieldlength_calculation() runs on TempComp{
3126 const octetstring o := '1412343F0A03123456'O
3129 if ((enc_RAW_PDU_139(i) == o)and((dec_RAW_PDU_139(o) == i))) {setverdict(pass);}
3130 else {setverdict(fail);}
3133 // Test of record called from record
3137 //type enumerated Enum2
3138 //{ zero, first, second, third, fourth, fifth, sixth, seventh, eighth, nineth,
3140 //with { variant ""} ;
3150 with { variant (bit1) "FIELDLENGTH(1)" ;
3151 variant (bit3) "FIELDLENGTH(3)" ;
3152 variant (bit4) "FIELDLENGTH(4)" ;
3153 variant (int) "FIELDLENGTH(16)" ;
3154 variant (length1) "LENGTHTO(octN)" ;
3159 type record RAW_PDU_140
3161 octetstring octstr ,
3170 with { variant (int) "" ;
3171 variant (octstr) "FIELDLENGTH(2)" ;
3172 variant (bit6) "FIELDLENGTH(6)" ;
3173 variant (bit2) "FIELDLENGTH(2)" ;
3174 variant (enum1) "FIELDLENGTH(8)" ;
3175 variant (length1) "LENGTHTO(octN)" ;
3177 variant (length2) "LENGTHTO(rec1)" ;
3183 external function enc_RAW_PDU_140(in RAW_PDU_140 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3184 external function dec_RAW_PDU_140(in octetstring stream) return RAW_PDU_140 with { extension "prototype(convert) decode(RAW)" }
3186 testcase TC_record_called_from_record() runs on TempComp{
3196 rec1 := { bit1 := '1'B ,
3205 const octetstring o := '1412343F0A0312345607F1341203FFFFFF'O
3207 if ((enc_RAW_PDU_140(i) == o)and((dec_RAW_PDU_140(o) == i))) {setverdict(pass);}
3208 else {setverdict(fail);}
3211 // Test of union called from record with CROSSTAG
3215 //type enumerated enum
3216 //{ zero, first, second, third, fourth, fifth, sixth, seventh, eighth, nineth,
3218 //with { variant ""} ;
3221 //type record record1
3222 // { bitstring bit1 ,
3226 // integer length1 ,
3227 // octetstring octN }
3228 //with { variant (bit1) "FIELDLENGTH(1)" ;
3229 // variant (bit3) "FIELDLENGTH(3)" ;
3230 // variant (bit4) "FIELDLENGTH(4)" ;
3231 // variant (int) "FIELDLENGTH(16)" ;
3232 // variant (length1) "LENGTHTO(octN)" ;
3233 // variant (octN) ""
3236 type union optionalpart
3242 with { variant (one) "" ;
3244 variant (three) "" ;
3249 type record RAW_PDU_141
3251 octetstring octstr ,
3260 integer opt_part_ptr ,
3261 optionalpart opt_part ,
3264 with { variant (int) "" ;
3265 variant (octstr) "FIELDLENGTH(2)" ;
3266 variant (bit6) "FIELDLENGTH(6)" ;
3267 variant (bit2) "FIELDLENGTH(2)" ;
3268 variant (enum1) "FIELDLENGTH(8)" ;
3269 variant (length1) "LENGTHTO(octN)" ;
3271 variant (length2) "LENGTHTO(rec1)" ;
3274 variant (opt_part_ptr) "POINTERTO ( opt_part)";
3275 variant (opt_part) "CROSSTAG (
3282 variant (eop) "FIELDLENGTH(1)" ;
3287 external function enc_RAW_PDU_141(in RAW_PDU_141 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3288 external function dec_RAW_PDU_141(in octetstring stream) return RAW_PDU_141 with { extension "prototype(convert) decode(RAW)" }
3290 testcase TC_union_called_from_record_with_CROSSTAG() runs on TempComp{
3300 rec1 := { bit1 := '1'B ,
3305 octN := 'FFFFFF'O } ,
3308 opt_part := { five := 5 } ,
3312 const octetstring o := '1412343F0A0312345607F1341203FFFFFF05010500'O
3314 if ((enc_RAW_PDU_141(i) == o)and((dec_RAW_PDU_141(o) == i))) {setverdict(pass);}
3315 else {setverdict(fail);}
3318 // Test of union called from record with CROSSTAG, OTHERWISE
3322 //type enumerated enum
3323 //{ zero, first, second, third, fourth, fifth, sixth, seventh, eighth, nineth,
3325 //with { variant ""} ;
3328 //type record record1
3329 // { bitstring bit1 ,
3333 // integer length1 ,
3334 // octetstring octN }
3335 //with { variant (bit1) "FIELDLENGTH(1)" ;
3336 // variant (bit3) "FIELDLENGTH(3)" ;
3337 // variant (bit4) "FIELDLENGTH(4)" ;
3338 // variant (int) "FIELDLENGTH(16)" ;
3339 // variant (length1) "LENGTHTO(octN)" ;
3340 // variant (octN) ""
3345 //type union optionalpart
3351 //with { variant (one) "" ;
3352 // variant (two) "" ;
3353 // variant (three) "" ;
3354 // variant (four) "" ;
3355 // variant (five) "" ;
3362 type record RAW_PDU_142
3364 octetstring octstr ,
3373 integer opt_part_ptr ,
3374 optionalpart opt_part ,
3377 with { variant (int) "" ;
3378 variant (octstr) "FIELDLENGTH(2)" ;
3379 variant (bit6) "FIELDLENGTH(6)" ;
3380 variant (bit2) "FIELDLENGTH(2)" ;
3381 variant (enum1) "FIELDLENGTH(8)" ;
3382 variant (length1) "LENGTHTO(octN)" ;
3384 variant (length2) "LENGTHTO(rec1)" ;
3387 variant (opt_part_ptr) "POINTERTO ( opt_part)";
3388 variant (opt_part) "CROSSTAG (
3393 five , OTHERWISE ) ";
3395 variant (eop) "FIELDLENGTH(1)" ;
3400 external function enc_RAW_PDU_142(in RAW_PDU_142 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3401 external function dec_RAW_PDU_142(in octetstring stream) return RAW_PDU_142 with { extension "prototype(convert) decode(RAW)" }
3403 testcase TC_union_called_from_record_with_CROSSTAG_OTHERWISE() runs on TempComp{
3413 rec1 := { bit1 := '1'B ,
3418 octN := 'FFFFFF'O } ,
3421 opt_part := { five := 5 } ,
3425 const octetstring o := '1412343F0A0312345607F1341203FFFFFF05010500'O
3427 if ((enc_RAW_PDU_142(i) == o)and((dec_RAW_PDU_142(o) == i))) {setverdict(pass);}
3428 else {setverdict(fail);}
3432 // Test of record without specifying the default attributes for fields
3436 //type enumerated enum
3437 //{ zero, first, second, third, fourth, fifth, sixth, seventh, eighth, nineth,
3439 //with { variant ""} ;
3442 type record record1_2
3449 with { variant (bit1) "FIELDLENGTH(1)" ;
3450 variant (bit3) "FIELDLENGTH(3)" ;
3451 variant (bit4) "FIELDLENGTH(4)" ;
3452 variant (int) "FIELDLENGTH(16)" ;
3453 variant (length1) "LENGTHTO(octN)"
3458 type union optionalpart1
3467 type record RAW_PDU_143
3469 octetstring octstr ,
3478 integer opt_part_ptr ,
3479 optionalpart1 opt_part ,
3482 with { variant (octstr) "FIELDLENGTH(2)" ;
3483 variant (bit6) "FIELDLENGTH(6)" ;
3484 variant (bit2) "FIELDLENGTH(2)" ;
3485 variant (enum1) "FIELDLENGTH(8)" ;
3486 variant (length1) "LENGTHTO(octN)" ;
3487 variant (length2) "LENGTHTO(rec1)" ;
3488 variant (opt_part_ptr) "POINTERTO ( opt_part)";
3489 variant (opt_part) "CROSSTAG (
3496 variant (eop) "FIELDLENGTH(1)" ;
3501 external function enc_RAW_PDU_143(in RAW_PDU_143 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3502 external function dec_RAW_PDU_143(in octetstring stream) return RAW_PDU_143 with { extension "prototype(convert) decode(RAW)" }
3504 testcase TC_record_without_specifying_the_default_attributes_for_fields() runs on TempComp{
3515 rec1 := { bit1 := '1'B ,
3520 octN := 'FFFFFF'O } ,
3523 opt_part := { five := 5 } ,
3529 const octetstring o := '1412343F0A0312345607F1341203FFFFFF05010500'O
3531 if ((enc_RAW_PDU_143(i) == o)and(dec_RAW_PDU_143(o) == i)) {setverdict(pass);}
3532 else {setverdict(fail);}
3537 // Test of record of called from record
3543 { octetstring oct1 ,
3546 with { variant (oct1) "FIELDLENGTH(1)";
3547 variant (length2) "LENGTHTO(octN)"
3550 type record of record2 Rec2list
3551 with { variant "" };
3553 type record RAW_PDU_144
3557 with { variant (length1) "LENGTHTO(rec2list)" } ;
3561 external function enc_RAW_PDU_144(in RAW_PDU_144 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3562 external function dec_RAW_PDU_144(in octetstring stream) return RAW_PDU_144 with { extension "prototype(convert) decode(RAW)" }
3565 testcase TC_record_of_called_from_record() runs on TempComp{
3567 i := { length1:= 8 ,
3568 rec2list := { { oct1 := '12'O ,
3576 const octetstring o := '081202345612027890'O
3579 if ((enc_RAW_PDU_144(i) == o)and(dec_RAW_PDU_144(o) == i)) {setverdict(pass);}
3580 else {setverdict(fail);}
3584 // Test of set with TAG
3591 with { variant ""} ;
3596 octetstring octfield }
3597 with { variant (octfield) "FIELDLENGTH(2)"} ;
3602 bitstring bit8field }
3603 with { variant (bit8field) "FIELDLENGTH(8)"} ;
3607 type set RAW_PDU_145
3612 with { variant "TAG (
3620 external function enc_RAW_PDU_145(in RAW_PDU_145 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3621 external function dec_RAW_PDU_145(in octetstring stream) return RAW_PDU_145 with { extension "prototype(convert) decode(RAW)" }
3623 testcase TC_set_with_TAG () runs on TempComp{
3626 i := { octstr := { tag := 2 ,
3627 octfield := '1234'O } ,
3630 bit8 := { tag := 3 ,
3631 bit8field := '11111111'B }
3636 const octetstring o := '010F02123403FF'O
3639 if ((enc_RAW_PDU_145(i) == o)and(dec_RAW_PDU_145(o) == i)) {setverdict(pass);}
3640 else {setverdict(fail);}
3643 // Test of union with TAG , first element called
3647 //type record intrec
3649 // integer intfield }
3650 //with { variant ""} ;
3653 // type record octrec
3655 // octetstring octfield }
3656 // with { variant (octfield) "FIELDLENGTH(2)"} ;
3659 // type record bitrec
3661 // bitstring bit8field }
3662 // with { variant (bit8field) "FIELDLENGTH(8)"} ;
3666 type union RAW_PDU_146
3671 with { variant "TAG (
3679 external function enc_RAW_PDU_146(in RAW_PDU_146 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3680 external function dec_RAW_PDU_146(in octetstring stream) return RAW_PDU_146 with { extension "prototype(convert) decode(RAW)" }
3682 testcase TC_union_with_TAG_first_element_called() runs on TempComp {
3684 i := { int := { tag := 1 ,
3688 const octetstring o := '010F'O
3690 if ((enc_RAW_PDU_146(i) == o)and(dec_RAW_PDU_146(o) == i)) {setverdict(pass);}
3691 else {setverdict(fail);}
3695 // Test of union with TAG , second element called
3697 //external function enc_RAW_PDU(in RAW_PDU pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3698 //external function dec_RAW_PDU(in octetstring stream) return RAW_PDU with { extension "prototype(convert) decode(RAW)" }
3702 // type record intrec
3704 // integer intfield }
3705 // with { variant ""} ;
3708 // type record octrec
3710 // octetstring octfield }
3711 // with { variant (octfield) "FIELDLENGTH(2)"} ;
3714 // type record bitrec
3716 // bitstring bit8field }
3717 // with { variant (bit8field) "FIELDLENGTH(8)"} ;
3721 // type union RAW_PDU
3726 // with { variant "TAG (
3732 // }with{encode "RAW"}
3734 testcase TC_union_with_TAG_second_element_called() runs on TempComp {
3736 i := { octstr := { tag := 2 ,
3737 octfield := '1234'O }
3742 const octetstring o := '021234'O
3744 if ((enc_RAW_PDU_146(i) == o)and(dec_RAW_PDU_146(o) == i)) {setverdict(pass);}
3745 else {setverdict(fail);}
3749 // Test of union with TAG , third element called
3751 testcase TC_union_with_TAG_third_element_called() runs on TempComp {
3753 i := { bit8 := { tag := 3 ,
3754 bit8field := '11111111'B }
3759 const octetstring o := '03FF'O
3762 if ((enc_RAW_PDU_146(i) == o)and(dec_RAW_PDU_146(o) == i)) {setverdict(pass);}
3763 else {setverdict(fail);}
3767 // Test of union with TAG , third element called with OTHERWISE
3771 type union RAW_PDU_147
3776 with { variant "TAG (
3779 field3, OTHERWISE)"};
3783 external function enc_RAW_PDU_147(in RAW_PDU_147 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3784 external function dec_RAW_PDU_147(in octetstring stream) return RAW_PDU_147 with { extension "prototype(convert) decode(RAW)" }
3786 testcase TC_union_with_TAG_third_element_called_with_OTHERWISE() runs on TempComp {
3788 i := { field3 := { tag := 3 ,
3789 bit8field := '11111111'B }
3792 const octetstring o := '03FF'O
3795 if ((enc_RAW_PDU_147(i) == o)and(dec_RAW_PDU_147(o) == i)) {setverdict(pass);}
3796 else {setverdict(fail);}
3800 // Test of set of called from record
3804 // type record record2
3805 // { octetstring oct1 ,
3806 // integer length2 ,
3807 // octetstring octN }
3808 // with { variant (oct1) "FIELDLENGTH(1)";
3809 // variant (length2) "LENGTHTO(octN)"
3813 type set of record2 Rec2list_1
3814 with { variant "" };
3816 type record RAW_PDU_148
3818 Rec2list_1 rec2list }
3820 with { variant (length1) "LENGTHTO(rec2list)" } ;
3824 external function enc_RAW_PDU_148(in RAW_PDU_148 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3825 external function dec_RAW_PDU_148(in octetstring stream) return RAW_PDU_148 with { extension "prototype(convert) decode(RAW)" }
3827 testcase TC_set_of_called_from_record() runs on TempComp{
3830 i := { length1:= 8 ,
3831 rec2list := { { oct1 := '12'O ,
3840 const octetstring o := '081202345612027890'O
3842 if ((enc_RAW_PDU_148(i) == o)and(dec_RAW_PDU_148(o) == i)) {setverdict(pass);}
3843 else {setverdict(fail);}
3847 // Test of record with optional field with PRESENCE
3851 // type enumerated enum
3852 // { zero, first, second, third, fourth, fifth, sixth, seventh, eighth, nineth,
3854 // with { variant ""} ;
3857 // type record record1_2
3858 // { bitstring bit1 ,
3862 // integer length1 ,
3863 // octetstring octN }
3864 // with { variant (bit1) "FIELDLENGTH(1)" ;
3865 // variant (bit3) "FIELDLENGTH(3)" ;
3866 // variant (bit4) "FIELDLENGTH(4)" ;
3867 // variant (int) "FIELDLENGTH(16)" ;
3868 // variant (length1) "LENGTHTO(octN)"
3872 // type union optionalpart1
3878 // with { variant "" }
3881 // type record record2
3882 // { octetstring oct1 ,
3883 // integer length2 ,
3884 // octetstring octN }
3885 // with { variant (oct1) "FIELDLENGTH(1)";
3886 // variant (length2) "LENGTHTO(octN)"
3890 // type record of record2 Rec2list
3891 // with { variant "" };
3893 type record RAW_PDU_149
3895 octetstring octstr ,
3906 integer opt_part_ptr ,
3907 integer presenceid ,
3908 optionalpart1 opt_part optional ,
3909 octetstring eop optional }
3911 with { variant (octstr) "FIELDLENGTH(2)" ;
3912 variant (bit6) "FIELDLENGTH(6)" ;
3913 variant (bit2) "FIELDLENGTH(2)" ;
3914 variant (enum1) "FIELDLENGTH(8)" ;
3915 variant (length1) "LENGTHTO(octN)" ;
3916 variant (length2) "LENGTHTO(rec1)" ;
3917 variant (length3) "LENGTHTO(rec2list)"
3918 variant (opt_part_ptr) "POINTERTO ( opt_part)";
3919 variant (opt_part) "PRESENCE (presenceid= 1)" ;
3920 variant (opt_part) "CROSSTAG (
3927 variant (eop) "FIELDLENGTH(1)" ;
3932 external function enc_RAW_PDU_149(in RAW_PDU_149 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3933 external function dec_RAW_PDU_149(in octetstring stream) return RAW_PDU_149 with { extension "prototype(convert) decode(RAW)" }
3936 testcase TC_record_with_optional_field_with_PRESENCE() runs on TempComp{
3947 rec1 := { bit1 := '1'B ,
3952 octN := 'FFFFFF'O } ,
3954 rec2list := { { oct1 := '12'O ,
3959 octN := '7890'O } } ,
3963 opt_part := { five := 5 } ,
3967 const octetstring o := '1412343F0A0312345607F1341203FFFFFF0812023456120278900502010500'O
3969 if ((enc_RAW_PDU_149(i) == o)and(dec_RAW_PDU_149(o) == i)) {setverdict(pass);}
3970 else {setverdict(fail);}
3974 // Test of record with UNIT
3980 with { variant "" } ;
3984 type record RAW_PDU_150
3986 octetstring octstr }
3987 with { variant (length1) "LENGTHTO(octstr)" ;
3988 variant (length1) "UNIT(8)" } ;
3993 external function enc_RAW_PDU_150(in RAW_PDU_150 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
3994 external function dec_RAW_PDU_150(in octetstring stream) return RAW_PDU_150 with { extension "prototype(convert) decode(RAW)" }
3996 testcase TC_record_with_UNIT() runs on TempComp{
3998 i := { length1 := 4 ,
3999 octstr := '12345678'O }
4001 const octetstring o := '0412345678'O
4004 if ((enc_RAW_PDU_150(i) == o)and(dec_RAW_PDU_150(o) == i)) {setverdict(pass);}
4005 else {setverdict(fail);}
4008 // Test of record with PTRUNIT
4012 type record RAW_PDU_151
4013 { integer pointer1 ,
4016 octetstring octstr1 ,
4017 octetstring octstr2 ,
4018 octetstring octstr3 }
4019 with { variant (pointer1) "POINTERTO(octstr1)" ;
4020 variant (pointer1) "PTRUNIT(1)" ;
4021 variant (pointer2) "POINTERTO(octstr2)" ;
4022 variant (pointer3) "POINTERTO(octstr3)" ;
4023 variant (octstr1) "FIELDLENGTH(3)" ;
4024 variant (octstr2) "FIELDLENGTH(3)" ;
4025 variant (octstr3) "FIELDLENGTH(3)" ;
4030 external function enc_RAW_PDU_151(in RAW_PDU_151 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
4031 external function dec_RAW_PDU_151(in octetstring stream) return RAW_PDU_151 with { extension "prototype(convert) decode(RAW)" }
4033 testcase TC_record_with_PTRUNIT() runs on TempComp{
4035 i := { pointer1 := 24 ,
4038 octstr1 := '010203'O ,
4039 octstr2 := '040506'O ,
4040 octstr3 := '070809'O }
4042 const octetstring o := '180507010203040506070809'O
4044 if ((enc_RAW_PDU_151(i) == o)and(dec_RAW_PDU_151(o) == i)) {setverdict(pass);}
4045 else {setverdict(fail);}
4048 // Test of record with PTROFFSET
4054 type record RAW_PDU_152
4055 { integer pointer1 ,
4058 octetstring octstr1 ,
4059 octetstring octstr2 ,
4060 octetstring octstr3 }
4061 with { variant (pointer1) "POINTERTO(octstr1)" ;
4062 variant (pointer1) "PTROFFSET(0)" ;
4063 variant (pointer2) "POINTERTO(octstr2)" ;
4064 variant (pointer3) "POINTERTO(octstr3)" ;
4065 variant (octstr1) "FIELDLENGTH(3)" ;
4066 variant (octstr2) "FIELDLENGTH(3)" ;
4067 variant (octstr3) "FIELDLENGTH(3)" ;
4072 external function enc_RAW_PDU_152(in RAW_PDU_152 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
4073 external function dec_RAW_PDU_152(in octetstring stream) return RAW_PDU_152 with { extension "prototype(convert) decode(RAW)" }
4075 testcase TC_record_with_PTROFFSET() runs on TempComp{
4077 i := { pointer1 := 3 ,
4080 octstr1 := '010203'O ,
4081 octstr2 := '040506'O ,
4082 octstr3 := '070809'O }
4086 const octetstring o := '030507010203040506070809'O
4089 if ((enc_RAW_PDU_152(i) == o)and(dec_RAW_PDU_152(o) == i)) {setverdict(pass);}
4090 else {setverdict(fail);}
4093 // Test of structured types - 1
4099 type record Rec1field
4103 with { variant (bit7) "FIELDLENGTH (7)" ;
4104 variant (bit1) "FIELDLENGTH (1)" ;
4105 variant (oct1) "FIELDLENGTH (1)" ;
4108 type enumerated Enum1
4109 {zero, first, second, third, fourth, fifth }
4110 with { variant "FIELDLENGTH (8)" };
4115 octetstring octstr ,
4117 with { variant (octstr) "FIELDLENGTH (1)" ;
4118 variant (bitstr) "FIELDLENGTH (8)" ;
4122 type record of Rec3_1 Recof
4123 with { variant "" };
4128 with { variant (length1) "LENGTHTO (octN)" };
4130 type union Rec2content
4134 with { variant "" };
4136 type record Rec2data
4141 Rec2content content }
4142 with { variant (id) "FIELDLENGTH (1)" ;
4143 variant (length1) "LENGTHTO (octN)" ;
4144 variant (length2) "LENGTHTO (content)" ;
4145 variant (content) "CROSSTAG (
4151 type set of Rec2data Rec2datas
4152 with { variant "" };
4156 type record RAW_PDU_153
4158 Rec1field rec1field1 ,
4160 Rec1field rec1field2 ,
4162 with { variant (length1) "LENGTHTO(rec1field1)" ;
4163 variant (length2) "LENGTHTO(rec1field2)"
4168 external function enc_RAW_PDU_153(in RAW_PDU_153 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
4169 external function dec_RAW_PDU_153(in octetstring stream) return RAW_PDU_153 with { extension "prototype(convert) decode(RAW)" }
4171 testcase TC_structured_types_1() runs on TempComp{
4173 i := { length1 := 2 ,
4174 rec1field1 := { bit7 := '0000001'B ,
4178 rec1field2 := { bit7 := '0000010'B ,
4181 datas :={ { id := '01'O ,
4185 content := { enum1 := fifth } },
4190 content := { recof := { { int := 1 ,
4192 bitstr := '00000000'B } ,
4195 bitstr := '00000000'B } } } } ,
4200 content := { rec5 := { length1 := 5 ,
4201 octN := '1234567890'O } } } } }
4205 const octetstring o := '0281FF0282FF010212340105020256780601FF0002FF000302901206051234567890'O
4209 if ((enc_RAW_PDU_153(i) == o)and(dec_RAW_PDU_153(o) == i)) {setverdict(pass);}
4210 else {setverdict(fail);}
4213 // Test of structured types - 2
4215 external function enc_RAW_PDU_154(in RAW_PDU_154 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
4216 external function dec_RAW_PDU_154(in octetstring stream) return RAW_PDU_154 with { extension "prototype(convert) decode(RAW)" }
4220 type octetstring end_of_optional_parameters_indicator
4221 with { variant "FIELDLENGTH(1)"};
4223 type integer pointer
4224 with { variant "" };
4226 // type integer INT1_1
4227 // with { variant "" };
4234 octetstring octN optional }
4235 with { variant (bit4) "FIELDLENGTH(4)" ;
4236 variant (bit1) "FIELDLENGTH(1)" ;
4237 variant (bit3) "FIELDLENGTH(3)" ;
4238 variant (length1) "LENGTHTO(octN)" ;
4246 octetstring octN optional }
4247 with { variant (bit8) "FIELDLENGTH(8)" ;
4248 variant (length1) "LENGTHTO(octN)" ;
4257 octetstring oct2 optional }
4258 with { variant (bit4) "FIELDLENGTH(4)" ;
4259 variant (bit1) "FIELDLENGTH(1)" ;
4260 variant (bit3) "FIELDLENGTH(3)" ;
4261 variant (oct2) "FIELDLENGTH(2)" ;
4268 octetstring oct5 optional }
4269 with { variant (oct5) "FIELDLENGTH(5)"};
4274 type union opt_par_union
4275 { octetstring octstr ,
4279 with { variant (octstr) "FIELDLENGTH(2)" };
4286 with { variant (length1) "LENGTHTO(par)" ;
4287 variant (par) "CROSSTAG(
4295 type set of opt_par optional_part
4296 with { variant "" };
4299 type record RAW_PDU_154
4300 { pointer var_part_ptr,
4301 pointer opt_part_ptr,
4303 Rec1_1 rec1 optional,
4304 optional_part opt_part optional,
4305 end_of_optional_parameters_indicator EndOP optional
4306 } with { variant (var_part_ptr) "POINTERTO (length1)";
4307 variant (opt_part_ptr) "POINTERTO (opt_part)";
4308 variant (length1) "LENGTHTO (rec1)" };
4312 testcase TC_structured_types_2() runs on TempComp{
4314 i := { var_part_ptr := 2 ,
4318 opt_part := { { id := 1 , // opt_part := omit
4320 par := { octstr := 'FFFF'O } } } ,
4321 EndOP := '00'O } // EndOP = omit
4324 const octetstring o := '0202000102FFFF00'O
4326 if ((enc_RAW_PDU_154(i) == o)and(dec_RAW_PDU_154(o) == i)) {setverdict(pass);}
4327 else {setverdict(fail);}
4329 //=====================================
4330 //Test of structured types - 3
4331 //=====================================
4333 //group RAW_group31{
4335 // type octetstring end_of_optional_parameters_indicator
4336 // with { variant "FIELDLENGTH(1)"};
4338 // type integer pointer
4339 // with { variant "" };
4341 // type integer INT1_1
4342 // with { variant "" };
4344 // type record Rec1_1
4345 // { bitstring bit4 ,
4349 // octetstring octN optional }
4350 // with { variant (bit4) "FIELDLENGTH(4)" ;
4351 // variant (bit1) "FIELDLENGTH(1)" ;
4352 // variant (bit3) "FIELDLENGTH(3)" ;
4353 // variant (length1) "LENGTHTO(octN)" ;
4356 // type record Rec2_1
4357 // { bitstring bit8 ,
4359 // octetstring octN optional }
4360 // with { variant (bit8) "FIELDLENGTH(8)" ;
4361 // variant (length1) "LENGTHTO(octN)" ;
4365 // type record Rec3_2
4366 // { bitstring bit4 ,
4370 // octetstring oct2 optional }
4371 // with { variant (bit4) "FIELDLENGTH(4)" ;
4372 // variant (bit1) "FIELDLENGTH(1)" ;
4373 // variant (bit3) "FIELDLENGTH(3)" ;
4374 // variant (oct2) "FIELDLENGTH(2)" ;
4379 // octetstring oct5 optional }
4380 // with { variant (oct5) "FIELDLENGTH(5)"};
4385 // type union opt_par_union
4386 // { octetstring octstr ,
4390 // with { variant (octstr) "FIELDLENGTH(2)" };
4393 // type record opt_par
4395 // integer length1 ,
4396 // opt_par_union par }
4397 // with { variant (length1) "LENGTHTO(par)" ;
4398 // variant (par) "CROSSTAG(
4406 // type set of opt_par optional_part
4407 // with { variant "" };
4410 // type record RAW_PDU_155
4411 // { pointer var_part_ptr,
4412 // pointer opt_part_ptr,
4414 // Rec1_1 rec1 optional,
4415 // optional_part opt_part optional,
4416 // end_of_optional_parameters_indicator EndOP optional
4417 // } with { variant (var_part_ptr) "POINTERTO (length1)";
4418 // variant (opt_part_ptr) "POINTERTO (opt_part)";
4419 // variant (length1) "LENGTHTO (rec1)" };
4421 //}with{encode "RAW"}
4423 //external function enc_RAW_PDU_155(in RAW_PDU_155 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
4424 //external function dec_RAW_PDU_155(in octetstring stream) return RAW_PDU_155 with { extension "prototype(convert) decode(RAW)" }
4426 testcase TC_structured_types_3() runs on TempComp{
4428 i := { var_part_ptr := 2 ,
4431 rec1 := { bit4 := '1111'B , // rec1 := omit
4435 octN := '123456'O } , // octN := omit
4436 opt_part := { { id := 1 , // opt_part := omit
4438 par := { octstr := 'FFFF'O } } } ,
4439 EndOP := '00'O } // EndOP = omit
4443 const octetstring o := '0207051F031234560102FFFF00'O
4445 if ((enc_RAW_PDU_154(i) == o)and(dec_RAW_PDU_154(o) == i)) {setverdict(pass);}
4446 else {setverdict(fail);}
4449 //=====================================
4450 // Test of structured types - 4
4451 //=====================================
4453 //group RAW_group32{
4455 // type octetstring end_of_optional_parameters_indicator
4456 // with { variant "FIELDLENGTH(1)"};
4458 // type integer pointer
4459 // with { variant "" };
4461 // type integer INT1_1
4462 // with { variant "" };
4464 // type record Rec1_1
4465 // { bitstring bit4 ,
4469 // octetstring octN optional }
4470 // with { variant (bit4) "FIELDLENGTH(4)" ;
4471 // variant (bit1) "FIELDLENGTH(1)" ;
4472 // variant (bit3) "FIELDLENGTH(3)" ;
4473 // variant (length1) "LENGTHTO(octN)" ;
4478 // type record Rec2_1
4479 // { bitstring bit8 ,
4481 // octetstring octN optional }
4482 // with { variant (bit8) "FIELDLENGTH(8)" ;
4483 // variant (length1) "LENGTHTO(octN)" ;
4487 // type record Rec3_2
4488 // { bitstring bit4 ,
4492 // octetstring oct2 optional }
4493 // with { variant (bit4) "FIELDLENGTH(4)" ;
4494 // variant (bit1) "FIELDLENGTH(1)" ;
4495 // variant (bit3) "FIELDLENGTH(3)" ;
4496 // variant (oct2) "FIELDLENGTH(2)" ;
4501 // octetstring oct5 optional }
4502 // with { variant (oct5) "FIELDLENGTH(5)"};
4507 // type union opt_par_union
4508 // { octetstring octstr ,
4512 // with { variant (octstr) "FIELDLENGTH(2)" };
4515 // type record opt_par
4517 // integer length1 ,
4518 // opt_par_union par }
4519 // with { variant (length1) "LENGTHTO(par)" ;
4520 // variant (par) "CROSSTAG(
4528 // type set of opt_par optional_part
4529 // with { variant "" };
4532 // type record RAW_PDU_156
4533 // { pointer var_part_ptr,
4534 // pointer opt_part_ptr,
4536 // Rec1_1 rec1 optional,
4537 // optional_part opt_part optional,
4538 // end_of_optional_parameters_indicator EndOP optional
4539 // } with { variant (var_part_ptr) "POINTERTO (length1)";
4540 // variant (opt_part_ptr) "POINTERTO (opt_part)";
4541 // variant (length1) "LENGTHTO (rec1)" };
4543 // }with{encode "RAW"}
4545 //external function enc_RAW_PDU_156(in RAW_PDU_156 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
4546 //external function dec_RAW_PDU_156(in octetstring stream) return RAW_PDU_156 with { extension "prototype(convert) decode(RAW)" }
4548 testcase TC_structured_types_4() runs on TempComp{
4550 i := { var_part_ptr := 2 ,
4553 rec1 := { bit4 := '1111'B , // rec1 := omit
4557 octN := '123456'O } , // octN := omit
4558 opt_part := { { id := 1 , // opt_part := omit
4560 par := { octstr := 'FFFF'O } } ,
4563 par := { rec2:= { bit8 := '00000000'B ,
4565 octN := '1234567890'O } } } , // octN := omit
4568 par := { rec3 := { bit4 := '1111'B ,
4572 oct2 := '1234'O } } } , // oct2 := omit
4575 par := { rec4:= { int := 15 ,
4576 oct5 := '1234567890'O } } } } , // oct5 := omit
4577 EndOP := '00'O } // EndOP = omit
4581 const octetstring o := '0207051F031234560102FFFF02070005123456789003048F0F123404060F123456789000'O
4583 if ((enc_RAW_PDU_154(i) == o)and(dec_RAW_PDU_154(o) == i)) {setverdict(pass);}
4584 else {setverdict(fail);}
4587 // Test of structured types - 5
4589 //external function enc_RAW_PDU(in RAW_PDU pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
4590 //external function dec_RAW_PDU(in octetstring stream) return RAW_PDU with { extension "prototype(convert) decode(RAW)" }
4594 // type octetstring end_of_optional_parameters_indicator
4595 // with { variant "FIELDLENGTH(1)"};
4597 // type integer pointer
4598 // with { variant "" };
4600 // type integer INT1
4601 // with { variant "" };
4603 // type record Rec1_1
4604 // { bitstring bit4 ,
4608 // octetstring octN optional }
4609 // with { variant (bit4) "FIELDLENGTH(4)" ;
4610 // variant (bit1) "FIELDLENGTH(1)" ;
4611 // variant (bit3) "FIELDLENGTH(3)" ;
4612 // variant (length1) "LENGTHTO(octN)" ;
4616 // type record Rec2_1
4617 // { bitstring bit8 ,
4619 // octetstring octN optional }
4620 // with { variant (bit8) "FIELDLENGTH(8)" ;
4621 // variant (length1) "LENGTHTO(octN)" ;
4625 // type record Rec3_2
4626 // { bitstring bit4 ,
4630 // octetstring oct2 optional }
4631 // with { variant (bit4) "FIELDLENGTH(4)" ;
4632 // variant (bit1) "FIELDLENGTH(1)" ;
4633 // variant (bit3) "FIELDLENGTH(3)" ;
4634 // variant (oct2) "FIELDLENGTH(2)" ;
4641 // octetstring oct5 optional }
4642 // with { variant (oct5) "FIELDLENGTH(5)" };
4645 // type union opt_par_union
4646 // { octetstring octstr ,
4650 // with { variant (octstr) "FIELDLENGTH(2)" };
4653 // type record opt_par
4655 // integer length1 ,
4656 // opt_par_union par }
4657 // with { variant (length1) "LENGTHTO(par)" ;
4658 // variant (par) "CROSSTAG(
4668 // type set of opt_par optional_part
4669 // with { variant "" };
4672 // type record RAW_PDU
4673 // { pointer var_part_ptr,
4674 // pointer opt_part_ptr,
4676 // Rec1_1 rec1 optional,
4677 // optional_part opt_part optional,
4678 // end_of_optional_parameters_indicator EndOP optional
4679 // } with { variant (var_part_ptr) "POINTERTO (length1)";
4680 // variant (opt_part_ptr) "POINTERTO (opt_part)";
4681 // variant (length1) "LENGTHTO (rec1)" };
4683 // }with{encode "RAW"}
4685 testcase TC_structured_types_5() runs on TempComp{
4687 i := { var_part_ptr := 2 ,
4690 rec1 := { bit4 := '1111'B , // rec1 := omit
4695 opt_part := { { id := 1 , // opt_part := omit
4697 par := { octstr := 'FFFF'O } } ,
4700 par := { rec2:= { bit8 := '00000000'B ,
4702 octN := '1234567890'O } } } , // octN := omit
4705 par := { rec3 := { bit4 := '1111'B ,
4709 oct2 := '1234'O } } } , // oct2 := omit
4712 par := { rec4:= { int := 15 ,
4713 oct5 := '1234567890'O } } } } , // oct5 := omit
4714 EndOP := '00'O } // EndOP = omit
4718 const octetstring o := '0204021F000102FFFF02070005123456789003048F0F123404060F123456789000'O
4721 if ((enc_RAW_PDU_154(i) == o)and(dec_RAW_PDU_154(o) == i)) {setverdict(pass);}
4722 else {setverdict(fail);}
4725 //==================================
4726 // Test of structured types - 6
4727 //==================================
4729 testcase TC_structured_types_6() runs on TempComp{
4732 i := { var_part_ptr := 2 ,
4736 opt_part := { { id := 1 , // opt_part := omit
4738 par := { octstr := 'FFFF'O } } ,
4741 par := { rec2:= { bit8 := '00000000'B ,
4743 octN := '1234567890'O } } } , // octN := omit
4746 par := { rec3 := { bit4 := '1111'B ,
4750 oct2 := '1234'O } } } , // oct2 := omit
4753 par := { rec4:= { int := 15 ,
4754 oct5 := '1234567890'O } } } } , // oct5 := omit
4755 EndOP := '00'O } // EndOP = omit
4759 const octetstring o := '0202000102FFFF02070005123456789003048F0F123404060F123456789000'O
4761 if ((enc_RAW_PDU_154(i) == o)and(dec_RAW_PDU_154(o) == i)) {setverdict(pass);}
4762 else {setverdict(fail);}
4764 //==================================
4765 // Test of structured types - 7
4766 //==================================
4768 testcase TC_structured_types_7() runs on TempComp{
4771 i := { var_part_ptr := 2 ,
4775 opt_part := { { id := 1 , // opt_part := omit
4777 par := { octstr := 'FFFF'O } } ,
4780 par := { rec2:= { bit8 := '00000000'B ,
4782 octN := omit } } } ,
4785 par := { rec3 := { bit4 := '1111'B ,
4789 oct2 := omit } } } ,
4792 par := { rec4:= { int := 15 ,
4793 oct5 := omit } } } } ,
4794 EndOP := '00'O } // EndOP = omit
4798 const octetstring o := '0202000102FFFF0202000003028F0F04010F00'O
4800 if ((enc_RAW_PDU_154(i) == o)and(dec_RAW_PDU_154(o) == i)) {setverdict(pass);}
4801 else {setverdict(fail);}
4804 //==================================
4805 // Test of structured types - 8
4806 //==================================
4808 testcase TC_structured_types_8() runs on TempComp{
4811 i := { var_part_ptr := 2 ,
4816 EndOP := '00'O } // EndOP = omit
4818 const octetstring o := '02000000'O
4819 if ((enc_RAW_PDU_154(i) == o)and(dec_RAW_PDU_154(o) == i)) {setverdict(pass);}
4820 else {setverdict(fail);}
4824 //==================================
4825 // Test of structured types - 9
4826 //==================================
4828 testcase TC_structured_types_9() runs on TempComp{
4831 i := { var_part_ptr := 2 ,
4840 const octetstring o := '020000'O
4841 if ((enc_RAW_PDU_154(i) == o)and(dec_RAW_PDU_154(o) == i)) {setverdict(pass);}
4842 else {setverdict(fail);}
4847 //==================================
4848 // Test of structured types - 10
4849 //==================================
4854 type integer Pointer
4855 with { variant "" } ;
4857 type octetstring EndOfOptionalPart
4858 with { variant "FIELDLENGTH(1)" } ;
4860 // type integer INT1_1
4861 // with { variant "" } ;
4863 // type bitstring BIT1_
4864 // with { variant "FIELDLENGTH(1)" } ;
4866 // type bitstring BIT7_
4867 // with { variant "FIELDLENGTH(7)" } ;
4869 // type octetstring OCT3_
4870 // with { variant "FIELDLENGTH(3)" } ;
4873 with { variant "FIELDLENGTH(2)" } ;
4875 type enumerated MessageType
4876 { e1(1), e2(2), e3(3), e4(4), e5(5) }
4877 with { variant "FIELDLENGTH(8)" }
4880 type enumerated ParamName
4881 { name1(1), name2(2), name3(3), name4(4) }
4882 with { variant "FIELDLENGTH(8)" }
4885 { ParamName paramName ,
4886 integer paramLength ,
4892 with {variant (paramLength) "LENGTHTO(octstr , bit7 , bit1 , hexstr , int )" }
4895 { ParamName paramName ,
4896 integer paramLength ,
4902 with {variant (paramLength) "LENGTHTO(octstr , bit7 , bit1 , hexstr , int )" }
4905 { ParamName paramName ,
4906 integer paramLength ,
4912 with {variant (paramLength) "LENGTHTO(octstr , bit7 , bit1 , hexstr , int )" }
4915 { ParamName paramName ,
4916 integer paramLength ,
4922 with {variant (paramLength) "LENGTHTO(octstr , bit7 , bit1 , hexstr , int )" }
4924 type set Optional_part
4925 { Param1 param1 optional ,
4926 Param2 param2 optional ,
4927 Param3 param3 optional ,
4928 Param4 param4 optional }
4929 with { variant "TAG (
4930 param1 , paramName= name1;
4931 param2 , paramName= name2;
4932 param3 , paramName= name3;
4933 param4 , paramName= name4 )" }
4938 { MessageType messageType ,
4948 Optional_part opt_part ,
4949 EndOfOptionalPart eop optional }
4950 with { variant (pointer1) "POINTERTO(length1)";
4951 variant (pointer2) "POINTERTO(opt_part)" ;
4952 variant (length1) "LENGTHTO(octN)"
4954 //Note, that optional part itself is mandatory but it may be empty!
4959 { MessageType messageType ,
4969 Optional_part opt_part ,
4970 EndOfOptionalPart eop optional }
4971 with { variant (pointer1) "POINTERTO(length1)";
4972 variant (pointer2) "POINTERTO(opt_part)" ;
4973 variant (length1) "LENGTHTO(octN)"
4975 //Note, that optional part itself is mandatory but it may be empty!
4980 { MessageType messageType ,
4990 Optional_part opt_part ,
4991 EndOfOptionalPart eop optional }
4992 with { variant (pointer1) "POINTERTO(length1)";
4993 variant (pointer2) "POINTERTO(opt_part)" ;
4994 variant (length1) "LENGTHTO(octN)"
4996 //Note, that optional part itself is mandatory but it may be empty!
5001 { MessageType messageType ,
5011 Optional_part opt_part ,
5012 EndOfOptionalPart eop optional }
5013 with { variant (pointer1) "POINTERTO(length1)";
5014 variant (pointer2) "POINTERTO(opt_part)" ;
5015 variant (length1) "LENGTHTO(octN)"
5017 //Note, that optional part itself is mandatory but it may be empty!
5022 { MessageType messageType ,
5032 Optional_part opt_part ,
5033 EndOfOptionalPart eop optional }
5034 with { variant (pointer1) "POINTERTO(length1)";
5035 variant (pointer2) "POINTERTO(opt_part)" ;
5036 variant (length1) "LENGTHTO(octN)"
5038 //Note, that optional part itself is mandatory but it may be empty!
5042 type union RAW_PDU_155
5048 with { variant "TAG (
5049 elem1 , messageType = e1 ;
5050 elem2 , messageType = e2 ;
5051 elem3 , messageType = e3 ;
5052 elem4 , messageType = e4 ;
5053 elem5 , messageType = e5 ) "
5059 external function enc_RAW_PDU_155(in RAW_PDU_155 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
5060 external function dec_RAW_PDU_155(in octetstring stream) return RAW_PDU_155 with { extension "prototype(convert) decode(RAW)" }
5062 testcase TC_structured_types_10() runs on TempComp{
5065 { messageType := e1 ,
5066 octstr := '123456'O ,
5067 bit7 := '0000000'B ,
5074 octN := '1234567890'O ,
5077 { paramName := name1 ,
5079 octstr := '123456'O ,
5080 bit7 := '0000000'B ,
5085 { paramName := name4 ,
5087 octstr := '123456'O ,
5088 bit7 := '0000000'B ,
5093 { paramName := name3 ,
5095 octstr := '123456'O ,
5096 bit7 := '0000000'B ,
5101 { paramName := name2 ,
5103 octstr := '123456'O ,
5104 bit7 := '0000000'B ,
5112 const octetstring o := '0112345680FF010207051234567890010612345680FF01020612345680FF01030612345680FF01040612345680FF0100'O
5114 if ((enc_RAW_PDU_155(i) == o)and(dec_RAW_PDU_155(o) == i)) {setverdict(pass);}
5115 else {setverdict(fail);}
5118 //=======================================
5119 // Test of structured types - 11
5120 //=======================================
5121 testcase TC_structured_types_11() runs on TempComp{
5124 { messageType := e1 ,
5125 octstr := '123456'O ,
5126 bit7 := '0000000'B ,
5133 octN := '1234567890'O ,
5141 const octetstring o := '0112345680FF010207051234567890'O
5143 if ((enc_RAW_PDU_155(i) == o)and(dec_RAW_PDU_155(o) == i)) {setverdict(pass);}
5144 else {setverdict(fail);}
5147 //=======================================
5148 // Test of structured types - 12
5149 //=======================================
5150 testcase TC_structured_types_12() runs on TempComp{
5153 { messageType := e1 ,
5154 octstr := '123456'O ,
5155 bit7 := '0000000'B ,
5162 octN := '1234567890'O ,
5165 { paramName := name1 ,
5167 octstr := '123456'O ,
5168 bit7 := '0000000'B ,
5173 { paramName := name4 ,
5175 octstr := '123456'O ,
5176 bit7 := '0000000'B ,
5181 { paramName := name3 ,
5183 octstr := '123456'O ,
5184 bit7 := '0000000'B ,
5193 const octetstring o := '0112345680FF010207051234567890010612345680FF01030612345680FF01040612345680FF0100'O
5196 if ((enc_RAW_PDU_155(i) == o)and(dec_RAW_PDU_155(o) == i)) {setverdict(pass);}
5197 else {setverdict(fail);}
5200 //=======================================
5201 // Test of structured types - 13
5202 //=======================================
5203 testcase TC_structured_types_13() runs on TempComp{
5206 { messageType := e2 ,
5207 octstr := '123456'O ,
5208 bit7 := '0000000'B ,
5215 octN := '1234567890'O ,
5218 { paramName := name1 ,
5220 octstr := '123456'O ,
5221 bit7 := '0000000'B ,
5227 { paramName := name3 ,
5229 octstr := '123456'O ,
5230 bit7 := '0000000'B ,
5239 const octetstring o := '0212345680FF010207051234567890010612345680FF01030612345680FF01'O
5241 if ((enc_RAW_PDU_155(i) == o)and(dec_RAW_PDU_155(o) == i)) {setverdict(pass);}
5242 else {setverdict(fail);}
5245 //=======================================
5246 // Test of structured types - 14
5247 //=======================================
5252 // type integer Pointer
5253 // with { variant "" } ;
5255 // type octetstring EndOfOptionalPart
5256 // with { variant "FIELDLENGTH(1)" } ;
5258 // type integer INT1
5259 // with { variant "" } ;
5261 // type bitstring BIT1
5262 // with { variant "FIELDLENGTH(1)" } ;
5264 // type bitstring BIT7
5265 // with { variant "FIELDLENGTH(7)" } ;
5267 // type octetstring OCT3
5268 // with { variant "FIELDLENGTH(3)" } ;
5270 // type hexstring HEX2
5271 // with { variant "FIELDLENGTH(2)" } ;
5273 // type enumerated MessageType
5274 // { e1(1), e2(2), e3(3), e4(4), e5(5) }
5275 // with { variant "FIELDLENGTH(8)" }
5278 // type enumerated ParamName
5279 // { name1(1), name2(2), name3(3), name4(4) }
5280 // with { variant "FIELDLENGTH(8)" }
5282 // type record Param1
5283 // { ParamName paramName ,
5284 // integer paramLength ,
5290 // with {variant (paramLength) "LENGTHTO(octstr , bit7 , bit1 , hexstr , int )" }
5292 // type record Param2
5293 // { ParamName paramName ,
5294 // integer paramLength ,
5300 // with {variant (paramLength) "LENGTHTO(octstr , bit7 , bit1 , hexstr , int )" }
5302 // type record Param3
5303 // { ParamName paramName ,
5304 // integer paramLength ,
5310 // with {variant (paramLength) "LENGTHTO(octstr , bit7 , bit1 , hexstr , int )" }
5314 { BIT1_ field2indic ,
5327 type record Param4_1
5328 { ParamName paramName ,
5329 integer paramLength ,
5334 with { variant (field2) "CROSSTAG(
5335 present_ , field1.field2indic = '1'B ;
5336 absent , field1.field2indic = '0'B ; )" ;
5337 variant (paramLength) "LENGTHTO(field1 , field2 , hexstr , int )" }
5339 type set Optional_part_1
5340 { Param1 param1 optional ,
5341 Param2 param2 optional ,
5342 Param3 param3 optional ,
5343 Param4_1 param4 optional }
5344 with { variant "TAG (
5345 param1 , paramName= name1;
5346 param2 , paramName= name2;
5347 param3 , paramName= name3;
5348 param4 , paramName= name4 )" }
5352 { MessageType messageType ,
5362 Optional_part_1 opt_part ,
5363 EndOfOptionalPart eop optional }
5364 with { variant (pointer1) "POINTERTO(length1)";
5365 variant (pointer2) "POINTERTO(opt_part)" ;
5366 variant (length1) "LENGTHTO(octN)"
5368 //Note, that optional part itself is mandatory but it may be empty!
5373 { MessageType messageType ,
5383 Optional_part_1 opt_part ,
5384 EndOfOptionalPart eop optional }
5385 with { variant (pointer1) "POINTERTO(length1)";
5386 variant (pointer2) "POINTERTO(opt_part)" ;
5387 variant (length1) "LENGTHTO(octN)"
5389 //Note, that optional part itself is mandatory but it may be empty!
5394 { MessageType messageType ,
5404 Optional_part_1 opt_part ,
5405 EndOfOptionalPart eop optional }
5406 with { variant (pointer1) "POINTERTO(length1)";
5407 variant (pointer2) "POINTERTO(opt_part)" ;
5408 variant (length1) "LENGTHTO(octN)"
5410 //Note, that optional part itself is mandatory but it may be empty!
5415 { MessageType messageType ,
5425 Optional_part opt_part ,
5426 EndOfOptionalPart eop optional }
5427 with { variant (pointer1) "POINTERTO(length1)";
5428 variant (pointer2) "POINTERTO(opt_part)" ;
5429 variant (length1) "LENGTHTO(octN)"
5431 //Note, that optional part itself is mandatory but it may be empty!
5436 { MessageType messageType ,
5446 Optional_part opt_part ,
5447 EndOfOptionalPart eop optional }
5448 with { variant (pointer1) "POINTERTO(length1)";
5449 variant (pointer2) "POINTERTO(opt_part)" ;
5450 variant (length1) "LENGTHTO(octN)"
5452 //Note, that optional part itself is mandatory but it may be empty!
5456 type union RAW_PDU_156
5462 with { variant "TAG (
5463 elem1 , messageType = e1 ;
5464 elem2 , messageType = e2 ;
5465 elem3 , messageType = e3 ;
5466 elem4 , messageType = e4 ;
5467 elem5 , messageType = e5 ) "
5470 } with{encode "RAW"}
5472 external function enc_RAW_PDU_156(in RAW_PDU_156 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
5473 external function dec_RAW_PDU_156(in octetstring stream) return RAW_PDU_156 with { extension "prototype(convert) decode(RAW)" }
5475 testcase TC_structured_types_14() runs on TempComp{
5478 { messageType := e2 ,
5479 octstr := '123456'O ,
5480 bit7 := '0000000'B ,
5487 octN := '1234567890'O ,
5490 { paramName := name1 ,
5492 octstr := '123456'O ,
5493 bit7 := '0000000'B ,
5498 { paramName := name4 ,
5501 { field2indic := '1'B ,
5502 field2par := '0000000'B } ,
5504 { present_ := 'FFFFFF'O } ,
5508 { paramName := name3 ,
5510 octstr := '123456'O ,
5511 bit7 := '0000000'B ,
5518 const octetstring o :='0212345680FF010207051234567890010612345680FF01030612345680FF01040601FFFFFF210100'O
5519 if ((enc_RAW_PDU_156(i) == o)and(dec_RAW_PDU_156(o) == i)) {setverdict(pass);}
5520 else {setverdict(fail);}
5523 // Test of structured types - 15
5525 testcase TC_structured_types_15() runs on TempComp{
5528 { messageType := e2 ,
5529 octstr := '123456'O ,
5530 bit7 := '0000000'B ,
5537 octN := '1234567890'O ,
5540 { paramName := name1 ,
5542 octstr := '123456'O ,
5543 bit7 := '0000000'B ,
5548 { paramName := name4 ,
5551 { field2indic := '0'B ,
5552 field2par := '0000000'B } ,
5554 { absent := '000000'O } ,
5558 { paramName := name3 ,
5560 octstr := '123456'O ,
5561 bit7 := '0000000'B ,
5570 const octetstring o :='0212345680FF010207051234567890010612345680FF01030612345680FF01040600000000210100'O
5573 if ((enc_RAW_PDU_156(i) == o)and(dec_RAW_PDU_156(o) == i)) {setverdict(pass);}
5574 else {setverdict(fail);}
5577 //=================================
5578 // Test of structured types - 16
5579 //=================================
5583 type bitstring BIT4_
5584 with { variant "FIELDLENGTH(4)" } ;
5586 type octetstring OCT2_
5587 with { variant "FIELDLENGTH(2)" } ;
5589 // type octetstring OCT3_
5590 // with { variant "FIELDLENGTH(3)" } ;
5606 type record RAW_PDU_157
5610 with { variant (union2) "CROSSTAG(
5611 field1 , id = '0001'B ;
5612 field2 , id = '0010'B ;
5613 field3 , id = '0011'B ;
5614 field4 , { id = '0100'B ,
5617 variant (union1) "CROSSTAG(
5618 field1 , { id = '0001'B ,
5621 field2 , { id = '0100'B ,
5623 id = '0111'B } )" } ;
5627 external function enc_RAW_PDU_157(in RAW_PDU_157 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
5628 external function dec_RAW_PDU_157(in octetstring stream) return RAW_PDU_157 with { extension "prototype(convert) decode(RAW)" }
5630 testcase TC_structured_types_16() runs on TempComp{
5632 i := { id := '0001'B ,
5633 union1 := { field1 := '0000'B } ,
5634 union2 := { field1 := '123456'O } }
5638 const octetstring o :='01123456'O
5640 if ((enc_RAW_PDU_157(i) == o)and(dec_RAW_PDU_157(o) == i)) {setverdict(pass);}
5641 else {setverdict(fail);}
5644 //=================================
5645 // Test of structured types - 17
5646 //=================================
5647 testcase TC_structured_types_17() runs on TempComp{
5649 i := { id := '0111'B ,
5650 union1 := { field2 := '1111'B } ,
5651 union2 := { field4 := '1234'O } }
5655 const octetstring o :='F71234'O
5657 if ((enc_RAW_PDU_157(i) == o)and(dec_RAW_PDU_157(o) == i)) {setverdict(pass);}
5658 else {setverdict(fail);}
5661 //===========================================================
5662 // Testing RAW update
5663 //===========================================================
5665 //=================================
5666 // Raw update test 1
5667 //=================================
5672 // type bitstring BIT4
5673 // with { variant "FIELDLENGTH(4)" } ;
5675 // type octetstring OCT2
5676 // with { variant "FIELDLENGTH(2)" } ;
5686 // type union Union1
5689 // with { variant ""};
5692 type record RAW_PDU_158
5696 with { variant (union2) "CROSSTAG(
5697 field1 , id = '0001'B ;
5698 field2 , id = '0010'B ;
5699 field3 , id = '0011'B ;
5700 field4 , { id = '0100'B ,
5703 variant (union1) "CROSSTAG(
5704 field1 , { id = '0001'B ,
5707 field2 , { id = '0100'B ,
5709 id = '0111'B } )" } ;
5713 external function enc_RAW_PDU_158(in RAW_PDU_158 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
5714 external function dec_RAW_PDU_158(in octetstring stream) return RAW_PDU_158 with { extension "prototype(convert) decode(RAW)" }
5716 testcase TC_Raw_update_test_1() runs on TempComp{
5718 i := { union2 := { field4 := '1234'O } ,
5719 union1 := { field2 := '1111'B },
5722 const octetstring o :='12347F'O
5724 if ((enc_RAW_PDU_158(i) == o )and(dec_RAW_PDU_158(o) == i)) {setverdict(pass);}
5725 else {setverdict(fail);}
5728 //=================================
5729 // Raw update test 2
5730 //=================================
5731 testcase TC_Raw_update_test_2() runs on TempComp{
5733 i := { union2 := { field1 := '1234'O } ,
5734 union1 := { field1 := '1111'B },
5737 const octetstring o :='12341F'O
5739 if ((enc_RAW_PDU_158(i) == o )and(dec_RAW_PDU_158(o) == i)) {setverdict(pass);}
5740 else {setverdict(fail);}
5743 //=================================
5744 // Raw update test 3
5745 //=================================
5749 with { variant "FIELDLENGTH(8)"};
5751 type record RAW_PDU_159
5756 with { variant (union2) "CROSSTAG(
5757 field1 , id = '0001'B ;
5758 field2 , id = '0010'B ;
5759 field3 , id = '0011'B ;
5760 field4 , { id = '0100'B ,
5763 variant (union1) "CROSSTAG(
5764 field1 , { id = '0001'B ,
5767 field2 , { id = '0100'B ,
5769 id = '0111'B } )" } ;
5773 external function enc_RAW_PDU_159(in RAW_PDU_159 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
5774 external function dec_RAW_PDU_159(in octetstring stream) return RAW_PDU_159 with { extension "prototype(convert) decode(RAW)" }
5776 testcase TC_Raw_update_test_3() runs on TempComp{
5779 i := { union2 := { field1 := '1234'O } ,
5780 union1 := { field1 := '1111'B },
5781 outfiller := '00001000'B,
5784 const octetstring o :='12348F10'O
5786 if ((enc_RAW_PDU_159(i) == o )and(dec_RAW_PDU_159(o) == i)) {setverdict(pass);}
5787 else {setverdict(fail);}
5789 //=================================
5790 // Raw update test 4
5791 //=================================
5794 type record RAW_PDU_160
5799 with { variant (union2) "CROSSTAG(
5800 field1 , id = '0001'B ;
5801 field2 , id = '0010'B ;
5802 field3 , id = '0011'B ;
5803 field4 , { id = '0100'B ,
5806 variant (union1) "CROSSTAG(
5807 field1 , { id = '0001'B ,
5810 field2 , { id = '0100'B ,
5812 id = '0111'B } )" } ;
5817 external function enc_RAW_PDU_160(in RAW_PDU_160 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
5818 external function dec_RAW_PDU_160(in octetstring stream) return RAW_PDU_160 with { extension "prototype(convert) decode(RAW)" }
5820 testcase TC_Raw_update_test_4() runs on TempComp{
5823 i := { union2 := { field1 := '1234'O } ,
5824 outfiller := '00001000'B,
5825 union1 := { field1 := '1111'B },
5829 const octetstring o :='1234081F'O
5831 if ((enc_RAW_PDU_160(i) == o )and(dec_RAW_PDU_160(o) == i)) {setverdict(pass);}
5832 else {setverdict(fail);}
5834 //=================================
5835 // Raw update test 5
5836 //=================================
5839 type record RAW_PDU_161
5844 with { variant (union2) "CROSSTAG(
5845 field1 , id = '0001'B ;
5846 field2 , id = '0010'B ;
5847 field3 , id = '0011'B ;
5848 field4 , { id = '0100'B ,
5851 variant (union1) "CROSSTAG(
5852 field1 , { id = '0001'B ,
5855 field2 , { id = '0100'B ,
5857 id = '0111'B } )" } ;
5862 external function enc_RAW_PDU_161(in RAW_PDU_161 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
5863 external function dec_RAW_PDU_161(in octetstring stream) return RAW_PDU_161 with { extension "prototype(convert) decode(RAW)" }
5865 testcase TC_Raw_update_test_5() runs on TempComp{
5868 i := { outfiller := '00001000'B,
5869 union2 := { field1 := '1234'O } ,
5870 union1 := { field1 := '1111'B },
5874 const octetstring o :='0812341F'O
5877 if ((enc_RAW_PDU_161(i) == o )and(dec_RAW_PDU_161(o) == i)) {setverdict(pass);}
5878 else {setverdict(fail);}
5881 //=================================
5882 // Raw update test 6
5883 //=================================
5886 type record RAW_PDU_162
5890 with { variant (union2) "CROSSTAG(
5891 field1 , id = '0001'B ;
5892 field2 , id = '0010'B ;
5893 field3 , id = '0011'B ;
5894 field4 , { id = '0100'B ,
5897 variant (union1) "CROSSTAG(
5898 field1 , { id = '0001'B ,
5901 field2 , { id = '0100'B ,
5903 id = '0111'B } )" } ;
5908 external function enc_RAW_PDU_162(in RAW_PDU_162 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
5909 external function dec_RAW_PDU_162(in octetstring stream) return RAW_PDU_162 with { extension "prototype(convert) decode(RAW)" }
5911 testcase TC_Raw_update_test_6() runs on TempComp{
5914 i := { union2 := { field1 := '1234'O },
5916 union1 := { field1 := '1111'B }
5919 const octetstring o :='1234F1'O
5922 if ((enc_RAW_PDU_162(i) == o )and(dec_RAW_PDU_162(o) == i)) {setverdict(pass);}
5923 else {setverdict(fail);}
5926 //=================================
5927 // Raw update test 7
5928 //=================================
5929 testcase TC_Raw_update_test_7() runs on TempComp{
5932 i := { union2 := { field4 := '1234'O },
5934 union1 := { field2 := '1111'B }
5938 const octetstring o :='1234F5'O
5941 if ((enc_RAW_PDU_162(i) == o )and(dec_RAW_PDU_162(o) == i)) {setverdict(pass);}
5942 else {setverdict(fail);}
5945 //=================================
5946 // Raw update test 8
5947 //=================================
5953 type record RAW_PDU_163
5954 { Union2_1 union2_1,
5960 with { variant (union2_1) "CROSSTAG(
5961 field1 , id = '0001'B ;
5962 field2 , id = '0010'B ;
5963 field3 , id = '0011'B ;
5964 field4 , { id = '0100'B ,
5967 variant (union1_1) "CROSSTAG(
5968 field1 , { id = '0001'B ,
5971 field2 , { id = '0100'B ,
5974 variant (union2_2) "CROSSTAG(field1 , id2 = '0001'B ;
5975 field2 , OTHERWISE)";
5976 variant (union1_2) "CROSSTAG(field1 , id2 = '0001'B ;
5977 field2 , OTHERWISE)" ;
5982 external function enc_RAW_PDU_163(in RAW_PDU_163 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
5983 external function dec_RAW_PDU_163(in octetstring stream) return RAW_PDU_163 with { extension "prototype(convert) decode(RAW)" }
5985 testcase TC_Raw_update_test_8() runs on TempComp{
5988 i := { union2_1 := {field1 := '1234'O },
5989 union2_2 := { field1 := '1234'O},
5990 union1_1 := { field1 := '1111'B },
5992 union1_2 := { field1 := '1111'B},
5997 const octetstring o :='123412341F1F'O
6000 if ((enc_RAW_PDU_163(i) == o )and(dec_RAW_PDU_163(o) == i)) {setverdict(pass);}
6001 else {setverdict(fail);}
6003 //=================================
6004 // Raw update test 9 (OTHERWISE)
6005 //=================================
6011 } with { variant ""};
6014 type record RAW_PDU_164
6019 with { variant (union1) "CROSSTAG(field1 , id2 = '0001'B ;
6020 field2 , OTHERWISE)" ;
6021 variant (union3) "CROSSTAG( field1, id = '0001'B;
6027 external function enc_RAW_PDU_164(in RAW_PDU_164 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6028 external function dec_RAW_PDU_164(in octetstring stream) return RAW_PDU_164 with { extension "prototype(convert) decode(RAW)" }
6030 testcase TC_Raw_update_test_9() runs on TempComp{
6033 i := { id := '0001'B,
6034 union3 := {field1 := '1110'B},
6035 union1 := { field1 := '1111'B},
6039 const octetstring o :='E11F'O
6041 if ((enc_RAW_PDU_164(i) == o )and(dec_RAW_PDU_164(o) == i)) {setverdict(pass);}
6042 else {setverdict(fail);}
6044 //=================================
6045 // Raw update test 10
6046 //=================================
6058 type record RAW_PDU_165
6064 with { variant (union1) "CROSSTAG(field1 , id2 = '0001'B ;
6065 field2 , OTHERWISE)" ;
6066 variant (union3) "CROSSTAG( field1, id = '0001'B;
6067 field2, OTHERWISE)";
6068 variant (union2) "CROSSTAG(field1 , id2 = '0001'B ;
6069 field2 , OTHERWISE)"} ;
6073 external function enc_RAW_PDU_165(in RAW_PDU_165 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6074 external function dec_RAW_PDU_165(in octetstring stream) return RAW_PDU_165 with { extension "prototype(convert) decode(RAW)" }
6076 testcase TC_Raw_update_test_10() runs on TempComp{
6079 i := { union2 := {field1 := '1234'O},
6081 union3 := {field1 := '1110'B},
6082 union1 := { field1 := '1111'B},
6087 const octetstring o :='1234E11F'O
6089 if ((enc_RAW_PDU_165(i) == o )and(dec_RAW_PDU_165(o) == i)) {setverdict(pass);}
6090 else {setverdict(fail);}
6092 //=================================
6093 // Raw update test 11
6094 //=================================
6098 type record RAW_PDU_166
6107 with { variant (union1) "CROSSTAG(field1 , id2 = '0001'B ;
6108 field2 , OTHERWISE)" ;
6109 variant (union3) "CROSSTAG( field1, id = '0001'B;
6110 field2, OTHERWISE)";
6111 variant (union2) "CROSSTAG(field1 , id2 = '0001'B ;
6112 field2 , OTHERWISE)";
6113 variant (union2.field1, union2.field2) "FIELDLENGTH(2)"
6118 external function enc_RAW_PDU_166(in RAW_PDU_166 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6119 external function dec_RAW_PDU_166(in octetstring stream) return RAW_PDU_166 with { extension "prototype(convert) decode(RAW)" }
6121 testcase TC_Raw_update_test_11() runs on TempComp{
6123 i := { union2 := {field1 := '1234'O},
6125 union3 := {field1 := '1110'B},
6126 union1 := { field1 := '1111'B},
6131 const octetstring o :='1234E11F'O
6133 if ((enc_RAW_PDU_166(i) == o )and(dec_RAW_PDU_166(o) == i)) {setverdict(pass);}
6134 else {setverdict(fail);}
6137 //=================================
6138 // Raw update test 12
6139 //=================================
6147 } with { variant "FIELDLENGTH(8)"};
6149 type record RAW_PDU_167{
6153 octetstring id optional
6154 } with { variant (PDU_length) "FIELDLENGTH(16)";
6155 variant (ABCxxxxx) "FIELDLENGTH(8)";
6156 variant (id) "PRESENCE( {
6157 ABCxxxxx = '10000000'B,
6158 ABCxxxxx = '10100000'B} )";
6159 variant (code) "CROSSTAG(
6162 field3, id = '03'O; )"};
6166 external function enc_RAW_PDU_167(in RAW_PDU_167 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6167 external function dec_RAW_PDU_167(in octetstring stream) return RAW_PDU_167 with { extension "prototype(convert) decode(RAW)" }
6169 testcase TC_Raw_update_test_12() runs on TempComp{
6171 i := { code := { field1 := 16},
6172 ABCxxxxx := '00000000'B,
6176 const octetstring o :='10001000'O
6178 log ("enc_RAW_PDU_167(i)= " , enc_RAW_PDU_167(i)) ;
6179 log ("dec_RAW_PDU_167(o)= " , dec_RAW_PDU_167(o)) ;
6181 if ((enc_RAW_PDU_167(i) == o )and(dec_RAW_PDU_167(o) == i)) {setverdict(pass);}
6182 else {setverdict(fail);}
6185 //=================================
6186 // Raw update test 13
6187 //=================================
6189 testcase TC_Raw_update_test_13() runs on TempComp{
6191 i := { code := { field2 := 16},
6192 ABCxxxxx := '10000000'B,
6197 const octetstring o :='1080100002'O
6199 log ("enc_RAW_PDU_167(i)= " , enc_RAW_PDU_167(i)) ;
6200 log ("dec_RAW_PDU_167(o)= " , dec_RAW_PDU_167(o)) ;
6202 if ((enc_RAW_PDU_167(i) == o )and(dec_RAW_PDU_167(o) == i)) {setverdict(pass);}
6203 else {setverdict(fail);}
6206 //=================================
6207 // Raw update test 14
6208 //=================================
6213 enumerated {e1a (0), e1b (1), e1c (2)} E1,
6214 enumerated {e2a (1), e2b (2), e2c (3)} E2,
6215 enumerated {e3a (2), e3b (3), e3c (4), e3d (5)} E3
6216 } with { variant (E1,E2,E3) "FIELDLENGTH(32)";
6217 variant (E1,E2,E3) "BYTEORDER(last)";
6218 variant (E1,E2,E3) "COMP(2scompl)"};
6220 type integer UINT24 (0..16777215)
6221 with {variant "FIELDLENGTH(24)";
6222 variant "BYTEORDER(last)"};
6224 type enumerated Identifier {
6228 } with {variant "FIELDLENGTH(32)";
6229 variant "BYTEORDER(last)";
6230 variant "COMP(2scompl)"};
6232 type record RAW_PDU_168{
6236 Identifier id optional,
6237 octetstring payload optional
6238 } with { variant (ABCxxxxx) "FIELDLENGTH(8)";
6239 variant (id) "PRESENCE( {
6240 ABCxxxxx = '10000000'B,
6241 ABCxxxxx = '10100000'B} )";
6242 variant (code) "CROSSTAG(
6246 variant (PDU_length) "LENGTHTO(code,ABCxxxxx,PDU_length,id,payload)"};
6250 external function enc_RAW_PDU_168(in RAW_PDU_168 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6251 external function dec_RAW_PDU_168(in octetstring stream) return RAW_PDU_168 with { extension "prototype(convert) decode(RAW)" }
6253 testcase TC_Raw_update_test_14() runs on TempComp{
6255 i := { code := {E1 := e1c},
6256 ABCxxxxx := '00000000'B,
6262 const octetstring o :='0000000200000008'O ;
6264 if ((enc_RAW_PDU_168(i) == o )and(dec_RAW_PDU_168(o) == i)) {setverdict(pass);}
6265 else {setverdict(fail);}
6269 //=================================
6270 // Raw update test 15
6271 //=================================
6273 testcase TC_Raw_update_test_15() runs on TempComp{
6275 i := { code := {E2 := e2b},
6276 ABCxxxxx := '10000000'B,
6282 const octetstring o :='000000028000000E00000001ABCD'O ;
6284 if ((enc_RAW_PDU_168(i) == o )and(dec_RAW_PDU_168(o) == i)) {setverdict(pass);}
6285 else {setverdict(fail);}
6288 //=================================
6289 // Raw update test 16
6290 //=================================
6292 testcase TC_Raw_update_test_16() runs on TempComp{
6294 i := { code := {E3 := e3b},
6295 ABCxxxxx := '10100000'B,
6301 const octetstring o :='00000003A000000E00000002ABCD'O ;
6303 if ((enc_RAW_PDU_168(i) == o )and(dec_RAW_PDU_168(o) == i)) {setverdict(pass);}
6304 else {setverdict(fail);}
6309 //=================================
6310 // group raw attribute test 1
6311 //=================================
6314 type integer RAW_PDU_169
6315 } with { encode "RAW";
6316 variant "FIELDLENGTH(8)" ;
6317 variant "COMP( 2scompl ) "
6320 external function enc_RAW_PDU_169(in RAW_PDU_169 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6321 external function dec_RAW_PDU_169(in octetstring stream) return RAW_PDU_169 with { extension "prototype(convert) decode(RAW)" }
6323 testcase TC_group_raw_attribute_test_1() runs on TempComp{
6324 const RAW_PDU_169 i := -2
6325 const octetstring o := 'FE'O
6328 if ((enc_RAW_PDU_169(i) == o)and(dec_RAW_PDU_169(o) == i)) {setverdict(pass);}
6329 else {setverdict(fail);}
6332 //=================================
6333 // group raw attribute test 2
6334 //=================================
6336 type integer RAW_PDU_170
6337 with { encode "RAW";
6338 variant "BITORDERINOCTET(msb)";
6339 variant "BYTEORDER(last)";
6340 variant "ALIGN(left)";
6341 variant "BITORDERINFIELD(msb)";
6342 variant "COMP(signbit)";
6343 variant "FIELDLENGTH(20)" };
6344 external function enc_RAW_PDU_170(in RAW_PDU_170 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6345 external function dec_RAW_PDU_170(in octetstring stream) return RAW_PDU_170 with { extension "prototype(convert) decode(RAW)" }
6347 testcase TC_group_raw_attribute_test_2() runs on TempComp{
6348 const RAW_PDU_170 i := -234
6349 const octetstring o := 'EA0008'O
6351 if ((enc_RAW_PDU_170(i) == o)and(dec_RAW_PDU_170(o) == i)) {setverdict(pass);}
6352 else {setverdict(fail);}
6355 //=================================
6356 // group raw attribute test 3
6357 //=================================
6367 type integer RAW_PDU_171
6368 } with { variant "BITORDERINOCTET(msb)" }
6369 } with { variant "BYTEORDER(last)" }
6370 } with { variant "ALIGN(left)" }
6371 } with { variant "BITORDERINFIELD(msb)" }
6372 } with { variant "COMP(signbit)" }
6373 } with { variant "FIELDLENGTH(20)" }
6374 } with { encode "RAW" }
6376 external function enc_RAW_PDU_171(in RAW_PDU_171 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6377 external function dec_RAW_PDU_171(in octetstring stream) return RAW_PDU_171 with { extension "prototype(convert) decode(RAW)" }
6379 testcase TC_group_raw_attribute_test_3() runs on TempComp{
6380 const RAW_PDU_171 i := -234
6381 const octetstring o := 'EA0008'O
6384 if ((enc_RAW_PDU_171(i) == o)and(dec_RAW_PDU_171(o) == i)) {setverdict(pass);}
6385 else {setverdict(fail);}
6388 //=================================
6389 // group raw attribute test 4
6390 //=================================
6400 type integer RAW_PDU_172
6402 } with { variant "FIELDLENGTH(20)"; variant "COMP(signbit)" }
6403 } with { variant "BITORDERINFIELD(msb)"; variant "ALIGN(left)" }
6404 } with { variant "BITORDERINOCTET(msb)"; variant "BYTEORDER(last)" }
6405 } with { variant "BITORDERINOCTET(lsb)"; variant "BYTEORDER(first)" }
6406 } with { variant "FIELDLENGTH(10)"; variant "COMP(2scompl)" }
6407 } with { variant "BITORDERINFIELD(lsb)"; variant "ALIGN(right)" }
6409 } with { encode "RAW" }
6411 external function enc_RAW_PDU_172(in RAW_PDU_172 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6412 external function dec_RAW_PDU_172(in octetstring stream) return RAW_PDU_172 with { extension "prototype(convert) decode(RAW)" }
6414 testcase TC_group_raw_attribute_test_4() runs on TempComp{
6416 const RAW_PDU_172 i := -234
6417 const octetstring o := 'EA0008'O
6419 if ((enc_RAW_PDU_172(i) == o)and(dec_RAW_PDU_172(o) == i)) {setverdict(pass);}
6420 else {setverdict(fail);}
6423 //=================================
6424 // group raw attribute test 5
6425 //=================================
6431 type integer RAW_PDU_173
6432 with { encode "RAW"; variant "" }
6433 } with { encode "RAW"; variant "FIELDLENGTH(20)"; variant "COMP(signbit)" }
6434 } with { encode "RAW"; variant "BITORDERINFIELD(msb)"; variant "ALIGN(left)" }
6435 } with { encode "RAW"; variant "BITORDERINOCTET(msb)"; variant "BYTEORDER(last)" }
6436 } with { encode "RAW" }
6438 external function enc_RAW_PDU_173(in RAW_PDU_173 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6439 external function dec_RAW_PDU_173(in octetstring stream) return RAW_PDU_173 with { extension "prototype(convert) decode(RAW)" }
6441 testcase TC_group_raw_attribute_test_5() runs on TempComp{
6442 const RAW_PDU_173 i := -234
6443 const octetstring o := 'EA0008'O
6445 if ((enc_RAW_PDU_173(i) == o)and(dec_RAW_PDU_173(o) == i)) {setverdict(pass);}
6446 else {setverdict(fail);}
6450 //=================================
6451 // group raw attribute test 6
6452 //=================================
6459 type integer RAW_PDU_174
6461 } with { variant override "FIELDLENGTH(32)" }
6462 } with { variant "FIELDLENGTH(10)" }
6463 } with { variant override "FIELDLENGTH(8)"; variant "FIELDLENGTH(2)" }
6464 } with { encode "RAW" }
6466 external function enc_RAW_PDU_174(in RAW_PDU_174 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6467 external function dec_RAW_PDU_174(in octetstring stream) return RAW_PDU_174 with { extension "prototype(convert) decode(RAW)" }
6469 testcase TC_group_raw_attribute_test_6() runs on TempComp{
6470 const RAW_PDU_174 i := 255
6471 const octetstring o := 'FF'O
6473 if ((enc_RAW_PDU_174(i) == o)and(dec_RAW_PDU_174(o) == i)) {setverdict(pass);}
6474 else {setverdict(fail);}
6476 //=================================
6477 // group raw attribute test 7
6478 //=================================
6479 external function enc_RAW_PDU_175(in RAW_PDU_175 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
6480 external function dec_RAW_PDU_175(in octetstring stream) return RAW_PDU_175 with { extension "prototype(convert) decode(RAW)" }
6484 type record RAW_PDU_175
6489 with { variant (int1,int2,int3,int4) "FIELDLENGTH(4)";
6490 variant (int1,int2) "PADDING(yes)";
6491 variant (int3,int4) "PADDING(no)"; }
6492 } with { variant "FIELDLENGTH(3)" }
6493 } with {encode "RAW" };
6495 testcase TC_group_raw_attribute_test_7() runs on TempComp{
6502 const octetstring o := '010243'O
6504 if ((enc_RAW_PDU_175(i) == o)and(dec_RAW_PDU_175(o) == i)) {setverdict(pass);}
6505 else {setverdict(fail);}
6509 //=============================================================
6510 // Testing Enc/Dec functions of implicit message encoding
6511 //=============================================================
6512 //=================================
6513 // Fast enc/dec function
6514 //=================================
6517 type integer RAW_PDU_176 with { encode "RAW"; variant "FIELDLENGTH(16)" };
6519 external function enc_RAW_PDU_176(in RAW_PDU_176 pdu, out octetstring stream) with { extension "prototype(fast) encode(RAW)" }
6520 external function dec_RAW_PDU_176(in octetstring stream, out RAW_PDU_176 pdu) with { extension "prototype(fast) decode(RAW)" }
6522 testcase TC_Fast_enc_dec_function() runs on TempComp{
6523 const RAW_PDU_176 i := 255
6524 const octetstring o := 'FF00'O
6526 var octetstring encoded_pdu;
6527 var RAW_PDU_176 decoded_pdu;
6529 enc_RAW_PDU_176(i, encoded_pdu);
6530 dec_RAW_PDU_176(o, decoded_pdu);
6532 if ( encoded_pdu == o and decoded_pdu == i ) {setverdict(pass);}
6533 else {setverdict(fail);}
6535 //=================================================
6536 // Implicit message encoding: prototype backtrack
6537 //=================================================
6539 external function dec_RAW_PDU_177(in octetstring stream, out RAW_PDU_177 pdu) return integer
6540 with { extension "prototype(backtrack) decode(RAW) errorbehavior(ALL:WARNING)" }
6542 type integer RAW_PDU_177 with { encode "RAW"; variant "FIELDLENGTH(16)" };
6545 testcase TC_Backtrack_decode_function() runs on TempComp{
6546 const RAW_PDU_177 i := 255
6547 const octetstring o1 := 'FF00'O
6548 const octetstring o2 := '12'O
6550 var RAW_PDU_177 decoded_pdu;
6551 var integer ret_val;
6553 ret_val := dec_RAW_PDU_177(o1, decoded_pdu);
6554 if (ret_val==0 and decoded_pdu==i) {setverdict(pass);}
6555 else {setverdict(fail);}
6557 ret_val := dec_RAW_PDU_177(o2, decoded_pdu);
6558 if (ret_val==1) {setverdict(pass);} else {setverdict(fail);}
6561 //=================================================
6562 // Sliding decode function
6563 //=================================================
6566 type integer RAW_PDU_178 with { encode "RAW"; variant "FIELDLENGTH(16)" };
6568 external function dec_RAW_PDU_178(inout octetstring stream, out RAW_PDU_178 pdu) return integer
6569 with { extension "prototype(sliding) decode(RAW) errorbehavior(ALL:WARNING)" }
6571 testcase TC_Sliding_decode_function() runs on TempComp{
6572 const RAW_PDU_178 i := 255
6573 var octetstring o1 := 'FF00'O;
6574 var octetstring o2 := '12'O;
6575 var RAW_PDU_178 decoded_pdu;
6576 var integer ret_val;
6578 ret_val := dec_RAW_PDU_178(o1, decoded_pdu);
6579 if (ret_val==0 and decoded_pdu==i) {setverdict(pass);}
6580 else {setverdict(fail);}
6582 ret_val := dec_RAW_PDU_178(o2, decoded_pdu);
6583 if (ret_val>0) {setverdict(pass);} else {setverdict(fail);}
6586 //---------------------------------------------------------------------*
6587 // Testing limits of codec
6588 //---------------------------------------------------------------------*
6590 //=================================================
6591 // Decoding empty octetstring to PDU
6592 //=================================================
6594 type record RAW_PDU_179 {
6598 } with { encode "RAW" variant "" }
6600 external function decodePDU(inout octetstring os, out RAW_PDU_179 pdu) return integer
6601 with { extension "prototype(sliding) decode(RAW) errorbehavior(ALL:WARNING)" }
6603 testcase TC_Decoding_empty_octetstring() runs on TempComp{
6604 var octetstring os := ''O;
6605 var RAW_PDU_179 pdu;
6606 var integer ret_val := decodePDU(os, pdu);
6607 if (ret_val>0) {setverdict(pass);} else {setverdict(fail);}
6610 //---------------------------------------------------------------------*
6611 // Testing encoding/decoding of big integers
6612 //---------------------------------------------------------------------*
6613 //=================================================
6614 // encoding/decoding of big integer variables
6615 //=================================================
6619 variant "FIELDLENGTH(128)"
6620 variant "COMP(nosign)"
6621 variant "BITORDERINFIELD(lsb)"
6622 variant "PADDING(dword32)"
6627 variant "FIELDLENGTH(96)"
6628 variant "COMP(signbit)"
6629 variant "BITORDERINFIELD(lsb)"
6630 variant "PADDING(dword32)"
6633 external function enc_raw3(in myint3 r) return octetstring
6634 with { extension "encode(RAW) prototype(convert) errorbehavior(ALL:WARNING)" }
6635 external function dec_raw3(in octetstring r) return myint3
6636 with { extension "decode(RAW) prototype(convert) errorbehavior(ALL:WARNING)" }
6637 external function enc_raw2(in myint2 r) return octetstring
6638 with { extension "encode(RAW) prototype(convert) errorbehavior(ALL:WARNING)" }
6639 external function dec_raw2(in octetstring r) return myint2
6640 with { extension "decode(RAW) prototype(convert) errorbehavior(ALL:WARNING)" }
6642 testcase TC_encoding_decoding_of_big_integers() runs on TempComp{
6643 var myint3 v1 := -4294967296
6644 var myint3 v2 := -2147483647
6645 var myint3 v3 := 34359738368
6646 var myint3 v4 := 4398046511104
6647 var myint3 v5 := -140737488355328
6648 var myint3 v6 := 4294967296
6649 var myint3 v7 := 4294967295
6650 var myint3 v8 := -4294967295
6651 var myint3 v9 := 4294967297
6652 var myint3 v10 := -4294967297
6653 var myint3 v11 := 2147483647
6654 var myint3 v12 := -2147483648
6655 var myint3 v13 := 2147483648
6656 var myint3 v14 := -2147483649
6657 var myint3 v15 := 2147483649
6658 var myint2 v16 := -4294967296
6659 var myint2 v17 := 2147483647
6660 var myint2 v18 := 34359738368
6661 var myint2 v19 := 4398046511104
6663 o := enc_raw3(v1);if (v1 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6664 o := enc_raw3(v2);if (v2 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6665 o := enc_raw3(v3);if (v3 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6666 o := enc_raw3(v4);if (v4 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6667 o := enc_raw3(-140737488355328);if (v5 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6668 o := enc_raw3(v6);if (v6 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6669 o := enc_raw3(v7);if (v7 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6670 o := enc_raw3(v8);if (v8 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6671 o := enc_raw3(v9);if (v9 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6672 o := enc_raw3(v10);if (v10 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6673 o := enc_raw3(v11);if (v11 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6674 o := enc_raw3(v12);if (v12 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6675 o := enc_raw3(v13);if (v13 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6676 o := enc_raw3(v14);if (v14 == dec_raw3(o)) {setverdict(pass)} else {setverdict(fail)}
6678 //=================================================
6679 // Encoding/decoding records with big integer fields
6680 //=================================================
6682 external function enc_raw(in rec_raw1 r) return octetstring
6683 with { extension "encode(RAW) prototype(convert) errorbehavior(ALL:WARNING)" }
6684 external function dec_raw(in octetstring r) return rec_raw1
6685 with { extension "decode(RAW) prototype(convert) errorbehavior(ALL:WARNING)" }
6689 variant "FIELDLENGTH(256)"
6690 variant "COMP(2scompl)"
6691 variant "BITORDERINFIELD(lsb)"
6692 variant "PADDING(dword32)"
6693 encode "RAW" } // The script eats the trailing '}' in a new line.
6695 type record rec_raw1 {
6698 } with { variant "" encode "RAW" }
6701 testcase TC_encoding_decoding_records_with_big_integer_fields() runs on TempComp{
6702 var rec_raw1 myrec1 := {int1 := -12345678910111213141516, int2 := -3}
6703 var rec_raw1 myrec2 := {int1 := -11111111111111111111111, int2 := -11111111111111111111111}
6704 var rec_raw1 myrec3 := {int1 := -2147483648, int2 := -4294967296}
6705 var rec_raw1 myrec4 := {int1 := 2147483648, int2 := -4294967296}
6706 var rec_raw1 myrec5 := {int1 := -2147483649, int2 := 2147483649}
6707 var rec_raw1 myrec6 := {int1 := -1234, int2 := -4321}
6709 o := enc_raw(myrec1);if (myrec1 == dec_raw(o)) {setverdict(pass)} else {setverdict(fail)}
6710 o := enc_raw(myrec2);if (myrec2 == dec_raw(o)) {setverdict(pass)} else {setverdict(fail)}
6711 o := enc_raw(myrec3);if (myrec3 == dec_raw(o)) {setverdict(pass)} else {setverdict(fail)}
6712 o := enc_raw(myrec4);if (myrec4 == dec_raw(o)) {setverdict(pass)} else {setverdict(fail)}
6713 o := enc_raw(myrec5);if (myrec5 == dec_raw(o)) {setverdict(pass)} else {setverdict(fail)}
6714 o := enc_raw(myrec6);if (myrec6 == dec_raw(o)) {setverdict(pass)} else {setverdict(fail)}
6717 //=================================================
6718 // Multiple optional fields (R8G FOA bug)
6719 //=================================================
6721 external function enc_PDU_GTPCv2(in PDU_GTPCv2 pdu) return octetstring
6722 with { extension "prototype(convert)" extension "encode(RAW)" }
6724 external function dec_PDU_GTPCv2(in octetstring stream) return PDU_GTPCv2
6725 with { extension "prototype(convert)" extension "decode(RAW)" }
6727 type bitstring BIT5 length(5) with { encode "RAW" variant "FIELDLENGTH(5)" };
6729 type octetstring OCT1_ length(1) with { encode "RAW" variant "FIELDLENGTH(1)" };
6730 type octetstring OCT4 length(4) with { encode "RAW" variant "FIELDLENGTH(4)" };
6731 type integer LIN1 (0..255) with { encode "RAW" variant "FIELDLENGTH(8)" };
6733 type integer LIN2_BO_LAST (0..65535) with { encode "RAW" variant "FIELDLENGTH(16), COMP(nosign), BYTEORDER(last)" };
6736 OCT1_ elementIdentifier, //dec 2, '02'O
6737 LIN2_BO_LAST lengthIndicator,
6745 OCT1_ typeOfOffendingIE optional,
6746 LIN2_BO_LAST lengthIndicator2 optional,
6747 BIT4 instanceOfOffendingIE optional,
6748 BIT4 spare3 optional
6749 } with { encode "RAW"
6750 variant "PRESENCE (elementIdentifier = '02'O; )"
6751 variant (lengthIndicator) "LENGTHTO(causeValue,cS,bCE,pCE,spare2,typeOfOffendingIE,
6752 lengthIndicator2,instanceOfOffendingIE,spare3 )" };
6754 type record Recovery {
6755 OCT1_ elementIdentifier, // dec 3, '03'O
6756 LIN2_BO_LAST lengthIndicator,
6759 integer recoveryValue
6760 } with { encode "RAW"
6761 variant (lengthIndicator) "LENGTHTO(recoveryValue)"
6762 variant "PRESENCE (elementIdentifier = '03'O; )" };
6764 type set of ProtocolID_or_ContainerID ProtocolIDs_and_ContainerIDs;
6766 type record ProtocolID_or_ContainerID {
6767 OCT2 protocolID_or_ContainerID,
6768 LIN1 lengthIndicator,
6769 octetstring protID_orContID_Contents
6770 } with { encode "RAW"
6771 variant (lengthIndicator) "LENGTHTO (protID_orContID_Contents)"};
6773 type record ProtocolConfigOptions {
6774 OCT1_ elementIdentifier, // dec 78 '4E'O;
6775 LIN2_BO_LAST lengthIndicator,
6778 BIT3 configProtocol,
6779 BIT4 spare2, //'0000'B
6780 BIT1 extensionField, //'1'B
6781 ProtocolIDs_and_ContainerIDs protocolIDs_and_ContainerIDs optional
6782 } with { encode "RAW"
6783 variant (lengthIndicator) "LENGTHTO(configProtocol,spare2,extensionField,protocolIDs_and_ContainerIDs)"
6784 variant "PRESENCE (elementIdentifier = '4E'O; )" };
6786 type record PrivateExtension {
6787 OCT1_ elementIdentifier, // dec 255, 'FF'O
6788 LIN2_BO_LAST lengthIndicator,
6791 integer enterpriseID,
6792 octetstring proprietartyValue
6793 } with { encode "RAW"
6794 variant (lengthIndicator) "LENGTHTO(enterpriseID,proprietartyValue)";
6795 variant "PRESENCE (elementIdentifier = 'FF'O;)"; };
6797 type set DeleteSessionResponse {
6799 Recovery recovery optional,
6800 ProtocolConfigOptions protocolConfigOptions optional,
6801 PrivateExtension privateExtension optional };
6803 type union GTPCv2_PDUs {
6804 DeleteSessionResponse deleteSessionResponse };
6806 type record PDU_GTPCv2 {
6810 BIT3 version, //'010'B
6812 LIN2_BO_LAST lengthf,
6814 OCT3 sequenceNumber,
6816 GTPCv2_PDUs gtpcv2_pdu,
6817 PDU_GTPCv2 piggybackPDU_GTPCv2 optional
6818 } with { encode "RAW"
6819 variant (tEID) "PRESENCE(t_Bit = '1'B)";
6820 variant (piggybackPDU_GTPCv2) "PRESENCE(p_Bit = '1'B)";
6821 variant (lengthf) "LENGTHTO(tEID,sequenceNumber,spare3,gtpcv2_pdu)";
6822 variant (gtpcv2_pdu) "CROSSTAG(
6823 deleteSessionResponse, messageType = '25'O; //37
6826 testcase TC_Multiple_optional_fields() runs on TempComp{
6827 var PDU_GTPCv2 vl_temp := dec_PDU_GTPCv2( '48250013800000000249BF000200020010000300010011'O );
6831 //===========================================
6833 //===========================================
6835 execute (TC_FIELDLENGTH_16_for_integer());
6836 execute (TC_FIELDLENGTH_8_for_integer());
6837 execute (TC_FIELDLENGTH_4_for_integer());
6838 execute (TC_FIELDLENGTH_16_for_integer_2());
6839 execute (TC_FIELDLENGTH_32_for_integer_1_bit_long());
6840 execute (TC_Default_FIELDLENGTH_for_integer());
6841 execute (TC_FIELDLENGTH_8_for_bitstring());
6842 execute (TC_FIELDLENGTH_8_for_bitstring_4_bits_long());
6843 execute (TC_FIELDLENGTH_4_for_bitstring());
6844 execute (TC_FIELDLENGTH_16_for_bitstring());
6845 execute (TC_FIELDLENGTH_24_for_bitstring());
6846 execute (TC_FIELDLENGTH_0_for_bitstring());
6847 execute (TC_DEFAULT_FIELDLENGTH_for_bitstring());
6848 execute (TC_FIELDLENGTH_32_for_bitstring_4_bits_long());
6849 execute (TC_FIELDLENGTH_1_for_octetstring());
6850 execute (TC_FIELDLENGTH_2_for_octetstring());
6851 execute (TC_FIELDLENGTH_2_and_BYTEORDER_first_for_octetstring());
6852 execute (TC_FIELDLENGTH_2_and_BYTEORDER_last_for_octetstring());
6853 execute (TC_FIELDLENGTH_4_and_BYTEORDER_first_for_octetstring());
6854 execute (TC_FIELDLENGTH_4_for_octetstring_3_octets_long());
6855 execute (TC_FIELDLENGTH_5_for_octetstring_2_octets_long());
6856 execute (TC_FIELDLENGTH_4_and_BYTEORDER_last_for_octetstring());
6857 execute (TC_FIELDLENGTH_4_and_BYTEORDER_last_for_octetstring_3_octets_long());
6858 execute (TC_Default_FIELDLENGTH_for_octetstring());
6859 execute (TC_FIELDLENGTH_0_for_octetstring());
6860 execute (TC_FIELDLENGTH_4_for_hexstring());
6861 execute (TC_FIELDLENGTH_8_for_hexstring());
6862 execute (TC_DEFAULT_FIELDLENGTH_for_hexstring());
6863 execute (TC_FIELDLENGTH_0_for_hexstring());
6864 execute (TC_FIELDLENGTH_12_for_hexstring_2_hex_long());
6865 execute (TC_FIELDLENGTH_4_for_enumerated());
6866 execute (TC_FIELDLENGTH_32_for_enumerated());
6867 execute (TC_Default_FIELDLENGTH_for_enumerated());
6868 execute (TC_FIELDLENGTH_with_length_restriction_bitstring());
6869 execute (TC_FIELDLENGTH_with_length_restriction_hexstring());
6870 execute (TC_FIELDLENGTH_with_length_restriction_octetstring());
6871 execute (TC_FIELDLENGTH_with_length_restriction_record());
6872 execute (TC_FIELDLENGTH_with_length_restriction_record_of());
6873 execute (TC_FIELDLENGTH_with_length_restriction_set());
6874 execute (TC_FIELDLENGTH_with_length_restriction_set_of());
6875 execute (TC_FIELDLENGTH_with_length_restriction_and_align_bitstring());
6876 execute (TC_FIELDLENGTH_with_length_restriction_and_align_hexstring());
6877 execute (TC_FIELDLENGTH_with_length_restriction_and_align_octetstring());
6878 execute (TC_BYTEORDER_first_for_integer_0());
6879 execute (TC_BYTEORDER_first_for_integer_1());
6880 execute (TC_BYTEORDER_first_for_integer_18());
6881 execute (TC_BYTEORDER_first_and_fieldlength_8_for_integer());
6882 execute (TC_BYTEORDER_first_and_fieldlength_16_for_integer());
6883 execute (TC_BYTEORDER_last_for_integer_0());
6884 execute (TC_BYTEORDER_last_for_integer_1());
6885 execute (TC_BYTEORDER_last_for_integer_18());
6886 execute (TC_BYTEORDER_last_and_fieldlength_8_for_integer());
6887 execute (TC_BYTEORDER_last_and_fieldlength_16_for_integer());
6888 execute (TC_BYTEORDER_first_for_bitstring());
6889 execute (TC_BYTEORDER_last_for_bitstring());
6890 execute (TC_BYTEORDER_first_for_octetstring());
6891 execute (TC_BYTEORDER_last_for_octetstring());
6892 execute (TC_BYTEORDER_first_for_enumerated());
6893 execute (TC_BYTEORDER_last_for_enumerated());
6894 execute (TC_BYTEORDER_first_for_hexstring());
6895 execute (TC_BYTEORDER_last_for_hexstring());
6896 execute(TC_BITORDERINFIELD_lsb_for_integer_8());
6897 execute(TC_BITORDERINFIELD_msb_for_integer_8());
6898 execute(TC_BITORDERINFIELD_lsb_for_integer_16());
6899 execute(TC_BITORDERINFIELD_msb_for_integer_16());
6900 execute(TC_BITORDERINFIELD_lsb_for_octetstring_1());
6901 execute(TC_BITORDERINFIELD_msb_for_octetstring_1());
6902 execute(TC_BITORDERINFIELD_lsb_for_octetstring_2());
6903 execute(TC_BITORDERINFIELD_msb_for_octetstring_2());
6904 execute(TC_BITORDERINFIELD_lsb_for_bitstring_8());
6905 execute(TC_BITORDERINFIELD_msb_for_bitstring_8());
6906 execute(TC_BITORDERINFIELD_lsb_for_bitstring_16());
6907 execute(TC_BITORDERINFIELD_msb_for_bitstring_16());
6908 execute(TC_BITORDERINFIELD_lsb_for_enumerated_4());
6909 execute(TC_BITORDERINFIELD_msb_for_enumerated_8());
6910 execute(TC_BITORDERINFIELD_lsb_for_hexstring());
6911 execute(TC_BITORDERINFIELD_msb_for_hexstring());
6912 execute(TC_BITORDERINOCTET_lsb_for_integer_8());
6913 execute(TC_BITORDERINOCTET_msb_for_integer_8());
6914 execute(TC_BITORDERINOCTET_lsb_for_integer_16());
6915 execute(TC_BITORDERINOCTET_msb_for_integer_16());
6916 execute(TC_BITORDERINOCTET_lsb_for_octetstring_1());
6917 execute(TC_BITORDERINOCTET_msb_for_octetstring_1());
6918 execute(TC_BITORDERINOCTET_lsb_for_octetstring_2());
6919 execute(TC_BITORDERINOCTET_msb_for_octetstring_2());
6920 execute(TC_BITORDERINOCTET_lsb_for_bitstring_8());
6921 execute(TC_BITORDERINOCTET_msb_for_bitstring_8());
6922 execute(TC_BITORDERINOCTET_lsb_for_bitstring_16());
6923 execute(TC_BITORDERINOCTET_msb_for_bitstring_16());
6924 execute(TC_BITORDERINOCTET_lsb_for_enumerated());
6925 execute(TC_BITORDERINOCTET_msb_for_enumerated());
6926 execute(TC_BITORDERINOCTET_lsb_for_hexstring());
6927 execute(TC_BITORDERINOCTET_msb_for_hexstring());
6928 execute(TC_COMP_nosign_for_positive_integer_8());
6929 execute(TC_COMP_signbit_for_positive_integer_8());
6930 execute(TC_COMP_signbit_for_negative_integer_8());
6931 execute(TC_COMP_2scompl_for_positive_integer_8());
6932 execute(TC_COMP_2scompl_for_negative_integer_8());
6933 execute(TC_PADDING_for_integer()); //100
6934 execute(TC_PADDING_for_bitstring());
6935 execute(TC_PADDING_for_enumerated());
6936 execute(TC_PADDING_for_hexstring());
6937 execute(TC_PREPADDING_yes_for_bitstring());
6938 execute(TC_PREPADDING_yes_for_hexstring());
6939 execute(TC_PREPADDING_word16_for_octetstring());
6940 execute(TC_PREPADDING_word16_for_record_of());
6941 execute(TC_PREPADDING_dword32_for_set_of());
6942 execute(TC_PREPADDING_dword32_for_record());
6943 execute(TC_PREPADDING_word16_for_set());
6944 execute(TC_PREPADDING_word16_for_union());
6945 execute(TC_PADDING_PATTERN_for_record_of());
6946 execute(TC_PADDING_PATTERN_for_set_of());
6947 execute(TC_PADDING_PATTERN_for_record());
6948 execute(TC_PADDING_PATTERN_for_set());
6949 execute(TC_PADDING_PATTERN_for_union());
6950 execute(TC_PADDALL_with_PADDING_Attribute_record());
6951 execute(TC_PADDALL_with_PADDING_Attribute_set());
6952 execute(TC_PADDALL_with_PREPADDING_Attribute_record());
6953 execute(TC_PADDALL_with_PREPADDING_Attribute_set());
6954 execute(TC_PTROFFSET_is_set_to_default_base());//120
6955 execute(TC_PTROFFSET_is_set_to_the_beginning_of_record());
6956 execute(TC_PTROFFSET_is_set_to_data_field());
6957 execute(TC_HEXORDER_low_for_hexstring());
6958 execute(TC_HEXORDER_high_for_hexstring());
6959 execute(TC_EXTENSION_BIT_no_for_octetstring());
6960 execute(TC_EXTENSION_BIT_yes_for_octetstring());
6961 execute(TC_EXTENSION_BIT_reverse_for_octetstring());
6962 execute(TC_EXTENSION_BIT_yes_for_record_of_octetstring());
6963 execute(TC_EXTENSION_BIT_no_for_record_of_octetstring());
6964 execute(TC_EXTENSION_BIT_yes_for_record_of_bitstring());
6965 execute(TC_EXTENSION_BIT_reverse_for_record_of_bitstring());
6966 execute(TC_EXTENSION_BIT_yes_for_set_of_bitstring());
6967 execute(TC_EXTENSION_BIT_reverse_for_set_of_bitstring());
6968 execute(TC_EXTENSION_BIT_yes_for_set_of_hexstring());
6969 execute(TC_EXTENSION_BIT_reverse_for_set_of_hexstring());
6970 execute(TC_record_with_EXTENSION_BIT_1());
6971 execute(TC_record_with_EXTENSION_BIT_2());
6972 execute(TC_record_with_EXTENSION_BIT_3());
6973 execute(TC_record_with_EXTENSION_BIT_4());
6974 execute(TC_record_with_EXTENSION_BIT_5());
6975 execute(TC_record_with_EXTENSION_BIT_6());
6976 execute(TC_record_with_EXTENSION_BIT_7());
6977 execute(TC_record_with_EXTENSION_BIT_8());
6978 execute(TC_record_with_EXTENSION_BIT_9());
6979 execute(TC_EXTENSION_BIT_GROUP_no());
6980 execute(TC_EXTENSION_BIT_GROUP_yes());
6981 execute(TC_EXTENSION_BIT_GROUP_yes_2_groups());
6982 execute(TC_EXTENSION_BIT_GROUP_yes_reverse_2_groups());
6983 execute(TC_ALIGN_right_for_octetstring());
6984 execute(TC_ALIGN_left_for_octetstring());
6985 execute(TC_ALIGN_right_for_bitstring());
6986 execute(TC_ALIGN_left_for_bitstring());
6987 execute(TC_record_with_integer_and_octetstring());
6988 execute(TC_record_with_default_values_in_field());
6989 execute(TC_record_with_bitstring());
6990 execute(TC_record_with_enumerated_and_fieldlength_calculation());
6991 execute(TC_record_called_from_record());
6992 execute(TC_union_called_from_record_with_CROSSTAG());
6993 execute(TC_union_called_from_record_with_CROSSTAG_OTHERWISE());
6994 execute(TC_record_without_specifying_the_default_attributes_for_fields());
6995 execute(TC_record_of_called_from_record());
6996 execute(TC_set_with_TAG());
6997 execute(TC_union_with_TAG_first_element_called());
6998 execute(TC_union_with_TAG_second_element_called());
6999 execute(TC_union_with_TAG_third_element_called());
7000 execute(TC_union_with_TAG_third_element_called_with_OTHERWISE());
7001 execute(TC_set_of_called_from_record());
7002 execute(TC_record_with_optional_field_with_PRESENCE());
7003 execute(TC_record_with_UNIT());
7004 execute(TC_record_with_PTRUNIT());
7005 execute(TC_record_with_PTROFFSET());
7006 execute(TC_structured_types_1());
7007 execute(TC_structured_types_2());
7008 execute(TC_structured_types_3());
7009 execute(TC_structured_types_4());
7010 execute(TC_structured_types_5());
7011 execute(TC_structured_types_6());
7012 execute(TC_structured_types_7());
7013 execute(TC_structured_types_8());
7014 execute(TC_structured_types_9());
7015 execute(TC_structured_types_10());
7016 execute(TC_structured_types_11());
7017 execute(TC_structured_types_12());
7018 execute(TC_structured_types_13());
7019 execute(TC_structured_types_14());
7020 execute(TC_structured_types_15());
7021 execute(TC_structured_types_16());
7022 execute(TC_structured_types_17());
7023 execute(TC_Raw_update_test_1());
7024 execute(TC_Raw_update_test_2());
7025 execute(TC_Raw_update_test_3());
7026 execute(TC_Raw_update_test_4());
7027 execute(TC_Raw_update_test_5());
7028 execute(TC_Raw_update_test_6());
7029 execute(TC_Raw_update_test_7());
7030 execute(TC_Raw_update_test_8());
7031 execute(TC_Raw_update_test_9());
7032 execute(TC_Raw_update_test_10());
7033 execute(TC_Raw_update_test_11());
7034 execute(TC_Raw_update_test_12());
7035 execute(TC_Raw_update_test_13());
7036 execute(TC_Raw_update_test_14());
7037 execute(TC_Raw_update_test_15());
7038 execute(TC_Raw_update_test_16());
7039 execute(TC_group_raw_attribute_test_1());
7040 execute(TC_group_raw_attribute_test_2());
7041 execute(TC_group_raw_attribute_test_3());
7042 execute(TC_group_raw_attribute_test_4());
7043 execute(TC_group_raw_attribute_test_5());
7044 execute(TC_group_raw_attribute_test_6());
7045 execute(TC_group_raw_attribute_test_7());
7046 execute(TC_Fast_enc_dec_function());
7047 execute(TC_Backtrack_decode_function());
7048 execute(TC_Sliding_decode_function());
7049 execute(TC_Decoding_empty_octetstring());
7050 execute(TC_encoding_decoding_of_big_integers());
7051 execute(TC_encoding_decoding_records_with_big_integer_fields());
7052 execute(TC_Multiple_optional_fields()); //FOA bug
7057 Overall verdict: pass
7063 .*---------------------------------------------------------------------*
7064 :h3. FIELDLENGTH(1) for longer integer
7065 .*---------------------------------------------------------------------*
7068 <TC- FIELDLENGTH(1) for longer integer>
7072 external function enc_RAW_PDU(in RAW_PDU pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
7073 external function dec_RAW_PDU(in octetstring stream) return RAW_PDU with { extension "prototype(convert) decode(RAW)" }
7075 type integer RAW_PDU
7076 with { encode "RAW"; variant "FIELDLENGTH(1)"};
7078 const RAW_PDU i := 15
7079 const octetstring o := '0F'O
7083 log ("enc_RAW_PDU(i)= " , enc_RAW_PDU(i)) ;
7084 log ("dec_RAW_PDU(o)= " , dec_RAW_PDU(o)) ;
7086 if ((enc_RAW_PDU(i) == o)and(dec_RAW_PDU(o) == i)) {setverdict(pass);}
7087 else {setverdict(fail);}
7091 Overall verdict: error
7097 .*---------------------------------------------------------------------*
7098 :h3. FIELDLENGTH(4) for longer bitstring
7099 .*---------------------------------------------------------------------*
7102 <TC- FIELDLENGTH(4) for longer bitstring>
7106 external function enc_RAW_PDU(in RAW_PDU pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
7107 external function dec_RAW_PDU(in octetstring stream) return RAW_PDU with { extension "prototype(convert) decode(RAW)" }
7109 type bitstring RAW_PDU
7110 with { encode "RAW"; variant "FIELDLENGTH(4)"};
7112 const RAW_PDU i := '11111111'B
7113 const octetstring o := 'FF'O
7117 log ("enc_RAW_PDU(i)= " , enc_RAW_PDU(i)) ;
7118 log ("dec_RAW_PDU(o)= " , dec_RAW_PDU(o)) ;
7120 if ((enc_RAW_PDU(i) == o)and(dec_RAW_PDU(o) == i)) {setverdict(pass);}
7121 else {setverdict(fail);}
7125 Overall verdict: error
7132 .*---------------------------------------------------------------------*
7133 :h3. FIELDLENGTH(2) for hexstring longer
7134 .*---------------------------------------------------------------------*
7137 <TC- FIELDLENGTH(2) for hexstring longer>
7141 external function enc_RAW_PDU(in RAW_PDU pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
7142 external function dec_RAW_PDU(in octetstring stream) return RAW_PDU with { extension "prototype(convert) decode(RAW)" }
7144 type hexstring RAW_PDU
7146 variant "FIELDLENGTH(2)"};
7148 const RAW_PDU i := '1234'H
7149 const octetstring o := '1234'O
7153 log ("enc_RAW_PDU(i)= " , enc_RAW_PDU(i)) ;
7154 log ("dec_RAW_PDU(o)= " , dec_RAW_PDU(o)) ;
7156 if ((enc_RAW_PDU(i) == o)and(dec_RAW_PDU(o) == i)) {setverdict(pass);}
7157 else {setverdict(fail);}
7161 Overall verdict: error
7167 .*---------------------------------------------------------------------*
7168 :h2.Testing COMP Attribute
7169 .*---------------------------------------------------------------------*
7171 .*---------------------------------------------------------------------*
7172 :h3. COMP ( nosign ) for negative integer
7173 .*---------------------------------------------------------------------*
7176 <TC- COMP ( nosign ) for negative integer >
7180 external function enc_RAW_PDU(in RAW_PDU pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
7181 external function dec_RAW_PDU(in octetstring stream) return RAW_PDU with { extension "prototype(convert) decode(RAW)" }
7183 type integer RAW_PDU
7184 with { encode "RAW";
7185 variant "FIELDLENGTH(8)" ;
7186 variant "COMP( nosign ) "
7189 const RAW_PDU i := -2
7190 const octetstring o := '02'O
7194 log ("enc_RAW_PDU(i)= " , enc_RAW_PDU(i)) ;
7195 log ("dec_RAW_PDU(o)= " , dec_RAW_PDU(o)) ;
7197 if ((enc_RAW_PDU(i) == o)and(dec_RAW_PDU(o) == i)) {setverdict(pass);}
7198 else {setverdict(fail);}
7202 Overall verdict: error
7208 .*---------------------------------------------------------------------*
7209 :h3. HO79315: Segfault on unbound octetstring
7210 .*---------------------------------------------------------------------*
7213 <TC- HO79315: Segfault on unbound octetstring>
7217 type octetstring raw_pdu_octetstring with { encode "RAW"; variant "FIELDLENGTH(1)"};
7219 external function enc_raw_pdu_octetstring(in raw_pdu_octetstring pdu) return octetstring with { extension "prototype(convert) encode(RAW)" }
7220 external function dec_raw_pdu_octetstring(in octetstring stream) return raw_pdu_octetstring with { extension "prototype(convert) decode(RAW)" }
7224 var raw_pdu_octetstring i;
7225 const octetstring o := '0F'O;
7226 if ((enc_raw_pdu_octetstring(i) == o)and(dec_raw_pdu_octetstring(o) == i)) {setverdict(pass);}
7227 else {setverdict(fail,"enc_raw_pdu_octetstring(i)= ", enc_raw_pdu_octetstring(i), "; dec_raw_pdu_octetstring(o)= ", dec_raw_pdu_octetstring(o));}
7231 Overall verdict: error
7237 .*---------------------------------------------------------------------*
7238 :h3. HQ49956: RAW coder: wrong encoding when msb fieldorder.
7239 .*---------------------------------------------------------------------*
7242 <TC-HQ49956: RAW coder: wrong encoding when msb fieldorder.>
7246 type component Test_CT{};
7250 external function enc_PDU(in PDU pl_pdu) return octetstring
7252 extension "prototype(convert)"
7253 extension "encode(RAW)"
7255 external function dec_PDU(in octetstring pl_octetstring) return PDU
7257 extension "prototype(convert)"
7258 extension "decode(RAW)"
7261 type hexstring HEX1 length(1) with {encode "RAW";variant "FIELDLENGTH(1)"};
7262 type hexstring HEX5 length(5) with {encode "RAW";variant "FIELDLENGTH(5)"};
7263 type octetstring OCT1 length(1) with {encode "RAW";variant "FIELDLENGTH(1)"};
7265 type record My_Type{
7272 variant(spare,hex) "FIELDORDER(msb)";
7280 variant (u) "CROSSTAG(h1, msg_type = '01'O;
7281 h5, msg_type = '02'O;
7282 my_type, msg_type = '03'O;
7283 unknown, OTHERWISE;)";
7292 } with {encode "RAW";}
7296 testcase TC_02() runs on Test_CT{
7309 var octetstring vl_encoded := enc_PDU(vl_pdu);
7310 var PDU vl_decoded := dec_PDU(vl_encoded);
7311 log("Encoded pdu:",vl_encoded);
7312 if(vl_pdu == vl_decoded){
7316 log(match(vl_pdu, vl_decoded));
7326 Overall verdict: pass
7331 .*---------------------------------------------------------------------*
7333 .*---------------------------------------------------------------------*
7334 :nl. Requirement specification(s):
7335 :nl.-------------------------------
7337 :li. 8/ETH/RUS-2003:0087 Uen - Requirement Specification for TITAN's encoder/decoder functions