ucharstring_test.ttcn 28.8 KB
Newer Older
1
/******************************************************************************
balaskoa's avatar
balaskoa committed
2
 * Copyright (c) 2000-2020 Ericsson Telecom AB
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
 *
 * Contributors:
 *   Balasko, Jeno
 *
 ******************************************************************************/
module ucharstring_test {
//=========================================================================
// Import Part
//=========================================================================

import from types2 all;
//import from functions all;

//=========================================================================
// Module Parameters
//=========================================================================
modulepar {
  
  //modulepar charstrings not modified from cfg file
  template universal charstring tspt_ucs_v := "ABBA";
  template universal charstring tspt_ucs_o := omit;
  template universal charstring tspt_ucs_a := *;
  template universal charstring tspt_ucs_q := ?;
  template universal charstring tspt_ucs_al1 := * length(2); //length restriction
  template universal charstring tspt_ucs_al2 := * length(2..4);
  template universal charstring tspt_ucs_ql1 := ? length(2);
  template universal charstring tspt_ucs_ql2 := ? length(2..4);
  template universal charstring tspt_ucs_vl1 := ("ABBA");
  template universal charstring tspt_ucs_vl2 := ("ABBA","baba");
  template universal charstring tspt_ucs_vl3 := ("ABBA","baba","Bye");
  template universal charstring tspt_ucs_c1 := complement("ABBA")
  template universal charstring tspt_ucs_c2 := complement("ABBA","baba");
  template universal charstring tspt_ucs_c3 := complement("ABBA","baba","Bye");
  template universal charstring tspt_ucs_r1 := ("A".."B"); //range
  template universal charstring tspt_ucs_r2 := ("a".."c");
  template universal charstring tspt_ucs_pa := pattern "abc*xyz"
  template universal charstring tspt_ucs_pq := pattern "abc?xyz"
  
  template universal charstring tspt_ucs_vifp := "ABBA" ifpresent;
  template universal charstring tspt_ucs_oifp := omit ifpresent;
  template universal charstring tspt_ucs_aifp := * ifpresent;
  template universal charstring tspt_ucs_qifp := ? ifpresent;
  template universal charstring tspt_ucs_al1ifp := * length(2) ifpresent; //length restriction
  template universal charstring tspt_ucs_al2ifp := * length(2..4) ifpresent;
  template universal charstring tspt_ucs_ql1ifp := ? length(2) ifpresent;
  template universal charstring tspt_ucs_ql2ifp := ? length(2..4) ifpresent;
  template universal charstring tspt_ucs_vl1ifp := ("ABBA") ifpresent;
  template universal charstring tspt_ucs_vl2ifp := ("ABBA","baba") ifpresent;
  template universal charstring tspt_ucs_vl3ifp := ("ABBA","baba","Bye") ifpresent;
  template universal charstring tspt_ucs_c1ifp := complement("ABBA") ifpresent
  template universal charstring tspt_ucs_c2ifp := complement("ABBA","baba") ifpresent;
  template universal charstring tspt_ucs_c3ifp := complement("ABBA","baba","Bye") ifpresent;
  template universal charstring tspt_ucs_r1ifp := ("A".."B") ifpresent; //range
  template universal charstring tspt_ucs_r2ifp := ("a".."c") ifpresent;
  template universal charstring tspt_ucs_paifp := pattern "abc*xyz"  ifpresent
  template universal charstring tspt_ucs_pqifp := pattern "abc?xyz"  ifpresent  
  
  //modulepar universal charstrings modified from cfg file
  template universal charstring tspt_ucs_mod4v := * //after mod:"ABBA";
  template universal charstring tspt_ucs_mod4o := * //omit;
  template universal charstring tspt_ucs_mod4ol := * //omit;
  template universal charstring tspt_ucs_mod4a := "A" //*;
  template universal charstring tspt_ucs_mod4q := "" //?;
  template universal charstring tspt_ucs_mod4al1 := "A" //* length(2); //length restriction
  template universal charstring tspt_ucs_mod4al2 := "Original" //mofified for: * length(2..4);
  template universal charstring tspt_ucs_mod4ql1 := "Original" //mofified for:? length(2);
  template universal charstring tspt_ucs_mod4ql2 := "Original" //mofified for:? length(2..4);
  template universal charstring tspt_ucs_mod4vl1 := ("ABBA") //TODO: Adam //It should be mofified for: ("ABBA");
  template universal charstring tspt_ucs_mod4vl2 := "Original" //mofified for:("ABBA","baba");
  template universal charstring tspt_ucs_mod4vl3 := "Original" //mofified for:("ABBA","baba","Bye");
  template universal charstring tspt_ucs_mod4c1 := "Original" //mofified for:complement("ABBA")
  template universal charstring tspt_ucs_mod4c2 := "Original" //mofified for:complement("ABBA","baba");
  template universal charstring tspt_ucs_mod4c3 := "Original" //mofified for:complement("ABBA","baba","Bye");
  template universal charstring tspt_ucs_mod4r1 := "Original" //mofified for:("A".."B"); //range
  template universal charstring tspt_ucs_mod4r2 := "Original" //mofified for:("a".."c");
  template universal charstring tspt_ucs_mod4pa := "Original" //mofified for:pattern "abc*xyz"
  template universal charstring tspt_ucs_mod4pq := "Original" //mofified for:pattern "abc?xyz"
  
  template universal charstring tspt_ucs_mod4vifp := "Original" //mofified for:"ABBA" ifpresent;
  template universal charstring tspt_ucs_mod4oifp := "Original" //mofified for:omit ifpresent;
  template universal charstring tspt_ucs_mod4aifp := "Original" //mofified for:* ifpresent;
  template universal charstring tspt_ucs_mod4qifp := "Original" //mofified for:? ifpresent;
  template universal charstring tspt_ucs_mod4al1ifp := "Original" //mofified for:* length(2) ifpresent; //length restriction
  template universal charstring tspt_ucs_mod4al2ifp := "Original" //mofified for:* length(2..4) ifpresent;
  template universal charstring tspt_ucs_mod4ql1ifp := "Original" //mofified for:? length(2) ifpresent;
  template universal charstring tspt_ucs_mod4ql2ifp := "Original" //mofified for:? length(2..4) ifpresent;
  template universal charstring tspt_ucs_mod4vl1ifp :=  ("ABBA") ifpresent //TODO: Adam //It should be mofified for: ("ABBA");
  template universal charstring tspt_ucs_mod4vl2ifp := "Original" //mofified for:("ABBA","baba") ifpresent;
  template universal charstring tspt_ucs_mod4vl3ifp := "Original" //mofified for:("ABBA","baba","Bye") ifpresent;
  template universal charstring tspt_ucs_mod4c1ifp := "Original" //mofified for:complement("ABBA") ifpresent
  template universal charstring tspt_ucs_mod4c2ifp := "Original" //mofified for:complement("ABBA","baba") ifpresent;
  template universal charstring tspt_ucs_mod4c3ifp := "Original" //mofified for:complement("ABBA","baba","Bye") ifpresent;
  template universal charstring tspt_ucs_mod4r1ifp := "Original" //mofified for:("A".."B") ifpresent; //range
  template universal charstring tspt_ucs_mod4r2ifp := "Original" //mofified for:("a".."c") ifpresent;
  template universal charstring tspt_ucs_mod4paifp := "Original" //mofified for:pattern "abc*xyz"  ifpresent
  template universal charstring tspt_ucs_mod4pqifp := "Original" //mofified for:pattern "abc?xyz"  ifpresent  
  
}

//=========================================================================
// Templates
//=========================================================================
// not modulepars
template universal charstring t_ucs_v := "ABBA";
template universal charstring t_ucs_o := omit;
template universal charstring t_ucs_a := *;
template universal charstring t_ucs_q := ?;
template universal charstring t_ucs_al1 := * length(2); //length restriction
template universal charstring t_ucs_al2 := * length(2..4);
template universal charstring t_ucs_ql1 := ? length(2);
template universal charstring t_ucs_ql2 := ? length(2..4);
template universal charstring t_ucs_vl1 := ("ABBA");
template universal charstring t_ucs_vl2 := ("ABBA","baba");
template universal charstring t_ucs_vl3 := ("ABBA","baba","Bye");
template universal charstring t_ucs_c1 := complement("ABBA")
template universal charstring t_ucs_c2 := complement("ABBA","baba");
template universal charstring t_ucs_c3 := complement("ABBA","baba","Bye");
template universal charstring t_ucs_r1 := ("A".."B"); //range
template universal charstring t_ucs_r2 := ("a".."c");
template universal charstring t_ucs_pa := pattern "abc*xyz"
template universal charstring t_ucs_pq := pattern "abc?xyz"

template universal charstring t_ucs_vifp := "ABBA" ifpresent;
template universal charstring t_ucs_oifp := omit ifpresent;
template universal charstring t_ucs_aifp := * ifpresent;
template universal charstring t_ucs_qifp := ? ifpresent;
template universal charstring t_ucs_al1ifp := * length(2) ifpresent; //length restriction
template universal charstring t_ucs_al2ifp := * length(2..4) ifpresent;
template universal charstring t_ucs_ql1ifp := ? length(2) ifpresent;
template universal charstring t_ucs_ql2ifp := ? length(2..4) ifpresent;
template universal charstring t_ucs_vl1ifp := ("ABBA") ifpresent;
template universal charstring t_ucs_vl2ifp := ("ABBA","baba") ifpresent;
template universal charstring t_ucs_vl3ifp := ("ABBA","baba","Bye") ifpresent;
template universal charstring t_ucs_c1ifp := complement("ABBA") ifpresent
template universal charstring t_ucs_c2ifp := complement("ABBA","baba") ifpresent;
template universal charstring t_ucs_c3ifp := complement("ABBA","baba","Bye") ifpresent;
template universal charstring t_ucs_r1ifp := ("A".."B") ifpresent; //range
template universal charstring t_ucs_r2ifp := ("a".."c") ifpresent;
template universal charstring t_ucs_paifp := pattern "abc*xyz"  ifpresent
template universal charstring t_ucs_pqifp := pattern "abc?xyz"  ifpresent

//=========================================================================
// Functions
//=========================================================================

function f_string2ttcn_rucs_t(in charstring pl_cs, in template RUCS pl_expected_result) {
  var template RUCS vl_result;
  @try {
    string2ttcn(pl_cs,vl_result);
    setverdict(pass) 
  }
  @catch(err_str) {
    log("string2ttcn() failed: ",err_str);
    setverdict(fail);
  }
  log(pl_expected_result);
  log(vl_result);
  if( log2str(pl_expected_result) == log2str(vl_result) ) { setverdict(pass) } else { setverdict(fail) }
}

function f_string2ttcn_rucs_t_str(in charstring pl_cs, in charstring pl_expected_result) {
  var template RUCS vl_result;
  @try {
    string2ttcn(pl_cs,vl_result);
    setverdict(pass) 
  }
  @catch(err_str) {
    log("str2ttcn() failed: ",err_str);
    setverdict(fail);
  }
  log("Expected result: ", pl_expected_result);
  log("Result: ", vl_result);
  if( pl_expected_result == log2str(vl_result) ) { setverdict(pass) } else { setverdict(fail) }
}

//template string -> variable conversion
//expected result: error
function f_string2ttcn_rucs_v(in charstring pl_cs, in template RUCS pl_expected_result, in boolean pl_ok_expected) {
  var RUCS vl_result;
  if( pl_ok_expected ) {
    @try {
      string2ttcn(pl_cs, vl_result);
      setverdict(pass);
    }
    @catch(err_str) {
      log("string2ttcn() failed: ",err_str);
      setverdict(fail);
    }
    if( log2str(pl_expected_result) == log2str(vl_result) ) { setverdict(pass) } else { setverdict(fail) }
  } 
  else 
  {
    @try {
      string2ttcn(pl_cs, vl_result);
      setverdict(fail);
    }
    @catch(err_str) {
      log("string2ttcn() conversion error: ",err_str);
      setverdict(pass,"Expected error, ok");
    }
    
  }
  log("Expected result: ",pl_expected_result );
  log("Result: ", vl_result);
}

//this function is the same but uses
function f_string2ttcn_rucs_v_str(in charstring pl_cs, charstring pl_expected_result, in boolean pl_ok_expected) {
  var RUCS vl_result;
  if( pl_ok_expected ) {
    @try {
      string2ttcn(pl_cs, vl_result);
      setverdict(pass);
    }
    @catch(err_str) {
      log("str2ttcn() failed: ",err_str);
      setverdict(fail);
    }
    if( pl_expected_result == log2str(vl_result) ) { setverdict(pass) } else { setverdict(fail) }
  } 
  else 
  {
    @try {
      string2ttcn(pl_cs, vl_result);
      setverdict(fail);
    }
    @catch(err_str) {
      log("str2ttcn() conversion error: ",err_str);
      setverdict(pass,"Expected error, ok");
    }
    
  }
  log("Expected result: ", pl_expected_result );
  log("Result: ", vl_result);
}

//=========================================================================
// Testcases
//=========================================================================

testcase tc_ucs_ttcn2string_emb() runs on MC {
  log(t_rucs(tspt_ucs_mod4v));
  log(ttcn2string(t_rucs(tspt_ucs_mod4v)));
  if(ttcn2string(t_rucs(tspt_ucs_mod4v)) != "{ ucs := \"ABBA\" }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4o));
  if(ttcn2string(t_rucs(tspt_ucs_mod4o)) != "{ ucs := omit }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4a));
  if(ttcn2string(t_rucs(tspt_ucs_mod4a)) != "{ ucs := * }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4q));
  if(ttcn2string(t_rucs(tspt_ucs_mod4q)) != "{ ucs := ? }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4al1));
  if(ttcn2string(t_rucs(tspt_ucs_mod4al1)) != "{ ucs := * length (2) }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4al2));
  if(ttcn2string(t_rucs(tspt_ucs_mod4al2)) != "{ ucs := * length (2 .. 4) }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4ql1));
  if(ttcn2string(t_rucs(tspt_ucs_mod4ql1)) != "{ ucs := ? length (2) }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4ql2));
  if(ttcn2string(t_rucs(tspt_ucs_mod4ql2)) != "{ ucs := ? length (2 .. 4) }") {setverdict(fail)} else {setverdict(pass)};
  log(">",t_rucs(tspt_ucs_mod4vl1),"<");
  if(ttcn2string(t_rucs(tspt_ucs_mod4vl1)) != "{ ucs := \"ABBA\" }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4vl2));
  if(ttcn2string(t_rucs(tspt_ucs_mod4vl2)) != "{ ucs := (char(0, 0, 0, 193) & \"d\" & char(0, 0, 0, 225) & \"m\", char(0, 0, 0, 201) & \"va\") }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4vl3));
  if(ttcn2string(t_rucs(tspt_ucs_mod4vl3)) != "{ ucs := (\"ABBA\", \"baba\", \"Bye\") }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4c1));
  if(ttcn2string(t_rucs(tspt_ucs_mod4c1)) != "{ ucs := complement(\"ABBA\") }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4c2));
  if(ttcn2string(t_rucs(tspt_ucs_mod4c2)) != "{ ucs := complement(\"ABBA\", \"baba\") }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4c3));
  if(ttcn2string(t_rucs(tspt_ucs_mod4c3)) != "{ ucs := complement(\"ABBA\", \"baba\", \"Bye\") }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4r1));
  if(ttcn2string(t_rucs(tspt_ucs_mod4r1)) != "{ ucs := (\"A\" .. \"B\") }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4r2));
  if(ttcn2string(t_rucs(tspt_ucs_mod4r2)) != "{ ucs := (\"a\" .. \"c\") }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4pa));
  if(ttcn2string(t_rucs(tspt_ucs_mod4pa)) != "{ ucs := pattern \"abc*xyz\" }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4pq));
  if(ttcn2string(t_rucs(tspt_ucs_mod4pq)) != "{ ucs := pattern \"abc?xyz\" }") {setverdict(fail)} else {setverdict(pass)};
  //==
  log(t_rucs(tspt_ucs_mod4vifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4vifp)) != "{ ucs := \"ABBA\" ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4oifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4oifp)) != "{ ucs := omit ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4aifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4aifp)) != "{ ucs := * ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4qifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4qifp)) != "{ ucs := ? ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4al1ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4al1ifp)) != "{ ucs := * length (2) ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4al2ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4al2ifp)) != "{ ucs := * length (2 .. 4) ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4ql1ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4ql1ifp)) != "{ ucs := ? length (2) ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4ql2ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4ql2ifp)) != "{ ucs := ? length (2 .. 4) ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4vl1ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4vl1ifp)) != "{ ucs := \"ABBA\" ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4vl2ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4vl2ifp)) != "{ ucs := (\"ABBA\", \"baba\") ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4vl3ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4vl3ifp)) != "{ ucs := (\"ABBA\", \"baba\", \"Bye\") ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4c1ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4c1ifp)) != "{ ucs := complement(\"ABBA\") ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4c2ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4c2ifp)) != "{ ucs := complement(\"ABBA\", \"baba\") ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4c3ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4c3ifp)) != "{ ucs := complement(\"ABBA\", \"baba\", \"Bye\") ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4r1ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4r1ifp)) != "{ ucs := (\"A\" .. \"B\") ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4r2ifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4r2ifp)) != "{ ucs := (\"a\" .. \"c\") ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4paifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4paifp)) != "{ ucs := pattern \"abc*xyz\" ifpresent }") {setverdict(fail)} else {setverdict(pass)};
  log(t_rucs(tspt_ucs_mod4pqifp));
  if(ttcn2string(t_rucs(tspt_ucs_mod4pqifp)) != "{ ucs := pattern \"abc?xyz\" ifpresent }") {setverdict(fail)} else {setverdict(pass)};
}

//==== string2ttcn testcases ===============================================================
//These testcases tests if
// 1. string2ttcn can generate the expected template
// 2. string2ttcn can generate the expected value, if possible/required (=true the third arg)
//===========================================================================================
testcase tc_ucs_string2ttcn_mod4v() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4v)),t_rucs(tspt_ucs_mod4v));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4v)),t_rucs(tspt_ucs_mod4v),true);
}

testcase tc_ucs_string2ttcn_mod4o() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4o)),t_rucs(tspt_ucs_mod4o));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4o)),t_rucs(tspt_ucs_mod4o),true);
}

//omit length
testcase tc_ucs_string2ttcn_mod4ol() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4ol)),t_rucs(tspt_ucs_mod4ol));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4ol)),t_rucs(tspt_ucs_mod4ol),false);
}

testcase tc_ucs_string2ttcn_mod4a() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4a)),t_rucs(tspt_ucs_mod4a));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4a)),t_rucs(tspt_ucs_mod4a),false);
}

