Commit | Line | Data |
---|---|---|
970ed795 | 1 | /****************************************************************************** |
3abe9331 | 2 | * Copyright (c) 2000-2015 Ericsson Telecom AB |
970ed795 EL |
3 | * All rights reserved. This program and the accompanying materials |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | ******************************************************************************/ | |
8 | module Txersets | |
9 | { | |
10 | modulepar boolean Txersets_verbose := false; | |
11 | #define verbose Txersets_verbose | |
12 | ||
13 | #include "../macros.ttcnin" | |
14 | ||
15 | external function flatten(inout universal charstring par) ; | |
16 | ||
17 | import from Sets all; | |
18 | import from SetValues all; | |
19 | import from AsnValues all; | |
20 | ||
21 | DECLARE_XER_ENCODERS(Sobs, sobs); // bitstring | |
22 | DECLARE_EXER_ENCODERS(Sobs,sobs); | |
23 | DECLARE_XER_ENCODERS(Sobo, sobo); // bool | |
24 | DECLARE_EXER_ENCODERS(Sobo,sobo); | |
25 | DECLARE_XER_ENCODERS(Soc, soc); // choice | |
26 | DECLARE_EXER_ENCODERS(Soc,soc); | |
27 | DECLARE_XER_ENCODERS(Sopdv, sopdv); | |
28 | DECLARE_EXER_ENCODERS(Sopdv,sopdv); | |
29 | DECLARE_XER_ENCODERS(Soen, soen); // enum | |
30 | DECLARE_EXER_ENCODERS(Soen,soen); | |
31 | DECLARE_XER_ENCODERS(Soex, soex); // external | |
32 | DECLARE_EXER_ENCODERS(Soex,soex); | |
33 | //-- DECLARE_XER_ENCODERS(Soin, soin); | |
34 | //-- DECLARE_EXER_ENCODERS(Soin,soin); | |
35 | DECLARE_XER_ENCODERS(Soi, soi); // int | |
36 | DECLARE_EXER_ENCODERS(Soi,soi); | |
37 | DECLARE_XER_ENCODERS(Son, son); // NULL | |
38 | DECLARE_EXER_ENCODERS(Son,son); | |
39 | //-- DECLARE_XER_ENCODERS(Socsf, socsf); | |
40 | //-- DECLARE_EXER_ENCODERS(Socsf,socsf) | |
41 | DECLARE_XER_ENCODERS(Soid, soid); // objid | |
42 | DECLARE_EXER_ENCODERS(Soid,soid); | |
43 | DECLARE_XER_ENCODERS(Soos, soos); // octetstring | |
44 | DECLARE_EXER_ENCODERS(Soos,soos); | |
45 | DECLARE_XER_ENCODERS(Sor, sor); // real | |
46 | DECLARE_EXER_ENCODERS(Sor,sor); | |
47 | DECLARE_XER_ENCODERS(Soroid, soroid); // relative oid | |
48 | DECLARE_EXER_ENCODERS(Soroid,soroid); | |
49 | DECLARE_XER_ENCODERS(So_bmp, sobmp); // BMPstring | |
50 | DECLARE_EXER_ENCODERS(So_bmp,sobmp); | |
51 | DECLARE_XER_ENCODERS(So_gen, sogen); // GeneralString | |
52 | DECLARE_EXER_ENCODERS(So_gen,sogen); | |
53 | DECLARE_XER_ENCODERS(So_gra, sogra); // GraphicString | |
54 | DECLARE_EXER_ENCODERS(So_gra,sogra); | |
55 | DECLARE_XER_ENCODERS(So_ia5, soia5); // IA5String | |
56 | DECLARE_EXER_ENCODERS(So_ia5,soia5); | |
57 | DECLARE_XER_ENCODERS(So_num, sonum); // NumericString | |
58 | DECLARE_EXER_ENCODERS(So_num,sonum); | |
59 | DECLARE_XER_ENCODERS(So_prn, soprn); // PrintableString | |
60 | DECLARE_EXER_ENCODERS(So_prn,soprn); | |
61 | DECLARE_XER_ENCODERS(So_ttx, sottx); // TeletexString | |
62 | DECLARE_EXER_ENCODERS(So_ttx,sottx); | |
63 | //-- same as above: DECLARE_XER_ENCODERS(So_t61, sot61); | |
64 | //DECLARE_EXER_ENCODERS(So_t61,sot61); | |
65 | DECLARE_XER_ENCODERS(So_uni, souni); // UniversalString | |
66 | DECLARE_EXER_ENCODERS(So_uni,souni); | |
67 | DECLARE_XER_ENCODERS(So_utf, soutf); // UTF8String | |
68 | DECLARE_EXER_ENCODERS(So_utf,soutf); | |
69 | DECLARE_XER_ENCODERS(So_vtx, sovtx); // VideotexString | |
70 | DECLARE_EXER_ENCODERS(So_vtx,sovtx); | |
71 | DECLARE_XER_ENCODERS(So_vis, sovis); // VisibleString | |
72 | DECLARE_EXER_ENCODERS(So_vis,sovis); | |
73 | //-- same as above: DECLARE_XER_ENCODERS(So_646, so646); | |
74 | //DECLARE_EXER_ENCODERS(So_646,so646); | |
75 | DECLARE_XER_ENCODERS(So_unr, sounr); // big, scary, unrestricted CHARACTER STRING | |
76 | DECLARE_EXER_ENCODERS(So_unr,sounr); | |
77 | ||
78 | DECLARE_XER_ENCODERS(Sosel, sosel); // selection type | |
79 | DECLARE_EXER_ENCODERS(Sosel,sosel); | |
80 | DECLARE_XER_ENCODERS(Sonc , sonc); // named choice | |
81 | DECLARE_EXER_ENCODERS(Sonc, sonc); | |
82 | ||
83 | type component Tsets {} | |
84 | ||
85 | //-------------------- SET OF BIT STRING -------------------- | |
86 | ||
87 | const charstring sobs0 := | |
88 | "<Sobs/>\n\n"; | |
89 | ||
90 | const charstring sobs1 := | |
91 | "<Sobs>\n" & | |
92 | "\t<BIT_STRING>" & | |
93 | "1110010110010011011110111010110111100111010110100110111011" & | |
94 | "</BIT_STRING>\n" & | |
95 | "</Sobs>\n\n"; | |
96 | ||
97 | const charstring sobs2 := | |
98 | "<Sobs>\n" & | |
99 | "\t<BIT_STRING>" & | |
100 | "1110010110010011011110111010110111100111010110100110111011" & | |
101 | "</BIT_STRING>\n" & | |
102 | "\t<BIT_STRING/>\n" & | |
103 | "</Sobs>\n\n"; | |
104 | ||
105 | ||
106 | testcase enc_sobs() runs on Tsets | |
107 | { | |
108 | var universal charstring expected; | |
109 | ||
110 | expected := sobs0; | |
111 | CHECK_METHOD(bxer_enc_sobs, sobs_0, expected); | |
112 | CHECK_METHOD(exer_enc_sobs, sobs_0, expected); | |
113 | flatten(expected); | |
114 | CHECK_METHOD(cxer_enc_sobs, sobs_0, expected & lf); | |
115 | ||
116 | expected := sobs1; | |
117 | CHECK_METHOD(bxer_enc_sobs, sobs_1, expected); | |
118 | CHECK_METHOD(exer_enc_sobs, sobs_1, expected); | |
119 | flatten(expected); | |
120 | CHECK_METHOD(cxer_enc_sobs, sobs_1, expected & lf); | |
121 | ||
122 | expected := sobs2; | |
123 | CHECK_METHOD(bxer_enc_sobs, sobs_2, expected); | |
124 | CHECK_METHOD(exer_enc_sobs, sobs_2, expected); | |
125 | flatten(expected); | |
126 | CHECK_METHOD(cxer_enc_sobs, sobs_2, expected & lf); | |
127 | } | |
128 | ||
129 | testcase dec_sobs() runs on Tsets | |
130 | { | |
131 | // type suffix, input, type, expected | |
132 | CHECK_DECODE2( sobs, sobs0, Sobs, sobs_0); | |
133 | CHECK_DECODE(exer_dec_sobs, sobs0, Sobs, sobs_0); | |
134 | ||
135 | CHECK_DECODE2( sobs, sobs1, Sobs, sobs_1); | |
136 | CHECK_DECODE(exer_dec_sobs, sobs1, Sobs, sobs_1); | |
137 | ||
138 | CHECK_DECODE2( sobs, sobs2, Sobs, sobs_2); | |
139 | CHECK_DECODE(exer_dec_sobs, sobs2, Sobs, sobs_2); | |
140 | } | |
141 | ||
142 | //-------------------- SET OF BOOELAN -------------------- | |
143 | ||
144 | const charstring sobo0 := | |
145 | "<Sobo/>\n\n"; | |
146 | ||
147 | const charstring sobo1 := | |
148 | "<Sobo>\n" & | |
149 | "\t<true/>\n" & | |
150 | "</Sobo>\n\n"; | |
151 | ||
152 | const charstring sobo1_exer := | |
153 | "<Sobo>\n" & | |
154 | "\t<BOOLEAN>true</BOOLEAN>\n" & | |
155 | "</Sobo>\n\n"; | |
156 | ||
157 | const charstring sobo3 := | |
158 | "<Sobo>\n" & | |
159 | "\t<true/><false/><true/>\n" & | |
160 | "</Sobo>\n\n"; | |
161 | ||
162 | const charstring sobo3_exer := | |
163 | "<Sobo>\n" & | |
164 | "\t<BOOLEAN>true</BOOLEAN>\n" & | |
165 | "\t<BOOLEAN>false</BOOLEAN>\n" & | |
166 | "\t<BOOLEAN>true</BOOLEAN>\n" & | |
167 | "</Sobo>\n\n"; | |
168 | ||
169 | testcase enc_sobo() runs on Tsets | |
170 | { | |
171 | var universal charstring expected; | |
172 | ||
173 | expected := sobo0; | |
174 | CHECK_METHOD(bxer_enc_sobo, sobo_0, expected); | |
175 | CHECK_METHOD(exer_enc_sobo, sobo_0, expected); | |
176 | flatten(expected); | |
177 | CHECK_METHOD(cxer_enc_sobo, sobo_0, expected & lf); | |
178 | ||
179 | expected := sobo1; | |
180 | CHECK_METHOD(bxer_enc_sobo, sobo_1, expected); | |
181 | flatten(expected); | |
182 | CHECK_METHOD(cxer_enc_sobo, sobo_1, expected & lf); | |
183 | expected := sobo1_exer; | |
184 | CHECK_METHOD(exer_enc_sobo, sobo_1, expected); | |
185 | ||
186 | expected := sobo3; | |
187 | CHECK_METHOD(bxer_enc_sobo, sobo_3, expected); | |
188 | flatten(expected); | |
189 | CHECK_METHOD(cxer_enc_sobo, sobo_3, expected & lf); | |
190 | expected := sobo3_exer; | |
191 | CHECK_METHOD(exer_enc_sobo, sobo_3, expected); | |
192 | } | |
193 | ||
194 | testcase dec_sobo() runs on Tsets | |
195 | { | |
196 | // decoder suffix, inp, type, expected | |
197 | CHECK_DECODE2( sobo, sobo0, Sobo, sobo_0); | |
198 | CHECK_DECODE(exer_dec_sobo, sobo0, Sobo, sobo_0); | |
199 | ||
200 | CHECK_DECODE2( sobo, sobo1, Sobo, sobo_1); | |
201 | CHECK_DECODE(exer_dec_sobo, sobo1_exer, Sobo, sobo_1); | |
202 | ||
203 | CHECK_DECODE2( sobo, sobo3, Sobo, sobo_3); | |
204 | CHECK_DECODE(exer_dec_sobo, sobo3_exer, Sobo, sobo_3); | |
205 | } | |
206 | ||
207 | //-------------------- SET OF CHOICE -------------------- | |
208 | ||
209 | const charstring soc0 := | |
210 | "<Soc/>\n\n"; | |
211 | ||
212 | const charstring soc1 := | |
213 | "<Soc>\n" & | |
214 | "\t<is>9.109382e-31</is>\n" & | |
215 | "</Soc>\n\n"; | |
216 | ||
217 | const charstring soc1_exer := | |
218 | "<Soc>\n" & | |
219 | "\t<CHOICE>\n" & | |
220 | "\t\t<is>9.109382e-31</is>\n" & | |
221 | "\t</CHOICE>\n" & | |
222 | "</Soc>\n\n"; | |
223 | ||
224 | const charstring soc3_exer := | |
225 | "<Soc>\n" & | |
226 | "\t<CHOICE>\n" & | |
227 | "\t\t<is>0.841471</is>\n" & | |
228 | "\t</CHOICE>\n" & | |
229 | "\t<CHOICE>\n" & | |
230 | "\t\t<is>0.909297</is>\n" & | |
231 | "\t</CHOICE>\n" & | |
232 | "\t<CHOICE>\n" & | |
233 | "\t\t<is>0.141120</is>\n" & | |
234 | "\t</CHOICE>\n" & | |
235 | "</Soc>\n\n"; | |
236 | ||
237 | const charstring soc3 := | |
238 | "<Soc>\n" & | |
239 | "\t<is>0.841471</is>\n" & | |
240 | "\t<is>0.909297</is>\n" & | |
241 | "\t<is>0.141120</is>\n" & | |
242 | "</Soc>\n\n"; | |
243 | ||
244 | const charstring sonc0 := | |
245 | "<Sonc/>\n\n"; | |
246 | ||
247 | const charstring sonc1 := | |
248 | "<Sonc>\n" & | |
249 | "\t<is>9.109382e-31</is>\n" & | |
250 | "</Sonc>\n\n"; | |
251 | ||
252 | const charstring sonc1_exer := | |
253 | "<Sonc>\n" & | |
254 | "\t<NamedChoice>\n" & | |
255 | "\t\t<is>9.109382e-31</is>\n" & | |
256 | "\t</NamedChoice>\n" & | |
257 | "</Sonc>\n\n"; | |
258 | ||
259 | const charstring sonc3 := | |
260 | "<Sonc>\n" & | |
261 | "\t<is>0.841471</is>\n" & | |
262 | "\t<is>0.909297</is>\n" & | |
263 | "\t<is>0.141120</is>\n" & | |
264 | "</Sonc>\n\n"; | |
265 | ||
266 | const charstring sonc3_exer := | |
267 | "<Sonc>\n" & | |
268 | "\t<NamedChoice>\n" & | |
269 | "\t\t<is>0.841471</is>\n" & | |
270 | "\t</NamedChoice>\n" & | |
271 | "\t<NamedChoice>\n" & | |
272 | "\t\t<is>0.909297</is>\n" & | |
273 | "\t</NamedChoice>\n" & | |
274 | "\t<NamedChoice>\n" & | |
275 | "\t\t<is>0.141120</is>\n" & | |
276 | "\t</NamedChoice>\n" & | |
277 | "</Sonc>\n\n"; | |
278 | ||
279 | testcase enc_soc() runs on Tsets | |
280 | { | |
281 | var universal charstring expected; | |
282 | ||
283 | expected := soc0; | |
284 | CHECK_METHOD(bxer_enc_soc, soc_0, expected); | |
285 | CHECK_METHOD(exer_enc_soc, soc_0, expected); | |
286 | flatten(expected); | |
287 | CHECK_METHOD(cxer_enc_soc, soc_0, expected & lf); | |
288 | ||
289 | expected := soc1; | |
290 | CHECK_METHOD(bxer_enc_soc, soc_1, expected); | |
291 | flatten(expected); | |
292 | CHECK_METHOD(cxer_enc_soc, soc_1, expected & lf); | |
293 | expected := soc1_exer; | |
294 | CHECK_METHOD(exer_enc_soc, soc_1, expected); | |
295 | ||
296 | expected := soc3; | |
297 | CHECK_METHOD(bxer_enc_soc, soc_3, expected); | |
298 | flatten(expected); | |
299 | CHECK_METHOD(cxer_enc_soc, soc_3, expected & lf); | |
300 | expected := soc3_exer; | |
301 | CHECK_METHOD(exer_enc_soc, soc_3, expected); | |
302 | ||
303 | /* Now for a named choice */ | |
304 | ||
305 | expected := sonc0; | |
306 | CHECK_METHOD(bxer_enc_sonc, sonc_0, expected); | |
307 | CHECK_METHOD(exer_enc_sonc, sonc_0, expected); | |
308 | flatten(expected); | |
309 | CHECK_METHOD(cxer_enc_sonc, sonc_0, expected & lf); | |
310 | ||
311 | expected := sonc1; | |
312 | CHECK_METHOD(bxer_enc_sonc, sonc_1, expected); | |
313 | flatten(expected); | |
314 | CHECK_METHOD(cxer_enc_sonc, sonc_1, expected & lf); | |
315 | expected := sonc1_exer; | |
316 | CHECK_METHOD(exer_enc_sonc, sonc_1, expected); | |
317 | ||
318 | expected := sonc3; | |
319 | CHECK_METHOD(bxer_enc_sonc, sonc_3, expected); | |
320 | flatten(expected); | |
321 | CHECK_METHOD(cxer_enc_sonc, sonc_3, expected & lf); | |
322 | expected := sonc3_exer; | |
323 | CHECK_METHOD(exer_enc_sonc, sonc_3, expected); | |
324 | } | |
325 | ||
326 | testcase dec_soc() runs on Tsets | |
327 | { | |
328 | // decoder suffix, inp, type, expected | |
329 | CHECK_DECODE2(soc, soc0, Soc, soc_0); | |
330 | CHECK_DECODE2(soc, soc1, Soc, soc_1); | |
331 | CHECK_DECODE2(soc, soc3, Soc, soc_3); | |
332 | ||
333 | CHECK_DECODE2(sonc, sonc0, Sonc, sonc_0); | |
334 | CHECK_DECODE2(sonc, sonc1, Sonc, sonc_1); | |
335 | CHECK_DECODE2(sonc, sonc3, Sonc, sonc_3); | |
336 | } | |
337 | ||
338 | //-------------------- SET OF EMBEDDED PDV -------------------- | |
339 | ||
340 | const charstring sopdv0 := | |
341 | "<Sopdv/>\n\n"; | |
342 | ||
343 | const charstring sopdv1 := | |
344 | "<Sopdv>\n" & | |
345 | "\t<SEQUENCE>\n" & | |
346 | "\t\t<identification>\n" & | |
347 | "\t\t\t<syntax>0.4.0.1.3.5</syntax>\n" & | |
348 | "\t\t</identification>\n" & | |
349 | "\t\t<data-value>DECAFBAD</data-value>\n" & | |
350 | "\t</SEQUENCE>\n" & | |
351 | "</Sopdv>\n\n"; | |
352 | ||
353 | testcase enc_sopdv() runs on Tsets | |
354 | { | |
355 | var universal charstring expected; | |
356 | ||
357 | expected := sopdv0; | |
358 | CHECK_METHOD(bxer_enc_sopdv, sopdv_0, expected); | |
359 | CHECK_METHOD(exer_enc_sopdv, sopdv_0, expected); | |
360 | flatten(expected); | |
361 | CHECK_METHOD(cxer_enc_sopdv, sopdv_0, expected & lf); | |
362 | ||
363 | expected := sopdv1; | |
364 | CHECK_METHOD(bxer_enc_sopdv, sopdv_1, expected); | |
365 | CHECK_METHOD(exer_enc_sopdv, sopdv_1, expected); | |
366 | flatten(expected); | |
367 | CHECK_METHOD(cxer_enc_sopdv, sopdv_1, expected & lf); | |
368 | } | |
369 | ||
370 | testcase dec_sopdv() runs on Tsets | |
371 | { | |
372 | // decoder suffix, inp, type, expected | |
373 | CHECK_DECODE2(sopdv, sopdv0, Sopdv, sopdv_0); | |
374 | CHECK_DECODE2(sopdv, sopdv1, Sopdv, sopdv_1); | |
375 | } | |
376 | ||
377 | //-------------------- SET OF ENUMERATED -------------------- | |
378 | ||
379 | const charstring soen0 := | |
380 | "<Soen/>\n\n"; | |
381 | ||
382 | const charstring soen1 := | |
383 | "<Soen>\n" & | |
384 | "\t<fileNotFound/>\n" & | |
385 | "</Soen>\n\n"; | |
386 | ||
387 | const charstring soen1_exer := | |
388 | "<Soen>\n" & | |
389 | "\t<ENUMERATED>fileNotFound</ENUMERATED>\n" & | |
390 | "</Soen>\n\n"; | |
391 | ||
392 | const charstring soen3 := | |
393 | "<Soen>\n" & | |
394 | "\t<truee/><falsee/><fileNotFound/>\n" & | |
395 | "</Soen>\n\n"; | |
396 | ||
397 | const charstring soen3_exer := | |
398 | "<Soen>\n" & | |
399 | "\t<ENUMERATED>truee</ENUMERATED>\n\t<ENUMERATED>falsee</ENUMERATED>\n\t<ENUMERATED>fileNotFound</ENUMERATED>\n" & | |
400 | "</Soen>\n\n"; | |
401 | ||
402 | testcase enc_soen() runs on Tsets | |
403 | { | |
404 | var universal charstring expected; | |
405 | ||
406 | expected := soen0; | |
407 | CHECK_METHOD(bxer_enc_soen, soen_0, expected); | |
408 | CHECK_METHOD(exer_enc_soen, soen_0, expected); | |
409 | flatten(expected); | |
410 | CHECK_METHOD(cxer_enc_soen, soen_0, expected & lf); | |
411 | ||
412 | expected := soen1; | |
413 | CHECK_METHOD(bxer_enc_soen, soen_1, expected); | |
414 | flatten(expected); | |
415 | CHECK_METHOD(cxer_enc_soen, soen_1, expected & lf); | |
416 | expected := soen1_exer; | |
417 | CHECK_METHOD(exer_enc_soen, soen_1, expected); | |
418 | ||
419 | expected := soen3; | |
420 | CHECK_METHOD(bxer_enc_soen, soen_3, expected); | |
421 | flatten(expected); | |
422 | CHECK_METHOD(cxer_enc_soen, soen_3, expected & lf); | |
423 | expected := soen3_exer; | |
424 | CHECK_METHOD(exer_enc_soen, soen_3, expected); | |
425 | } | |
426 | ||
427 | testcase dec_soen() runs on Tsets | |
428 | { | |
429 | // decoder suffix, inp, type, expected | |
430 | CHECK_DECODE2(soen, soen0, Soen, soen_0); | |
431 | CHECK_DECODE2(soen, soen1, Soen, soen_1); | |
432 | CHECK_DECODE2(soen, soen3, Soen, soen_3); | |
433 | } | |
434 | ||
435 | //-------------------- SET OF EXTERNAL -------------------- | |
436 | ||
437 | const charstring soex0 := | |
438 | "<Soex/>\n\n"; | |
439 | ||
440 | const charstring soex1 := | |
441 | "<Soex>\n" & | |
442 | "\t<SEQUENCE>\n" & | |
443 | "\t\t<direct-reference>2.1.1</direct-reference>\n" & | |
444 | "\t\t<indirect-reference>111</indirect-reference>\n" & | |
445 | "\t\t<data-value-descriptor>using context negotiation, both</data-value-descriptor>\n" & | |
446 | "\t\t<encoding>\n" & | |
447 | "\t\t\t<octet-aligned>1337D00D</octet-aligned>\n" & | |
448 | "\t\t</encoding>\n" & | |
449 | "\t</SEQUENCE>\n" & | |
450 | "</Soex>\n\n"; | |
451 | ||
452 | const charstring soex3 := | |
453 | "<Soex>\n" & | |
454 | "\t<SEQUENCE>\n" & | |
455 | "\t\t<direct-reference>2.1.1</direct-reference>\n" & | |
456 | "\t\t<indirect-reference>111</indirect-reference>\n" & | |
457 | "\t\t<data-value-descriptor>using context negotiation, both</data-value-descriptor>\n" & | |
458 | "\t\t<encoding>\n" & | |
459 | "\t\t\t<octet-aligned>1337D00D</octet-aligned>\n" & | |
460 | "\t\t</encoding>\n" & | |
461 | "\t</SEQUENCE>\n" & | |
462 | "\t<SEQUENCE>\n" & | |
463 | "\t\t<direct-reference>2.1.1</direct-reference>\n" & | |
464 | "\t\t<indirect-reference>111</indirect-reference>\n" & | |
465 | "\t\t<data-value-descriptor>using context negotiation, both</data-value-descriptor>\n" & | |
466 | "\t\t<encoding>\n" & | |
467 | "\t\t\t<octet-aligned>1337D00D</octet-aligned>\n" & | |
468 | "\t\t</encoding>\n" & | |
469 | "\t</SEQUENCE>\n" & | |
470 | "\t<SEQUENCE>\n" & | |
471 | "\t\t<direct-reference>2.1.1</direct-reference>\n" & | |
472 | "\t\t<indirect-reference>111</indirect-reference>\n" & | |
473 | "\t\t<data-value-descriptor>using context negotiation, both</data-value-descriptor>\n" & | |
474 | "\t\t<encoding>\n" & | |
475 | "\t\t\t<octet-aligned>1337D00D</octet-aligned>\n" & | |
476 | "\t\t</encoding>\n" & | |
477 | "\t</SEQUENCE>\n" & | |
478 | "</Soex>\n\n"; | |
479 | ||
480 | testcase enc_soex() runs on Tsets | |
481 | { | |
482 | var universal charstring expected; | |
483 | ||
484 | expected := soex0; | |
485 | CHECK_METHOD(bxer_enc_soex, soex_0, expected); | |
486 | CHECK_METHOD(exer_enc_soex, soex_0, expected); | |
487 | flatten(expected); | |
488 | CHECK_METHOD(cxer_enc_soex, soex_0, expected & lf); | |
489 | ||
490 | expected := soex1; | |
491 | CHECK_METHOD(bxer_enc_soex, soex_1, expected); | |
492 | CHECK_METHOD(exer_enc_soex, soex_1, expected); | |
493 | flatten(expected); | |
494 | CHECK_METHOD(cxer_enc_soex, soex_1, expected & lf); | |
495 | ||
496 | expected := soex3; | |
497 | CHECK_METHOD(bxer_enc_soex, soex_3, expected); | |
498 | CHECK_METHOD(exer_enc_soex, soex_3, expected); | |
499 | flatten(expected); | |
500 | CHECK_METHOD(cxer_enc_soex, soex_3, expected & lf); | |
501 | } | |
502 | ||
503 | testcase dec_soex() runs on Tsets | |
504 | { | |
505 | // type suffix, input, type, expected | |
506 | CHECK_DECODE2(soex, soex0, Soex, soex_0); | |
507 | ||
508 | CHECK_DECODE2(soex, soex1, Soex, soex_1); | |
509 | ||
510 | CHECK_DECODE2(soex, soex3, Soex, soex_3); | |
511 | } | |
512 | ||
513 | //-------------------- SET OF INTEGER -------------------- | |
514 | ||
515 | const charstring soi0 := | |
516 | "<Soi/>\n\n"; | |
517 | ||
518 | const charstring soi1 := | |
519 | "<Soi>\n" & | |
520 | "\t<INTEGER>42</INTEGER>\n" & | |
521 | "</Soi>\n\n"; | |
522 | ||
523 | const charstring soi3 := | |
524 | "<Soi>\n" & | |
525 | "\t<INTEGER>21</INTEGER>\n" & | |
526 | "\t<INTEGER>1211</INTEGER>\n" & | |
527 | "\t<INTEGER>111221</INTEGER>\n" & | |
528 | "</Soi>\n" & | |
529 | lf; | |
530 | ||
531 | testcase enc_soint() runs on Tsets | |
532 | { | |
533 | var universal charstring expected; | |
534 | ||
535 | expected := soi0; | |
536 | CHECK_METHOD(bxer_enc_soi, soi_0, expected); | |
537 | CHECK_METHOD(exer_enc_soi, soi_0, expected); | |
538 | flatten(expected); | |
539 | CHECK_METHOD(cxer_enc_soi, soi_0, expected & lf); | |
540 | ||
541 | expected := soi1; | |
542 | CHECK_METHOD(bxer_enc_soi, soi_1, expected); | |
543 | CHECK_METHOD(exer_enc_soi, soi_1, expected); | |
544 | flatten(expected); | |
545 | CHECK_METHOD(cxer_enc_soi, soi_1, expected & lf); | |
546 | ||
547 | expected := soi3; | |
548 | CHECK_METHOD(bxer_enc_soi, soi_3, expected); | |
549 | CHECK_METHOD(exer_enc_soi, soi_3, expected); | |
550 | flatten(expected); | |
551 | CHECK_METHOD(cxer_enc_soi, soi_3, expected & lf); | |
552 | } | |
553 | ||
554 | testcase dec_soint() runs on Tsets | |
555 | { | |
556 | // type suffix, input, type, expected | |
557 | CHECK_DECODE2(soi, soi0, Soi, soi_0); | |
558 | ||
559 | CHECK_DECODE2(soi, soi1, Soi, soi_1); | |
560 | ||
561 | CHECK_DECODE2(soi, soi3, Soi, soi_3); | |
562 | } | |
563 | ||
564 | //-------------------- SET OF NULL -------------------- | |
565 | ||
566 | const charstring son0 := | |
567 | "<Son/>\n\n"; | |
568 | ||
569 | const charstring son1 := | |
570 | "<Son>\n" & | |
571 | "\t<NULL/>\n" & | |
572 | "</Son>\n\n"; | |
573 | ||
574 | const charstring son1_exer := | |
575 | "<Son>\n" & | |
576 | "<NULL/>" & | |
577 | "</Son>\n\n"; | |
578 | ||
579 | const charstring son3 := | |
580 | "<Son>\n" & | |
581 | "\t<NULL/><NULL/><NULL/>\n" & | |
582 | "</Son>\n\n" ; | |
583 | ||
584 | const charstring son3_exer := | |
585 | "<Son>\n" & | |
586 | "<NULL/><NULL/><NULL/>" & | |
587 | "</Son>\n\n" ; | |
588 | ||
589 | testcase enc_son() runs on Tsets | |
590 | { | |
591 | var universal charstring expected; | |
592 | ||
593 | expected := son0; | |
594 | CHECK_METHOD(bxer_enc_son, son_0, expected); | |
595 | CHECK_METHOD(exer_enc_son, son_0, expected); | |
596 | flatten(expected); | |
597 | CHECK_METHOD(cxer_enc_son, son_0, expected & lf); | |
598 | ||
599 | expected := son1; | |
600 | CHECK_METHOD(bxer_enc_son, son_1, expected); | |
601 | flatten(expected); | |
602 | CHECK_METHOD(cxer_enc_son, son_1, expected & lf); | |
603 | expected := son1_exer; | |
604 | CHECK_METHOD(exer_enc_son, son_1, expected); | |
605 | ||
606 | expected := son3; | |
607 | CHECK_METHOD(bxer_enc_son, son_3, expected); | |
608 | flatten(expected); | |
609 | CHECK_METHOD(cxer_enc_son, son_3, expected & lf); | |
610 | expected := son3_exer; | |
611 | CHECK_METHOD(exer_enc_son, son_3, expected); | |
612 | } | |
613 | ||
614 | testcase dec_son() runs on Tsets | |
615 | { | |
616 | // type suffix, input, type, expected | |
617 | CHECK_DECODE2( son, son0, Son, son_0); | |
618 | CHECK_DECODE(exer_dec_son, son0, Son, son_0); | |
619 | ||
620 | CHECK_DECODE2( son, son1, Son, son_1); | |
621 | CHECK_DECODE(exer_dec_son, son1, Son, son_1); | |
622 | ||
623 | CHECK_DECODE2( son, son3, Son, son_3); | |
624 | CHECK_DECODE(exer_dec_son, son3, Son, son_3); | |
625 | } | |
626 | ||
627 | //-------------------- SET OF OBJECT IDENTIFIER -------------------- | |
628 | ||
629 | const charstring soid0 := | |
630 | "<Soid/>\n\n"; | |
631 | ||
632 | const charstring soid1 := | |
633 | "<Soid>\n" & | |
634 | "\t<OBJECT_IDENTIFIER>1.2.3.4</OBJECT_IDENTIFIER>\n" & | |
635 | "</Soid>\n\n"; | |
636 | ||
637 | const charstring soid3 := | |
638 | "<Soid>\n" & | |
639 | "\t<OBJECT_IDENTIFIER>0.4.0</OBJECT_IDENTIFIER>\n" & | |
640 | "\t<OBJECT_IDENTIFIER>0.4.0.127.0.5</OBJECT_IDENTIFIER>\n" & | |
641 | "\t<OBJECT_IDENTIFIER>2.6.6.1.2.4.4</OBJECT_IDENTIFIER>\n" & | |
642 | "</Soid>\n" & | |
643 | lf; | |
644 | ||
645 | testcase enc_soid() runs on Tsets | |
646 | { | |
647 | var universal charstring expected; | |
648 | ||
649 | expected := soid0; | |
650 | CHECK_METHOD(bxer_enc_soid, soid_0, expected); | |
651 | CHECK_METHOD(exer_enc_soid, soid_0, expected); | |
652 | flatten(expected); | |
653 | CHECK_METHOD(cxer_enc_soid, soid_0, expected & lf); | |
654 | ||
655 | expected := soid1; | |
656 | CHECK_METHOD(bxer_enc_soid, soid_1, expected); | |
657 | CHECK_METHOD(exer_enc_soid, soid_1, expected); | |
658 | flatten(expected); | |
659 | CHECK_METHOD(cxer_enc_soid, soid_1, expected & lf); | |
660 | ||
661 | expected := soid3; | |
662 | CHECK_METHOD(bxer_enc_soid, soid_3, expected); | |
663 | CHECK_METHOD(exer_enc_soid, soid_3, expected); | |
664 | flatten(expected); | |
665 | CHECK_METHOD(cxer_enc_soid, soid_3, expected & lf); | |
666 | } | |
667 | ||
668 | testcase dec_soid() runs on Tsets | |
669 | { | |
670 | // type suffix, input, type, expected | |
671 | CHECK_DECODE2( soid, soid0, Soid, soid_0); | |
672 | CHECK_DECODE(exer_dec_soid, soid0, Soid, soid_0); | |
673 | ||
674 | CHECK_DECODE2( soid, soid1, Soid, soid_1); | |
675 | CHECK_DECODE(exer_dec_soid, soid1, Soid, soid_1); | |
676 | ||
677 | CHECK_DECODE2( soid, soid3, Soid, soid_3); | |
678 | CHECK_DECODE(exer_dec_soid, soid3, Soid, soid_3); | |
679 | } | |
680 | ||
681 | //-------------------- SET OF OCTET STRING -------------------- | |
682 | ||
683 | const charstring soos0 := | |
684 | "<Soos/>\n\n"; | |
685 | ||
686 | const charstring soos1 := | |
687 | "<Soos>\n" & | |
688 | "\t<OCTET_STRING>13211311123113112211</OCTET_STRING>\n" & | |
689 | "</Soos>\n\n"; | |
690 | ||
691 | const charstring soos3 := | |
692 | "<Soos>\n" & | |
693 | "\t<OCTET_STRING>1123</OCTET_STRING>\n" & | |
694 | "\t<OCTET_STRING>5813</OCTET_STRING>\n" & | |
695 | "\t<OCTET_STRING/>\n" & | |
696 | "</Soos>\n\n"; | |
697 | ||
698 | ||
699 | testcase enc_soos() runs on Tsets | |
700 | { | |
701 | var universal charstring expected; | |
702 | ||
703 | expected := soos0; | |
704 | CHECK_METHOD(bxer_enc_soos, soos_0, expected); | |
705 | CHECK_METHOD(exer_enc_soos, soos_0, expected); | |
706 | flatten(expected); | |
707 | CHECK_METHOD(cxer_enc_soos, soos_0, expected & lf); | |
708 | ||
709 | expected := soos1; | |
710 | CHECK_METHOD(bxer_enc_soos, soos_1, expected); | |
711 | CHECK_METHOD(exer_enc_soos, soos_1, expected); | |
712 | flatten(expected); | |
713 | CHECK_METHOD(cxer_enc_soos, soos_1, expected & lf); | |
714 | ||
715 | expected := soos3; | |
716 | CHECK_METHOD(bxer_enc_soos, soos_3, expected); | |
717 | CHECK_METHOD(exer_enc_soos, soos_3, expected); | |
718 | flatten(expected); | |
719 | CHECK_METHOD(cxer_enc_soos, soos_3, expected & lf); | |
720 | } | |
721 | ||
722 | testcase dec_soos() runs on Tsets | |
723 | { | |
724 | // type suffix, input, type, expected | |
725 | CHECK_DECODE2( soos, soos0, Soos, soos_0); | |
726 | CHECK_DECODE(exer_dec_soos, soos0, Soos, soos_0); | |
727 | ||
728 | CHECK_DECODE2( soos, soos1, Soos, soos_1); | |
729 | CHECK_DECODE(exer_dec_soos, soos1, Soos, soos_1); | |
730 | ||
731 | CHECK_DECODE2( soos, soos3, Soos, soos_3); | |
732 | CHECK_DECODE(exer_dec_soos, soos3, Soos, soos_3); | |
733 | } | |
734 | ||
735 | //-------------------- SET OF REAL -------------------- | |
736 | ||
737 | const charstring sor0 := | |
738 | "<Sor/>\n\n"; | |
739 | ||
740 | const charstring sor1 := | |
741 | "<Sor>\n" & | |
742 | "\t<REAL>1.602176e-19</REAL>\n" & | |
743 | "</Sor>\n\n"; | |
744 | ||
745 | const charstring sor3 := | |
746 | "<Sor>\n" & | |
747 | "\t<REAL>0.540302</REAL>\n" & | |
748 | "\t<REAL>-0.416147</REAL>\n" & | |
749 | "\t<REAL>-0.989992</REAL>\n" & | |
750 | "</Sor>\n" & | |
751 | lf; | |
752 | ||
753 | testcase enc_sor() runs on Tsets | |
754 | { | |
755 | var universal charstring expected; | |
756 | ||
757 | expected := sor0; | |
758 | CHECK_METHOD(bxer_enc_sor, sor_0, expected); | |
759 | CHECK_METHOD(exer_enc_sor, sor_0, expected); | |
760 | flatten(expected); | |
761 | CHECK_METHOD(cxer_enc_sor, sor_0, expected & lf); | |
762 | ||
763 | expected := sor1; | |
764 | CHECK_METHOD(bxer_enc_sor, sor_1, expected); | |
765 | CHECK_METHOD(exer_enc_sor, sor_1, expected); | |
766 | flatten(expected); | |
767 | CHECK_METHOD(cxer_enc_sor, sor_1, expected & lf); | |
768 | ||
769 | expected := sor3; | |
770 | CHECK_METHOD(bxer_enc_sor, sor_3, expected); | |
771 | CHECK_METHOD(exer_enc_sor, sor_3, expected); | |
772 | flatten(expected); | |
773 | CHECK_METHOD(cxer_enc_sor, sor_3, expected & lf); | |
774 | } | |
775 | ||
776 | testcase dec_sor() runs on Tsets | |
777 | { | |
778 | // type suffix, input, type, expected | |
779 | CHECK_DECODE2( sor, sor0, Sor, sor_0); | |
780 | CHECK_DECODE(exer_dec_sor, sor0, Sor, sor_0); | |
781 | ||
782 | CHECK_DECODE2( sor, sor1, Sor, sor_1); | |
783 | CHECK_DECODE(exer_dec_sor, sor1, Sor, sor_1); | |
784 | ||
785 | CHECK_DECODE2( sor, sor3, Sor, sor_3); | |
786 | CHECK_DECODE(exer_dec_sor, sor3, Sor, sor_3); | |
787 | } | |
788 | ||
789 | //-------------------- SET OF RELATIVE-OID -------------------- | |
790 | ||
791 | const charstring soroid0 := | |
792 | "<Soroid/>\n\n"; | |
793 | ||
794 | const charstring soroid1 := | |
795 | "<Soroid>\n" & | |
796 | "\t<RELATIVE_OID>4.3.2.1</RELATIVE_OID>\n" & | |
797 | "</Soroid>\n\n"; | |
798 | ||
799 | const charstring soroid3 := | |
800 | "<Soroid>\n" & | |
801 | "\t<RELATIVE_OID>1</RELATIVE_OID>\n" & | |
802 | "\t<RELATIVE_OID>1.1</RELATIVE_OID>\n" & | |
803 | "\t<RELATIVE_OID>1.1.1</RELATIVE_OID>\n" & | |
804 | "</Soroid>\n\n"; | |
805 | ||
806 | testcase enc_soroid() runs on Tsets | |
807 | { | |
808 | var universal charstring expected; | |
809 | ||
810 | expected := soroid0; | |
811 | CHECK_METHOD(bxer_enc_soroid, soroid_0, expected); | |
812 | CHECK_METHOD(exer_enc_soroid, soroid_0, expected); | |
813 | flatten(expected); | |
814 | CHECK_METHOD(cxer_enc_soroid, soroid_0, expected & lf); | |
815 | ||
816 | expected := soroid1; | |
817 | CHECK_METHOD(bxer_enc_soroid, soroid_1, expected); | |
818 | CHECK_METHOD(exer_enc_soroid, soroid_1, expected); | |
819 | flatten(expected); | |
820 | CHECK_METHOD(cxer_enc_soroid, soroid_1, expected & lf); | |
821 | ||
822 | expected := soroid3; | |
823 | CHECK_METHOD(bxer_enc_soroid, soroid_3, expected); | |
824 | CHECK_METHOD(exer_enc_soroid, soroid_3, expected); | |
825 | flatten(expected); | |
826 | CHECK_METHOD(cxer_enc_soroid, soroid_3, expected & lf); | |
827 | } | |
828 | ||
829 | testcase dec_soroid() runs on Tsets | |
830 | { | |
831 | // type suffix, input, type, expected | |
832 | CHECK_DECODE2( soroid, soroid0, Soroid, soroid_0); | |
833 | CHECK_DECODE(exer_dec_soroid, soroid0, Soroid, soroid_0); | |
834 | ||
835 | CHECK_DECODE2( soroid, soroid1, Soroid, soroid_1); | |
836 | CHECK_DECODE(exer_dec_soroid, soroid1, Soroid, soroid_1); | |
837 | ||
838 | CHECK_DECODE2( soroid, soroid3, Soroid, soroid_3); | |
839 | CHECK_DECODE(exer_dec_soroid, soroid3, Soroid, soroid_3); | |
840 | } | |
841 | ||
842 | //-------------------- SET OF BMPString -------------------- | |
843 | ||
844 | const charstring sobmp0 := | |
845 | "<So-bmp/>\n\n"; | |
846 | ||
847 | const charstring sobmp1 := | |
848 | "<So-bmp>\n" & | |
849 | "\t<BMPString>BMP</BMPString>\n" & | |
850 | "</So-bmp>\n\n"; | |
851 | ||
852 | const charstring sobmp3 := | |
853 | "<So-bmp>\n" & | |
854 | "\t<BMPString>Bee</BMPString>\n" & | |
855 | "\t<BMPString>Emm</BMPString>\n" & | |
856 | "\t<BMPString>Pee</BMPString>\n" & | |
857 | "\t<BMPString/>\n" & | |
858 | "</So-bmp>\n\n"; | |
859 | ||
860 | testcase enc_sobmp() runs on Tsets | |
861 | { | |
862 | var universal charstring expected; | |
863 | ||
864 | expected := sobmp0; | |
865 | CHECK_METHOD(bxer_enc_sobmp, so_bmp_0, expected); | |
866 | CHECK_METHOD(exer_enc_sobmp, so_bmp_0, expected); | |
867 | flatten(expected); | |
868 | CHECK_METHOD(cxer_enc_sobmp, so_bmp_0, expected & lf); | |
869 | ||
870 | expected := sobmp1; | |
871 | CHECK_METHOD(bxer_enc_sobmp, so_bmp_1, expected); | |
872 | CHECK_METHOD(exer_enc_sobmp, so_bmp_1, expected); | |
873 | flatten(expected); | |
874 | CHECK_METHOD(cxer_enc_sobmp, so_bmp_1, expected & lf); | |
875 | ||
876 | expected := sobmp3; | |
877 | CHECK_METHOD(bxer_enc_sobmp, so_bmp_3, expected); | |
878 | CHECK_METHOD(exer_enc_sobmp, so_bmp_3, expected); | |
879 | flatten(expected); | |
880 | CHECK_METHOD(cxer_enc_sobmp, so_bmp_3, expected & lf); | |
881 | } | |
882 | ||
883 | testcase dec_sobmp() runs on Tsets | |
884 | { | |
885 | // type suffix, input, type, expected | |
886 | CHECK_DECODE2( sobmp, sobmp0, So_bmp, so_bmp_0); | |
887 | CHECK_DECODE(exer_dec_sobmp, sobmp0, So_bmp, so_bmp_0); | |
888 | ||
889 | CHECK_DECODE2( sobmp, sobmp1, So_bmp, so_bmp_1); | |
890 | CHECK_DECODE(exer_dec_sobmp, sobmp1, So_bmp, so_bmp_1); | |
891 | ||
892 | CHECK_DECODE2( sobmp, sobmp3, So_bmp, so_bmp_3); | |
893 | CHECK_DECODE(exer_dec_sobmp, sobmp3, So_bmp, so_bmp_3); | |
894 | } | |
895 | ||
896 | //-------------------- SET OF GeneralString -------------------- | |
897 | ||
898 | const charstring sogen0 := | |
899 | "<So-gen/>\n\n"; | |
900 | ||
901 | const charstring sogen1 := | |
902 | "<So-gen>\n" & | |
903 | "\t<GeneralString>general</GeneralString>\n" & | |
904 | "</So-gen>\n\n"; | |
905 | ||
906 | const charstring sogen3 := | |
907 | "<So-gen>\n" & | |
908 | "\t<GeneralString>Alexis Alexander</GeneralString>\n" & | |
909 | "\t<GeneralString>'Anvil' Shin Fai</GeneralString>\n" & | |
910 | "\t<GeneralString>Rodall "Demo" Juhziz</GeneralString>\n" & | |
911 | "\t<GeneralString/>\n" & | |
912 | "</So-gen>\n\n"; | |
913 | ||
914 | testcase enc_sogen() runs on Tsets | |
915 | { | |
916 | var universal charstring expected; | |
917 | ||
918 | expected := sogen0; | |
919 | CHECK_METHOD(bxer_enc_sogen, so_gen_0, expected); | |
920 | CHECK_METHOD(exer_enc_sogen, so_gen_0, expected); | |
921 | flatten(expected); | |
922 | CHECK_METHOD(cxer_enc_sogen, so_gen_0, expected & lf); | |
923 | ||
924 | expected := sogen1; | |
925 | CHECK_METHOD(bxer_enc_sogen, so_gen_1, expected); | |
926 | CHECK_METHOD(exer_enc_sogen, so_gen_1, expected); | |
927 | flatten(expected); | |
928 | CHECK_METHOD(cxer_enc_sogen, so_gen_1, expected & lf); | |
929 | ||
930 | expected := sogen3; | |
931 | CHECK_METHOD(bxer_enc_sogen, so_gen_3, expected); | |
932 | CHECK_METHOD(exer_enc_sogen, so_gen_3, expected); | |
933 | flatten(expected); | |
934 | CHECK_METHOD(cxer_enc_sogen, so_gen_3, expected & lf); | |
935 | } | |
936 | ||
937 | testcase dec_sogen() runs on Tsets | |
938 | { | |
939 | // type suffix, input, type, expected | |
940 | CHECK_DECODE2(sogen, sogen0, So_gen, so_gen_0); | |
941 | CHECK_DECODE(exer_dec_sogen, sogen0, So_gen, so_gen_0); | |
942 | ||
943 | CHECK_DECODE2( sogen, sogen1, So_gen, so_gen_1); | |
944 | CHECK_DECODE(exer_dec_sogen, sogen1, So_gen, so_gen_1); | |
945 | ||
946 | CHECK_DECODE2( sogen, sogen3, So_gen, so_gen_3); | |
947 | CHECK_DECODE(exer_dec_sogen, sogen3, So_gen, so_gen_3); | |
948 | } | |
949 | ||
950 | //-------------------- SET OF GraphicString -------------------- | |
951 | ||
952 | const charstring sogra0 := | |
953 | "<So-gra/>\n\n"; | |
954 | ||
955 | const charstring sogra1 := | |
956 | "<So-gra>\n" & | |
957 | "\t<GraphicString>graphic</GraphicString>\n" & | |
958 | "</So-gra>\n\n"; | |
959 | ||
960 | const charstring sogra3 := | |
961 | "<So-gra>\n" & | |
962 | "\t<GraphicString>3dfx</GraphicString>\n" & | |
963 | "\t<GraphicString>nVidia</GraphicString>\n" & | |
964 | "\t<GraphicString>Matrox</GraphicString>\n" & | |
965 | "\t<GraphicString/>\n" & | |
966 | "</So-gra>\n\n"; | |
967 | ||
968 | testcase enc_sogra() runs on Tsets | |
969 | { | |
970 | var universal charstring expected; | |
971 | ||
972 | expected := sogra0; | |
973 | CHECK_METHOD(bxer_enc_sogra, so_gra_0, expected); | |
974 | CHECK_METHOD(exer_enc_sogra, so_gra_0, expected); | |
975 | flatten(expected); | |
976 | CHECK_METHOD(cxer_enc_sogra, so_gra_0, expected & lf); | |
977 | ||
978 | expected := sogra1; | |
979 | CHECK_METHOD(bxer_enc_sogra, so_gra_1, expected); | |
980 | CHECK_METHOD(exer_enc_sogra, so_gra_1, expected); | |
981 | flatten(expected); | |
982 | CHECK_METHOD(cxer_enc_sogra, so_gra_1, expected & lf); | |
983 | ||
984 | expected := sogra3; | |
985 | CHECK_METHOD(bxer_enc_sogra, so_gra_3, expected); | |
986 | CHECK_METHOD(exer_enc_sogra, so_gra_3, expected); | |
987 | flatten(expected); | |
988 | CHECK_METHOD(cxer_enc_sogra, so_gra_3, expected & lf); | |
989 | } | |
990 | ||
991 | ||
992 | testcase dec_sogra() runs on Tsets | |
993 | { | |
994 | // type suffix, input, type, expected | |
995 | CHECK_DECODE2( sogra, sogra0, So_gra, so_gra_0); | |
996 | CHECK_DECODE(exer_dec_sogra, sogra0, So_gra, so_gra_0); | |
997 | ||
998 | CHECK_DECODE2( sogra, sogra1, So_gra, so_gra_1); | |
999 | CHECK_DECODE(exer_dec_sogra, sogra1, So_gra, so_gra_1); | |
1000 | ||
1001 | CHECK_DECODE2( sogra, sogra3, So_gra, so_gra_3); | |
1002 | CHECK_DECODE(exer_dec_sogra, sogra3, So_gra, so_gra_3); | |
1003 | } | |
1004 | ||
1005 | //-------------------- SET OF IA5String -------------------- | |
1006 | ||
1007 | const charstring soia50 := | |
1008 | "<So-ia5/>\n\n"; | |
1009 | ||
1010 | const charstring soia51 := | |
1011 | "<So-ia5>\n" & | |
1012 | "\t<IA5String>IA5</IA5String>\n" & | |
1013 | "</So-ia5>\n\n"; | |
1014 | ||
1015 | const charstring soia53 := | |
1016 | "<So-ia5>\n" & | |
1017 | "\t<IA5String>IA5</IA5String>\n" & | |
1018 | "\t<IA5String>IA5</IA5String>\n" & | |
1019 | "\t<IA5String>Cthulhu fhtagn!</IA5String>\n" & | |
1020 | "\t<IA5String/>\n" & | |
1021 | "</So-ia5>\n\n"; | |
1022 | ||
1023 | testcase enc_soia5() runs on Tsets | |
1024 | { | |
1025 | var universal charstring expected; | |
1026 | ||
1027 | expected := soia50; | |
1028 | CHECK_METHOD(bxer_enc_soia5, so_ia5_0, expected); | |
1029 | CHECK_METHOD(exer_enc_soia5, so_ia5_0, expected); | |
1030 | flatten(expected); | |
1031 | CHECK_METHOD(cxer_enc_soia5, so_ia5_0, expected & lf); | |
1032 | ||
1033 | expected := soia51; | |
1034 | CHECK_METHOD(bxer_enc_soia5, so_ia5_1, expected); | |
1035 | CHECK_METHOD(exer_enc_soia5, so_ia5_1, expected); | |
1036 | flatten(expected); | |
1037 | CHECK_METHOD(cxer_enc_soia5, so_ia5_1, expected & lf); | |
1038 | ||
1039 | expected := soia53; | |
1040 | CHECK_METHOD(bxer_enc_soia5, so_ia5_3, expected); | |
1041 | CHECK_METHOD(exer_enc_soia5, so_ia5_3, expected); | |
1042 | flatten(expected); | |
1043 | CHECK_METHOD(cxer_enc_soia5, so_ia5_3, expected & lf); | |
1044 | } | |
1045 | ||
1046 | ||
1047 | testcase dec_soia5() runs on Tsets | |
1048 | { | |
1049 | // type suffix, input, type, expected | |
1050 | CHECK_DECODE2( soia5, soia50, So_ia5, so_ia5_0); | |
1051 | CHECK_DECODE(exer_dec_soia5, soia50, So_ia5, so_ia5_0); | |
1052 | ||
1053 | CHECK_DECODE2( soia5, soia51, So_ia5, so_ia5_1); | |
1054 | CHECK_DECODE(exer_dec_soia5, soia51, So_ia5, so_ia5_1); | |
1055 | ||
1056 | CHECK_DECODE2( soia5, soia53, So_ia5, so_ia5_3); | |
1057 | CHECK_DECODE(exer_dec_soia5, soia53, So_ia5, so_ia5_3); | |
1058 | } | |
1059 | ||
1060 | //-------------------- SET OF NumericString -------------------- | |
1061 | ||
1062 | const charstring sonum0 := | |
1063 | "<So-num/>\n\n"; | |
1064 | ||
1065 | const charstring sonum1 := | |
1066 | "<So-num>\n" & | |
1067 | "\t<NumericString>666</NumericString>\n" & | |
1068 | "</So-num>\n\n"; | |
1069 | ||
1070 | const charstring sonum3 := | |
1071 | "<So-num>\n" & | |
1072 | "\t<NumericString>555</NumericString>\n" & | |
1073 | "\t<NumericString>436</NumericString>\n" & | |
1074 | "\t<NumericString>3747</NumericString>\n" & | |
1075 | "\t<NumericString/>\n" & | |
1076 | "</So-num>\n\n"; | |
1077 | ||
1078 | testcase enc_sonum() runs on Tsets | |
1079 | { | |
1080 | var universal charstring expected; | |
1081 | ||
1082 | expected := sonum0; | |
1083 | CHECK_METHOD(bxer_enc_sonum, so_num_0, expected); | |
1084 | CHECK_METHOD(exer_enc_sonum, so_num_0, expected); | |
1085 | flatten(expected); | |
1086 | CHECK_METHOD(cxer_enc_sonum, so_num_0, expected & lf); | |
1087 | ||
1088 | expected := sonum1; | |
1089 | CHECK_METHOD(bxer_enc_sonum, so_num_1, expected); | |
1090 | CHECK_METHOD(exer_enc_sonum, so_num_1, expected); | |
1091 | flatten(expected); | |
1092 | CHECK_METHOD(cxer_enc_sonum, so_num_1, expected & lf); | |
1093 | ||
1094 | expected := sonum3; | |
1095 | CHECK_METHOD(bxer_enc_sonum, so_num_3, expected); | |
1096 | CHECK_METHOD(exer_enc_sonum, so_num_3, expected); | |
1097 | flatten(expected); | |
1098 | CHECK_METHOD(cxer_enc_sonum, so_num_3, expected & lf); | |
1099 | } | |
1100 | ||
1101 | testcase dec_sonum() runs on Tsets | |
1102 | { | |
1103 | // type suffix, input, type, expected | |
1104 | CHECK_DECODE2( sonum, sonum0, So_num, so_num_0); | |
1105 | CHECK_DECODE(exer_dec_sonum, sonum0, So_num, so_num_0); | |
1106 | ||
1107 | CHECK_DECODE2( sonum, sonum1, So_num, so_num_1); | |
1108 | CHECK_DECODE(exer_dec_sonum, sonum1, So_num, so_num_1); | |
1109 | ||
1110 | CHECK_DECODE2( sonum, sonum3, So_num, so_num_3); | |
1111 | CHECK_DECODE(exer_dec_sonum, sonum3, So_num, so_num_3); | |
1112 | } | |
1113 | ||
1114 | //-------------------- SET OF PrintableString -------------------- | |
1115 | ||
1116 | const charstring soprn0 := | |
1117 | "<So-prn/>\n\n"; | |
1118 | ||
1119 | const charstring soprn1 := | |
1120 | "<So-prn>\n" & | |
1121 | "\t<PrintableString>prn</PrintableString>\n" & | |
1122 | "</So-prn>\n\n"; | |
1123 | ||
1124 | // This looks like quoted-printable, but it has no special meaning. | |
1125 | // It simply contains more '=' characters than your average text :) | |
1126 | const charstring soprn3 := | |
1127 | "<So-prn>\n" & | |
1128 | "\t<PrintableString>=E1rv=EDzt=FBr=F5 t=FCk=F6rf=FAr=F3g=E9p</PrintableString>\n" & | |
1129 | "\t<PrintableString>=C1RV=CDZT=DBR=D5 T=DCK=D6RF=DAR=D3G=C9P</PrintableString>\n" & | |
1130 | "\t<PrintableString>A m=F8=F8se once bit my sister</PrintableString>\n" & | |
1131 | "\t<PrintableString/>\n" & | |
1132 | "</So-prn>\n\n"; | |
1133 | ||
1134 | testcase enc_soprn() runs on Tsets | |
1135 | { | |
1136 | var universal charstring expected; | |
1137 | ||
1138 | expected := soprn0; | |
1139 | CHECK_METHOD(bxer_enc_soprn, so_prn_0, expected); | |
1140 | CHECK_METHOD(exer_enc_soprn, so_prn_0, expected); | |
1141 | flatten(expected); | |
1142 | CHECK_METHOD(cxer_enc_soprn, so_prn_0, expected & lf); | |
1143 | ||
1144 | expected := soprn1; | |
1145 | CHECK_METHOD(bxer_enc_soprn, so_prn_1, expected); | |
1146 | CHECK_METHOD(exer_enc_soprn, so_prn_1, expected); | |
1147 | flatten(expected); | |
1148 | CHECK_METHOD(cxer_enc_soprn, so_prn_1, expected & lf); | |
1149 | ||
1150 | expected := soprn3; | |
1151 | CHECK_METHOD(bxer_enc_soprn, so_prn_3, expected); | |
1152 | CHECK_METHOD(exer_enc_soprn, so_prn_3, expected); | |
1153 | flatten(expected); | |
1154 | CHECK_METHOD(cxer_enc_soprn, so_prn_3, expected & lf); | |
1155 | } | |
1156 | ||
1157 | testcase dec_soprn() runs on Tsets | |
1158 | { | |
1159 | // type suffix, input, type, expected | |
1160 | CHECK_DECODE2( soprn, soprn0, So_prn, so_prn_0); | |
1161 | CHECK_DECODE(exer_dec_soprn, soprn0, So_prn, so_prn_0); | |
1162 | ||
1163 | CHECK_DECODE2( soprn, soprn1, So_prn, so_prn_1); | |
1164 | CHECK_DECODE(exer_dec_soprn, soprn1, So_prn, so_prn_1); | |
1165 | ||
1166 | CHECK_DECODE2( soprn, soprn3, So_prn, so_prn_3); | |
1167 | CHECK_DECODE(exer_dec_soprn, soprn3, So_prn, so_prn_3); | |
1168 | } | |
1169 | ||
1170 | //-------------------- SET OF TeletexString -------------------- | |
1171 | ||
1172 | const charstring sottx0 := | |
1173 | "<So-ttx/>\n\n"; | |
1174 | ||
1175 | const charstring sottx1 := | |
1176 | "<So-ttx>\n" & | |
1177 | "\t<TeletexString>ttx</TeletexString>\n" & | |
1178 | "</So-ttx>\n\n"; | |
1179 | ||
1180 | const charstring sottx3 := | |
1181 | "<So-ttx>\n" & | |
1182 | "\t<TeletexString>Tee</TeletexString>\n" & | |
1183 | "\t<TeletexString>Tie</TeletexString>\n" & | |
1184 | "\t<TeletexString>Ecks</TeletexString>\n" & | |
1185 | "\t<TeletexString/>\n" & | |
1186 | "</So-ttx>\n\n"; | |
1187 | ||
1188 | testcase enc_sottx() runs on Tsets | |
1189 | { | |
1190 | var universal charstring expected; | |
1191 | ||
1192 | expected := sottx0; | |
1193 | CHECK_METHOD(bxer_enc_sottx, so_ttx_0, expected); | |
1194 | CHECK_METHOD(exer_enc_sottx, so_ttx_0, expected); | |
1195 | flatten(expected); | |
1196 | CHECK_METHOD(cxer_enc_sottx, so_ttx_0, expected & lf); | |
1197 | ||
1198 | expected := sottx1; | |
1199 | CHECK_METHOD(bxer_enc_sottx, so_ttx_1, expected); | |
1200 | CHECK_METHOD(exer_enc_sottx, so_ttx_1, expected); | |
1201 | flatten(expected); | |
1202 | CHECK_METHOD(cxer_enc_sottx, so_ttx_1, expected & lf); | |
1203 | ||
1204 | expected := sottx3; | |
1205 | CHECK_METHOD(bxer_enc_sottx, so_ttx_3, expected); | |
1206 | CHECK_METHOD(exer_enc_sottx, so_ttx_3, expected); | |
1207 | flatten(expected); | |
1208 | CHECK_METHOD(cxer_enc_sottx, so_ttx_3, expected & lf); | |
1209 | } | |
1210 | ||
1211 | testcase dec_sottx() runs on Tsets | |
1212 | { | |
1213 | // type suffix, input, type, expected | |
1214 | CHECK_DECODE2( sottx, sottx0, So_ttx, so_ttx_0); | |
1215 | CHECK_DECODE(exer_dec_sottx, sottx0, So_ttx, so_ttx_0); | |
1216 | ||
1217 | CHECK_DECODE2( sottx, sottx1, So_ttx, so_ttx_1); | |
1218 | CHECK_DECODE(exer_dec_sottx, sottx0, So_ttx, so_ttx_0); | |
1219 | ||
1220 | CHECK_DECODE2( sottx, sottx3, So_ttx, so_ttx_3); | |
1221 | CHECK_DECODE(exer_dec_sottx, sottx0, So_ttx, so_ttx_0); | |
1222 | } | |
1223 | ||
1224 | //-------------------- SET OF UniversalString -------------------- | |
1225 | ||
1226 | const charstring souni0 := | |
1227 | "<So-uni/>\n\n"; | |
1228 | ||
1229 | const charstring souni1 := | |
1230 | "<So-uni>\n" & | |
1231 | "\t<UniversalString>univ</UniversalString>\n" & | |
1232 | "</So-uni>\n\n"; | |
1233 | ||
1234 | ||
1235 | const charstring souni3 := | |
1236 | "<So-uni>\n" & | |
1237 | "\t<UniversalString><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></UniversalString>\n" & | |
1238 | "\t<UniversalString><html><head></head></UniversalString>\n" & | |
1239 | "\t<UniversalString><body onload='javascript.alert("Universal")'>&nbsp;</body></html></UniversalString>\n" & | |
1240 | "\t<UniversalString/>\n" & | |
1241 | "</So-uni>\n\n"; | |
1242 | ||
1243 | testcase enc_souni() runs on Tsets | |
1244 | { | |
1245 | var universal charstring expected; | |
1246 | ||
1247 | expected := souni0; | |
1248 | CHECK_METHOD(bxer_enc_souni, so_uni_0, expected); | |
1249 | CHECK_METHOD(exer_enc_souni, so_uni_0, expected); | |
1250 | flatten(expected); | |
1251 | CHECK_METHOD(cxer_enc_souni, so_uni_0, expected & lf); | |
1252 | ||
1253 | expected := souni1; | |
1254 | CHECK_METHOD(bxer_enc_souni, so_uni_1, expected); | |
1255 | CHECK_METHOD(exer_enc_souni, so_uni_1, expected); | |
1256 | flatten(expected); | |
1257 | CHECK_METHOD(cxer_enc_souni, so_uni_1, expected & lf); | |
1258 | ||
1259 | expected := souni3; | |
1260 | CHECK_METHOD(bxer_enc_souni, so_uni_3, expected); | |
1261 | CHECK_METHOD(exer_enc_souni, so_uni_3, expected); | |
1262 | flatten(expected); | |
1263 | CHECK_METHOD(cxer_enc_souni, so_uni_3, expected & lf); | |
1264 | } | |
1265 | ||
1266 | testcase dec_souni() runs on Tsets | |
1267 | { | |
1268 | // type suffix, input, type, expected | |
1269 | CHECK_DECODE2( souni, souni0, So_uni, so_uni_0); | |
1270 | CHECK_DECODE(exer_dec_souni, souni0, So_uni, so_uni_0); | |
1271 | ||
1272 | CHECK_DECODE2( souni, souni1, So_uni, so_uni_1); | |
1273 | CHECK_DECODE(exer_dec_souni, souni1, So_uni, so_uni_1); | |
1274 | ||
1275 | CHECK_DECODE2( souni, souni3, So_uni, so_uni_3); | |
1276 | CHECK_DECODE(exer_dec_souni, souni3, So_uni, so_uni_3); | |
1277 | } | |
1278 | ||
1279 | //-------------------- SET OF UTF8String -------------------- | |
1280 | ||
1281 | const charstring soutf0 := | |
1282 | "<So-utf/>\n\n"; | |
1283 | ||
1284 | const charstring soutf1 := | |
1285 | "<So-utf>\n" & | |
1286 | "\t<UTF8String>utf</UTF8String>\n" & | |
1287 | "</So-utf>\n\n"; | |
1288 | ||
1289 | const charstring soutf3 := | |
1290 | "<So-utf>\n" & | |
1291 | "\t<UTF8String>utf</UTF8String>\n" & | |
1292 | "\t<UTF8String>utf</UTF8String>\n" & | |
1293 | "\t<UTF8String>utf</UTF8String>\n" & | |
1294 | "\t<UTF8String/>\n" & | |
1295 | "</So-utf>\n\n"; | |
1296 | ||
1297 | testcase enc_soutf() runs on Tsets | |
1298 | { | |
1299 | var universal charstring expected; | |
1300 | ||
1301 | expected := soutf0; | |
1302 | CHECK_METHOD(bxer_enc_soutf, so_utf_0, expected); | |
1303 | CHECK_METHOD(exer_enc_soutf, so_utf_0, expected); | |
1304 | flatten(expected); | |
1305 | CHECK_METHOD(cxer_enc_soutf, so_utf_0, expected & lf); | |
1306 | ||
1307 | expected := soutf1; | |
1308 | CHECK_METHOD(bxer_enc_soutf, so_utf_1, expected); | |
1309 | CHECK_METHOD(exer_enc_soutf, so_utf_1, expected); | |
1310 | flatten(expected); | |
1311 | CHECK_METHOD(cxer_enc_soutf, so_utf_1, expected & lf); | |
1312 | ||
1313 | expected := soutf3; | |
1314 | CHECK_METHOD(bxer_enc_soutf, so_utf_3, expected); | |
1315 | CHECK_METHOD(exer_enc_soutf, so_utf_3, expected); | |
1316 | flatten(expected); | |
1317 | CHECK_METHOD(cxer_enc_soutf, so_utf_3, expected & lf); | |
1318 | } | |
1319 | ||
1320 | testcase dec_soutf() runs on Tsets | |
1321 | { | |
1322 | // type suffix, input, type, expected | |
1323 | CHECK_DECODE2( soutf, soutf0, So_utf, so_utf_0); | |
1324 | CHECK_DECODE(exer_dec_soutf, soutf0, So_utf, so_utf_0); | |
1325 | ||
1326 | CHECK_DECODE2( soutf, soutf1, So_utf, so_utf_1); | |
1327 | CHECK_DECODE(exer_dec_soutf, soutf1, So_utf, so_utf_1); | |
1328 | ||
1329 | CHECK_DECODE2( soutf, soutf3, So_utf, so_utf_3); | |
1330 | CHECK_DECODE(exer_dec_soutf, soutf3, So_utf, so_utf_3); | |
1331 | } | |
1332 | ||
1333 | //-------------------- SET OF VideotexString -------------------- | |
1334 | ||
1335 | const charstring sovtx0 := | |
1336 | "<So-vtx/>\n\n"; | |
1337 | ||
1338 | const charstring sovtx1 := | |
1339 | "<So-vtx>\n" & | |
1340 | "\t<VideotexString>vtx</VideotexString>\n" & | |
1341 | "</So-vtx>\n\n"; | |
1342 | ||
1343 | const charstring sovtx3 := | |
1344 | "<So-vtx>\n" & | |
1345 | "\t<VideotexString>Vee</VideotexString>\n" & | |
1346 | "\t<VideotexString>Tee</VideotexString>\n" & | |
1347 | "\t<VideotexString>Ecxs</VideotexString>\n" & | |
1348 | "\t<VideotexString/>\n" & | |
1349 | "</So-vtx>\n\n"; | |
1350 | ||
1351 | testcase enc_sovtx() runs on Tsets | |
1352 | { | |
1353 | var universal charstring expected; | |
1354 | ||
1355 | expected := sovtx0; | |
1356 | CHECK_METHOD(bxer_enc_sovtx, so_vtx_0, expected); | |
1357 | CHECK_METHOD(exer_enc_sovtx, so_vtx_0, expected); | |
1358 | flatten(expected); | |
1359 | CHECK_METHOD(cxer_enc_sovtx, so_vtx_0, expected & lf); | |
1360 | ||
1361 | expected := sovtx1; | |
1362 | CHECK_METHOD(bxer_enc_sovtx, so_vtx_1, expected); | |
1363 | CHECK_METHOD(exer_enc_sovtx, so_vtx_1, expected); | |
1364 | flatten(expected); | |
1365 | CHECK_METHOD(cxer_enc_sovtx, so_vtx_1, expected & lf); | |
1366 | ||
1367 | expected := sovtx3; | |
1368 | CHECK_METHOD(bxer_enc_sovtx, so_vtx_3, expected); | |
1369 | CHECK_METHOD(exer_enc_sovtx, so_vtx_3, expected); | |
1370 | flatten(expected); | |
1371 | CHECK_METHOD(cxer_enc_sovtx, so_vtx_3, expected & lf); | |
1372 | } | |
1373 | ||
1374 | testcase dec_sovtx() runs on Tsets | |
1375 | { | |
1376 | // type suffix, input, type, expected | |
1377 | CHECK_DECODE2( sovtx, sovtx0, So_vtx, so_vtx_0); | |
1378 | CHECK_DECODE(exer_dec_sovtx, sovtx0, So_vtx, so_vtx_0); | |
1379 | ||
1380 | CHECK_DECODE2( sovtx, sovtx1, So_vtx, so_vtx_1); | |
1381 | CHECK_DECODE(exer_dec_sovtx, sovtx1, So_vtx, so_vtx_1); | |
1382 | ||
1383 | CHECK_DECODE2( sovtx, sovtx3, So_vtx, so_vtx_3); | |
1384 | CHECK_DECODE(exer_dec_sovtx, sovtx3, So_vtx, so_vtx_3); | |
1385 | } | |
1386 | ||
1387 | //-------------------- SET OF VisibleString -------------------- | |
1388 | ||
1389 | const charstring sovis0 := | |
1390 | "<So-vis/>\n\n"; | |
1391 | ||
1392 | const charstring sovis1 := | |
1393 | "<So-vis>\n" & | |
1394 | "\t<VisibleString>vis</VisibleString>\n" & | |
1395 | "</So-vis>\n\n"; | |
1396 | ||
1397 | const charstring sovis3 := | |
1398 | "<So-vis>\n" & | |
1399 | "\t<VisibleString>red</VisibleString>\n" & | |
1400 | "\t<VisibleString>green</VisibleString>\n" & | |
1401 | "\t<VisibleString>blue</VisibleString>\n" & | |
1402 | "\t<VisibleString/>\n" & | |
1403 | "</So-vis>\n\n"; | |
1404 | ||
1405 | testcase enc_sovis() runs on Tsets | |
1406 | { | |
1407 | var universal charstring expected; | |
1408 | ||
1409 | expected := sovis0; | |
1410 | CHECK_METHOD(bxer_enc_sovis, so_vis_0, expected); | |
1411 | CHECK_METHOD(exer_enc_sovis, so_vis_0, expected); | |
1412 | flatten(expected); | |
1413 | CHECK_METHOD(cxer_enc_sovis, so_vis_0, expected & lf); | |
1414 | ||
1415 | expected := sovis1; | |
1416 | CHECK_METHOD(bxer_enc_sovis, so_vis_1, expected); | |
1417 | CHECK_METHOD(exer_enc_sovis, so_vis_1, expected); | |
1418 | flatten(expected); | |
1419 | CHECK_METHOD(cxer_enc_sovis, so_vis_1, expected & lf); | |
1420 | ||
1421 | expected := sovis3; | |
1422 | CHECK_METHOD(bxer_enc_sovis, so_vis_3, expected); | |
1423 | CHECK_METHOD(exer_enc_sovis, so_vis_3, expected); | |
1424 | flatten(expected); | |
1425 | CHECK_METHOD(cxer_enc_sovis, so_vis_3, expected & lf); | |
1426 | } | |
1427 | ||
1428 | testcase dec_sovis() runs on Tsets | |
1429 | { | |
1430 | // type suffix, input, type, expected | |
1431 | CHECK_DECODE2( sovis, sovis0, So_vis, so_vis_0); | |
1432 | CHECK_DECODE(exer_dec_sovis, sovis0, So_vis, so_vis_0); | |
1433 | ||
1434 | CHECK_DECODE2( sovis, sovis1, So_vis, so_vis_1); | |
1435 | CHECK_DECODE(exer_dec_sovis, sovis1, So_vis, so_vis_1); | |
1436 | ||
1437 | CHECK_DECODE2( sovis, sovis3, So_vis, so_vis_3); | |
1438 | CHECK_DECODE(exer_dec_sovis, sovis3, So_vis, so_vis_3); | |
1439 | } | |
1440 | ||
1441 | //-------------------- SET OF CHARACTER STRING -------------------- | |
1442 | ||
1443 | const charstring sounr0 := | |
1444 | "<So-unr/>\n\n"; | |
1445 | ||
1446 | const charstring sounr1 := | |
1447 | "<So-unr>\n" & | |
1448 | "\t<SEQUENCE>\n" & | |
1449 | "\t\t<identification>\n" & | |
1450 | "\t\t\t<fixed/>\n" & | |
1451 | "\t\t</identification>\n" & | |
1452 | "\t\t<string-value>" & | |
1453 | //"\t\t\tC3815256 C38D5A54 C5B052C5 902054C3 9C4BC396 5246C39A 52C39347 C38950\n" & | |
1454 | "C3815256C38D5A54C5B052C5902054C39C4BC3965246C39A52C39347C38950" & | |
1455 | "</string-value>\n" & | |
1456 | "\t</SEQUENCE>\n" & | |
1457 | "</So-unr>\n\n"; | |
1458 | ||
1459 | const charstring sounr3 := | |
1460 | "<So-unr>\n" & | |
1461 | ||
1462 | "\t<SEQUENCE>\n" & | |
1463 | "\t\t<identification>\n" & | |
1464 | "\t\t\t<fixed/>\n" & | |
1465 | "\t\t</identification>\n" & | |
1466 | "\t\t<string-value>" & | |
1467 | "C3815256C38D5A54C5B052C5902054C39C4BC3965246C39A52C39347C38950" & | |
1468 | "</string-value>\n" & | |
1469 | "\t</SEQUENCE>\n" & | |
1470 | ||
1471 | ||
1472 | ||
1473 | "\t<SEQUENCE>\n" & | |
1474 | "\t\t<identification>\n" & | |
1475 | "\t\t\t<syntaxes>\n" & | |
1476 | "\t\t\t\t<abstract>1.2.3.4</abstract>\n" & | |
1477 | "\t\t\t\t<transfer>2.7.1.8</transfer>\n" & | |
1478 | "\t\t\t</syntaxes>\n" & | |
1479 | "\t\t</identification>\n" & | |
1480 | "\t\t<string-value>C3A17276C3AD7A74C5B172C5912074C3</string-value>\n" & | |
1481 | "\t</SEQUENCE>\n" & | |
1482 | ||
1483 | "\t<SEQUENCE>\n" & | |
1484 | "\t\t<identification>\n" & | |
1485 | "\t\t\t<syntax>1.2.3.4</syntax>\n" & | |
1486 | "\t\t</identification>\n" & | |
1487 | "\t\t<string-value>BC6BC3B67266C3BA72C3B367C3A970</string-value>\n" & | |
1488 | "\t</SEQUENCE>\n" & | |
1489 | ||
1490 | "</So-unr>\n\n"; | |
1491 | ||
1492 | ||
1493 | testcase enc_sounr() runs on Tsets | |
1494 | { | |
1495 | var universal charstring expected; | |
1496 | ||
1497 | expected := sounr0; | |
1498 | CHECK_METHOD(bxer_enc_sounr, so_unr_0, expected); | |
1499 | CHECK_METHOD(exer_enc_sounr, so_unr_0, expected); | |
1500 | flatten(expected); | |
1501 | CHECK_METHOD(cxer_enc_sounr, so_unr_0, expected & lf); | |
1502 | ||
1503 | expected := sounr1; | |
1504 | CHECK_METHOD(bxer_enc_sounr, so_unr_1, expected); | |
1505 | CHECK_METHOD(exer_enc_sounr, so_unr_1, expected); | |
1506 | flatten(expected); | |
1507 | CHECK_METHOD(cxer_enc_sounr, so_unr_1, expected & lf); | |
1508 | ||
1509 | expected := sounr3; | |
1510 | CHECK_METHOD(bxer_enc_sounr, so_unr_3, expected); | |
1511 | CHECK_METHOD(exer_enc_sounr, so_unr_3, expected); | |
1512 | flatten(expected); | |
1513 | CHECK_METHOD(cxer_enc_sounr, so_unr_3, expected & lf); | |
1514 | } | |
1515 | ||
1516 | testcase dec_sounr() runs on Tsets | |
1517 | { | |
1518 | // type suffix, input, type, expected | |
1519 | CHECK_DECODE2( sounr, sounr0, So_unr, so_unr_0); | |
1520 | CHECK_DECODE(exer_dec_sounr, sounr0, So_unr, so_unr_0); | |
1521 | ||
1522 | CHECK_DECODE2( sounr, sounr1, So_unr, so_unr_1); | |
1523 | CHECK_DECODE(exer_dec_sounr, sounr1, So_unr, so_unr_1); | |
1524 | ||
1525 | CHECK_DECODE2( sounr, sounr3, So_unr, so_unr_3); | |
1526 | CHECK_DECODE(exer_dec_sounr, sounr3, So_unr, so_unr_3); | |
1527 | } | |
1528 | ||
1529 | //-------------------- SET OF selection type -------------------- | |
1530 | ||
1531 | const charstring sosel0 := | |
1532 | "<Sosel/>\n\n"; | |
1533 | ||
1534 | const charstring sosel1 := | |
1535 | "<Sosel>\n" & | |
1536 | "\t<Sel>1.602176e-19</Sel>\n" & | |
1537 | "</Sosel>\n\n"; | |
1538 | ||
1539 | const charstring sosel3 := | |
1540 | "<Sosel>\n" & | |
1541 | "\t<Sel>0.841471</Sel>\n" & | |
1542 | "\t<Sel>0.909297</Sel>\n" & | |
1543 | "\t<Sel>0.141120</Sel>\n" & | |
1544 | "</Sosel>\n\n"; | |
1545 | ||
1546 | ||
1547 | testcase enc_sosel() runs on Tsets | |
1548 | { | |
1549 | var universal charstring expected; | |
1550 | ||
1551 | expected := sosel0; | |
1552 | CHECK_METHOD(bxer_enc_sosel, SetValues.sosel_0, expected); | |
1553 | flatten(expected); | |
1554 | CHECK_METHOD(cxer_enc_sosel, SetValues.sosel_0, expected & lf); | |
1555 | ||
1556 | expected := sosel1; | |
1557 | CHECK_METHOD(bxer_enc_sosel, SetValues.sosel_1, expected); | |
1558 | flatten(expected); | |
1559 | CHECK_METHOD(cxer_enc_sosel, SetValues.sosel_1, expected & lf); | |
1560 | ||
1561 | expected := sosel3; | |
1562 | CHECK_METHOD(bxer_enc_sosel, SetValues.sosel_3, expected); | |
1563 | flatten(expected); | |
1564 | CHECK_METHOD(cxer_enc_sosel, SetValues.sosel_3, expected & lf); | |
1565 | } | |
1566 | ||
1567 | testcase dec_sosel() runs on Tsets | |
1568 | { | |
1569 | // type suffix, input, type, expected | |
1570 | CHECK_DECODE2( sosel, sosel0, Sosel, SetValues.sosel_0); | |
1571 | CHECK_DECODE(exer_dec_sosel, sosel0, Sosel, SetValues.sosel_0); | |
1572 | ||
1573 | CHECK_DECODE2( sosel, sosel1, Sosel, SetValues.sosel_1); | |
1574 | CHECK_DECODE(exer_dec_sosel, sosel1, Sosel, SetValues.sosel_1); | |
1575 | ||
1576 | CHECK_DECODE2( sosel, sosel3, Sosel, SetValues.sosel_3); | |
1577 | CHECK_DECODE(exer_dec_sosel, sosel3, Sosel, SetValues.sosel_3); | |
1578 | } | |
1579 | ||
1580 | ||
1581 | ||
1582 | // enc_sonc is folded into enc_soc | |
1583 | ||
1584 | /***********************************************/ | |
1585 | ||
1586 | ||
1587 | control { | |
1588 | execute(enc_sobs()); | |
1589 | execute(dec_sobs()); | |
1590 | ||
1591 | execute(enc_sobo()); | |
1592 | execute(dec_sobo()); | |
1593 | ||
1594 | execute(enc_soc()); | |
1595 | execute(dec_soc()); | |
1596 | ||
1597 | execute(enc_sopdv()); | |
1598 | execute(dec_sopdv()); | |
1599 | ||
1600 | execute(enc_soen()); | |
1601 | execute(dec_soen()); | |
1602 | ||
1603 | execute(enc_soex()); | |
1604 | execute(dec_soex()); | |
1605 | ||
1606 | // execute(enc_soin()); | |
1607 | execute(enc_soint()); | |
1608 | execute(dec_soint()); | |
1609 | ||
1610 | execute(enc_son()); | |
1611 | execute(dec_son()); | |
1612 | // execute(enc_socsf()); | |
1613 | execute(enc_soid()); | |
1614 | execute(dec_soid()); | |
1615 | ||
1616 | execute(enc_soos()); | |
1617 | execute(dec_soos()); | |
1618 | ||
1619 | execute(enc_sor()); | |
1620 | execute(dec_sor()); | |
1621 | ||
1622 | execute(enc_soroid()); | |
1623 | execute(dec_soroid()); | |
1624 | ||
1625 | execute(enc_sobmp()); | |
1626 | execute(dec_sobmp()); | |
1627 | ||
1628 | execute(enc_sogen()); | |
1629 | execute(dec_sogen()); | |
1630 | ||
1631 | execute(enc_sogra()); | |
1632 | execute(dec_sogra()); | |
1633 | ||
1634 | execute(enc_soia5()); | |
1635 | execute(dec_soia5()); | |
1636 | ||
1637 | execute(enc_sonum()); | |
1638 | execute(dec_sonum()); | |
1639 | ||
1640 | execute(enc_soprn()); | |
1641 | execute(dec_soprn()); | |
1642 | ||
1643 | execute(enc_sottx()); | |
1644 | execute(dec_sottx()); | |
1645 | ||
1646 | // same as above: execute(enc_sot61()); | |
1647 | execute(enc_souni()); | |
1648 | execute(dec_souni()); | |
1649 | ||
1650 | execute(enc_soutf()); | |
1651 | execute(dec_soutf()); | |
1652 | ||
1653 | execute(enc_sovtx()); | |
1654 | execute(dec_sovtx()); | |
1655 | ||
1656 | execute(enc_sovis()); | |
1657 | execute(dec_sovis()); | |
1658 | ||
1659 | // same as above: execute(enc_so646()); | |
1660 | execute(enc_sounr()); | |
1661 | execute(dec_sounr()); | |
1662 | ||
1663 | ||
1664 | // oddities | |
1665 | ||
1666 | execute(enc_sosel()); | |
1667 | execute(dec_sosel()); | |
1668 | } | |
1669 | ||
1670 | } |