testcase tc_ucs_string2ttcn_mod4q() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4q)),t_rucs(tspt_ucs_mod4q));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4q)),t_rucs(tspt_ucs_mod4q),false);
}

testcase tc_ucs_string2ttcn_mod4al1() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4al1)),t_rucs(tspt_ucs_mod4al1));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4al1)),t_rucs(tspt_ucs_mod4al1),false);
}

testcase tc_ucs_string2ttcn_mod4al2() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4al2)),t_rucs(tspt_ucs_mod4al2));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4al2)),t_rucs(tspt_ucs_mod4al2),false);
}

testcase tc_ucs_string2ttcn_mod4ql1() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4ql1)),t_rucs(tspt_ucs_mod4ql1));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4ql1)),t_rucs(tspt_ucs_mod4ql1),false);
}

testcase tc_ucs_string2ttcn_mod4ql2() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4ql2)),t_rucs(tspt_ucs_mod4ql2));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4ql2)),t_rucs(tspt_ucs_mod4ql2),false);
}

testcase tc_ucs_string2ttcn_mod4vl1() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4vl1)),t_rucs(tspt_ucs_mod4vl1));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4vl1)),t_rucs(tspt_ucs_mod4vl1),true);
}

testcase tc_ucs_string2ttcn_mod4vl2() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4vl2)),t_rucs(tspt_ucs_mod4vl2));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4vl2)),t_rucs(tspt_ucs_mod4vl2),false);
}

testcase tc_ucs_string2ttcn_mod4vl3() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4vl3)),t_rucs(tspt_ucs_mod4vl3));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4vl3)),t_rucs(tspt_ucs_mod4vl3),false);
}

testcase tc_ucs_string2ttcn_mod4c1() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4c1)),t_rucs(tspt_ucs_mod4c1));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4c1)),t_rucs(tspt_ucs_mod4c1),false);
}

testcase tc_ucs_string2ttcn_mod4c2() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4c2)),t_rucs(tspt_ucs_mod4c2));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4c2)),t_rucs(tspt_ucs_mod4c2),false);
}

testcase tc_ucs_string2ttcn_mod4c3() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4c3)),t_rucs(tspt_ucs_mod4c3));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4c3)),t_rucs(tspt_ucs_mod4c3),false);
}

testcase tc_ucs_string2ttcn_mod4r1() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4r1)),t_rucs(tspt_ucs_mod4r1));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4r1)),t_rucs(tspt_ucs_mod4r1),false);
}

testcase tc_ucs_string2ttcn_mod4r2() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4r2)),t_rucs(tspt_ucs_mod4r2));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4r2)),t_rucs(tspt_ucs_mod4r2),false);
}

testcase tc_ucs_string2ttcn_mod4pa() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4pa)),t_rucs(tspt_ucs_mod4pa));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4pa)),t_rucs(tspt_ucs_mod4pa),false);
}

testcase tc_ucs_string2ttcn_mod4pq() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4pq)),t_rucs(tspt_ucs_mod4pq));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4pq)),t_rucs(tspt_ucs_mod4pq),false);
}

// ifp

testcase tc_ucs_string2ttcn_mod4vifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4vifp)),t_rucs(tspt_ucs_mod4vifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4vifp)),t_rucs(tspt_ucs_mod4vifp),false);
}

testcase tc_ucs_string2ttcn_mod4oifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4oifp)),t_rucs(tspt_ucs_mod4oifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4oifp)),t_rucs(tspt_ucs_mod4oifp),false);
}

testcase tc_ucs_string2ttcn_mod4aifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4aifp)),t_rucs(tspt_ucs_mod4aifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4aifp)),t_rucs(tspt_ucs_mod4aifp),false);
}

testcase tc_ucs_string2ttcn_mod4qifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4qifp)),t_rucs(tspt_ucs_mod4qifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4qifp)),t_rucs(tspt_ucs_mod4qifp),false);
}

testcase tc_ucs_string2ttcn_mod4al1ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4al1ifp)),t_rucs(tspt_ucs_mod4al1ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4al1ifp)),t_rucs(tspt_ucs_mod4al1ifp),false);
}

testcase tc_ucs_string2ttcn_mod4al2ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4al2ifp)),t_rucs(tspt_ucs_mod4al2ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4al2ifp)),t_rucs(tspt_ucs_mod4al2ifp),false);
}

testcase tc_ucs_string2ttcn_mod4ql1ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4ql1ifp)),t_rucs(tspt_ucs_mod4ql1ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4ql1ifp)),t_rucs(tspt_ucs_mod4ql1ifp),false);
}

testcase tc_ucs_string2ttcn_mod4ql2ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4ql2ifp)),t_rucs(tspt_ucs_mod4ql2ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4ql2ifp)),t_rucs(tspt_ucs_mod4ql2ifp),false);
}

testcase tc_ucs_string2ttcn_mod4vl1ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4vl1ifp)),t_rucs(tspt_ucs_mod4vl1ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4vl1ifp)),t_rucs(tspt_ucs_mod4vl1ifp),false);
}

testcase tc_ucs_string2ttcn_mod4vl2ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4vl2ifp)),t_rucs(tspt_ucs_mod4vl2ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4vl2ifp)),t_rucs(tspt_ucs_mod4vl2ifp),false);
}

testcase tc_ucs_string2ttcn_mod4vl3ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4vl3ifp)),t_rucs(tspt_ucs_mod4vl3ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4vl3ifp)),t_rucs(tspt_ucs_mod4vl3ifp),false);
}

testcase tc_ucs_string2ttcn_mod4c1ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4c1ifp)),t_rucs(tspt_ucs_mod4c1ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4c1ifp)),t_rucs(tspt_ucs_mod4c1ifp),false);
}

testcase tc_ucs_string2ttcn_mod4c2ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4c2ifp)),t_rucs(tspt_ucs_mod4c2ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4c2ifp)),t_rucs(tspt_ucs_mod4c2ifp),false);
}

testcase tc_ucs_string2ttcn_mod4c3ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4c3ifp)),t_rucs(tspt_ucs_mod4c3ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4c3ifp)),t_rucs(tspt_ucs_mod4c3ifp),false);
}

testcase tc_ucs_string2ttcn_mod4r1ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4r1ifp)),t_rucs(tspt_ucs_mod4r1ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4r1ifp)),t_rucs(tspt_ucs_mod4r1ifp),false);
}

testcase tc_ucs_string2ttcn_mod4r2ifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4r2ifp)),t_rucs(tspt_ucs_mod4r2ifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4r2ifp)),t_rucs(tspt_ucs_mod4r2ifp),false);
}

testcase tc_ucs_string2ttcn_mod4paifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4paifp)),t_rucs(tspt_ucs_mod4paifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4paifp)),t_rucs(tspt_ucs_mod4paifp),false);
}

testcase tc_ucs_string2ttcn_mod4pqifp() runs on MC {
  f_string2ttcn_rucs_t(ttcn2string(t_rucs(tspt_ucs_mod4pqifp)),t_rucs(tspt_ucs_mod4pqifp));
  f_string2ttcn_rucs_v(ttcn2string(t_rucs(tspt_ucs_mod4pqifp)),t_rucs(tspt_ucs_mod4pqifp),false);
}

control { 
  
  log("***universal charstring tests****");
  //execute(tc_ucs_v());
   //ttcn2string:
522
  // execute(tc_ucs_ttcn2string_emb());  //TODO: fail
523
524
525
526
527
528
529
530
531
532
533
  
  execute(tc_ucs_string2ttcn_mod4v());
  execute(tc_ucs_string2ttcn_mod4o());
  execute(tc_ucs_string2ttcn_mod4ol());
  execute(tc_ucs_string2ttcn_mod4a());
  execute(tc_ucs_string2ttcn_mod4q());
  execute(tc_ucs_string2ttcn_mod4al1());
  execute(tc_ucs_string2ttcn_mod4al2());
  execute(tc_ucs_string2ttcn_mod4ql1());
  execute(tc_ucs_string2ttcn_mod4ql2());
  execute(tc_ucs_string2ttcn_mod4vl1());
534
  // execute(tc_ucs_string2ttcn_mod4vl2()); //TODO: fail
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
  execute(tc_ucs_string2ttcn_mod4vl3());
  execute(tc_ucs_string2ttcn_mod4c1());
  execute(tc_ucs_string2ttcn_mod4c2());
  execute(tc_ucs_string2ttcn_mod4c3());
  execute(tc_ucs_string2ttcn_mod4r1());
  execute(tc_ucs_string2ttcn_mod4r2());
  execute(tc_ucs_string2ttcn_mod4pa());
  execute(tc_ucs_string2ttcn_mod4pq());
  //ttcn2string with ifpresent
  execute(tc_ucs_string2ttcn_mod4vifp());
  execute(tc_ucs_string2ttcn_mod4oifp());
  execute(tc_ucs_string2ttcn_mod4aifp());
  execute(tc_ucs_string2ttcn_mod4qifp());
  execute(tc_ucs_string2ttcn_mod4al1ifp());
  execute(tc_ucs_string2ttcn_mod4al2ifp());
  execute(tc_ucs_string2ttcn_mod4ql1ifp());
  execute(tc_ucs_string2ttcn_mod4ql2ifp());
  execute(tc_ucs_string2ttcn_mod4vl1ifp());
  execute(tc_ucs_string2ttcn_mod4vl2ifp());
  execute(tc_ucs_string2ttcn_mod4vl3ifp());
  execute(tc_ucs_string2ttcn_mod4c1ifp());
  execute(tc_ucs_string2ttcn_mod4c2ifp());
  execute(tc_ucs_string2ttcn_mod4c3ifp());
  execute(tc_ucs_string2ttcn_mod4r1ifp());
  execute(tc_ucs_string2ttcn_mod4r2ifp());
  execute(tc_ucs_string2ttcn_mod4paifp());
  execute(tc_ucs_string2ttcn_mod4pqifp()); 
  
}

} //module