Sync with 5.2.0
[deliverable/titan.core.git] / function_test / Semantic_Analyser / TTCN3_SA_ttcn3adhoc_TD.script
1 .******************************************************************************
2 .* Copyright (c) 2000-2014 Ericsson Telecom AB
3 .* All rights reserved. This program and the accompanying materials
4 .* are made available under the terms of the Eclipse Public License v1.0
5 .* which accompanies this distribution, and is available at
6 .* http://www.eclipse.org/legal/epl-v10.html
7 .******************************************************************************/
8 :text.
9 :lang eng.
10
11 .* EDML webpage: http://cpi.ericsson.se/dwaxe/
12 .* EDML2PDF converter: http://dwaxe.ericsson.se/x2pdf
13 .* EDML user guide: http://www.lmc.ericsson.se/~lmcmarg/isit/edml_ug.html
14
15 .* Document header information
16 :docname.Test Description
17 :docno.20/152 91-CRL 113 200/3 Uen
18 :rev.A
19 :date.2013-01-17
20
21 :prep.ETH/XZR Krisztian Pandi
22 :appr.ETH/XZ (Gyula Koos)
23 :checked.ETHGRY
24
25 :title.Test description of the TTCN-3 Semantic Analyzer: Adhoc tests
26 :contents level=2.
27 .*---------------------------------------------------------------------*
28 :h1.Introduction
29 .*---------------------------------------------------------------------*
30 .*---------------------------------------------------------------------*
31 :h2.Revision history
32 .*---------------------------------------------------------------------*
33 :xmp tab=2.
34 REV DATE PREPARED CHANGE
35 __________________________________________________
36 - 2005-02-19 EGBOTAT New document for TITAN R6
37 - 2005-06-30 ETIBHRA Added select-case, alive, interleave tests
38 - 2005-08-16 ETIBHRA Deleted select-case, alive, interleave tests
39 - 2007-12-03 ETHNBA TCs for IsBound are added
40 - 2008-02-05 ETHNBA IsBound changed to IsValue
41 - 2009-06-11 EKRISZA Name correction
42 - 2010-08-10 EKRISZA decvalue test added
43 G 2010-08-13 EKRISZA updated version number
44 H 2010-12-14 EKRISZA updated version number
45 J 2011-05-26 EKRISZA updated version number
46 A 2011-12-12 EKRISZA Updated for release
47 B 2012-04-13 EFERKOV Updated for release
48 A 2012-06-27 EFERKOV Updated for release
49 A 2013-01-17 EKRIPND Updated for release
50 :exmp.
51 .*---------------------------------------------------------------------*
52 :h2.Purpose
53 .*---------------------------------------------------------------------*
54 This document contains adhoc tests for TTCN-3 Semantic Analyser. These test
55 cases shall be moved to different test descriptions in forthcoming
56 projects.
57 .*---------------------------------------------------------------------*
58 :h2.Test cases
59 .*---------------------------------------------------------------------*
60 .*---------------------------------------------------------------------*
61 :h3.Adhoc - Duplicate definition
62 .*---------------------------------------------------------------------*
63 :xmp tab=0.
64
65 <TC - Adhoc - Duplicate definition>
66
67 <COMPILE>
68 <VERDICT_LEAF PASS>
69 <MODULE TTCN Temp Temp.ttcn>
70 module Temp {
71
72 function F() {
73 var integer I, I;
74 }
75
76 }
77 <END_MODULE>
78 <RESULT COUNT 1>
79 (?im)duplicate.+?definition
80 <END_RESULT>
81 <RESULT COUNT 1>
82 (?im)previous.+?definition
83 <END_RESULT>
84 <RESULT COUNT 1>
85 (?is)\berror:
86 <END_RESULT>
87 <RESULT>
88 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
89 <END_RESULT>
90 <END_TC>
91
92 :exmp.
93
94 .*---------------------------------------------------------------------*
95 :h3.Adhoc - Duplicated label
96 .*---------------------------------------------------------------------*
97 :xmp tab=0.
98
99 <TC - Adhoc - Duplicated label>
100
101 <COMPILE>
102 <VERDICT_LEAF PASS>
103 <MODULE TTCN Temp Temp.ttcn>
104 module Temp {
105
106 function F() {
107 label L1;
108 goto L1;
109 label L1;
110 }
111
112 }
113 <END_MODULE>
114 <RESULT COUNT 1>
115 (?im)duplicate.+?label
116 <END_RESULT>
117 <RESULT COUNT 1>
118 (?im)previous.+?definition
119 <END_RESULT>
120 <RESULT COUNT 1>
121 (?is)\berror:
122 <END_RESULT>
123 <RESULT>
124 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
125 <END_RESULT>
126 <END_TC>
127
128 :exmp.
129
130 .*---------------------------------------------------------------------*
131 :h3.Adhoc - goto label
132 .*---------------------------------------------------------------------*
133 :xmp tab=0.
134
135 <TC - Adhoc - goto label>
136
137 <COMPILE>
138 <VERDICT_LEAF PASS>
139 <MODULE TTCN Temp Temp.ttcn>
140 module Temp {
141
142 function F() {
143 goto L1; // same scope
144 label L1;
145 while(true) {
146 goto L2; // different scope 1 (to higher scope)
147 label L3;
148 }
149 label L2;
150 goto L3; // different scope 2 (to lower scope)
151 goto L4; // nonexistent label
152 }
153
154 }
155 <END_MODULE>
156 <RESULT COUNT 2>
157 (?im)label.+?\bnot\b.+?defined
158 <END_RESULT>
159 <RESULT COUNT 2>
160 (?is)\berror:
161 <END_RESULT>
162 <RESULT>
163 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
164 <END_RESULT>
165 <END_TC>
166
167 :exmp.
168
169 .*---------------------------------------------------------------------*
170 :h3.Adhoc - loop alt guards
171 .*---------------------------------------------------------------------*
172 :xmp tab=0.
173
174 <TC - Adhoc - loop alt guards>
175
176 <COMPILE>
177 <VERDICT_LEAF PASS>
178 <MODULE TTCN Temp Temp.ttcn>
179 module Temp {
180
181 function F() {
182 timer T1, T2;
183 var boolean b := true;
184 T1.start(1.0);
185 T2.start(1.1);
186 alt {
187 // Statement::set_my_ags() -> case S_WHILE
188 [b==true] T1.timeout { while(true) { } }
189 [b] T2.timeout { while(true) { b:=0; } }
190 }
191 }
192
193 }
194 <END_MODULE>
195 <RESULT COUNT 1>
196 (?im)boolean.+?value.+?expected
197 <END_RESULT>
198 <RESULT COUNT 1>
199 (?is)\berror:
200 <END_RESULT>
201 <RESULT>
202 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
203 <END_RESULT>
204 <END_TC>
205
206 :exmp.
207
208 .*---------------------------------------------------------------------*
209 :h3.Adhoc - Embedded statement block
210 .*---------------------------------------------------------------------*
211 Note: Statement blocks can be created.
212 :xmp tab=0.
213
214 <TC - Adhoc - Embedded statement block>
215
216 <COMPILEGCC>
217 <VERDICT_LEAF PASS>
218 <MODULE TTCN Temp Temp.ttcn>
219 module Temp {
220
221 function F() {
222 {
223 { }
224 }
225 }
226
227 }
228 <END_MODULE>
229 <RESULT IF_PASS NEGATIVE>
230 (?is)\berror:
231 <END_RESULT>
232 <END_TC>
233
234 :exmp.
235
236 .*---------------------------------------------------------------------*
237 :h3.Adhoc - function instance
238 .*---------------------------------------------------------------------*
239 :xmp tab=0.
240
241 <TC - Adhoc - function instance>
242
243 <COMPILE>
244 <VERDICT_LEAF PASS>
245 <MODULE TTCN Temp Temp.ttcn>
246 module Temp {
247
248 type port MyPortType message { inout integer }
249 type component MyComponent { port MyPortType MyPort; }
250 function F() runs on MyComponent { }
251
252 testcase TC() runs on MyComponent {
253 var MyComponent C;
254 C.start(F(123));
255 }
256
257 }
258 <END_MODULE>
259 <RESULT COUNT 1>
260 (?im)\btoo\b.+?many.+?parameters
261 <END_RESULT>
262 <RESULT COUNT 1>
263 (?is)\berror:
264 <END_RESULT>
265 <RESULT>
266 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
267 <END_RESULT>
268 <END_TC>
269
270 :exmp.
271
272 .*---------------------------------------------------------------------*
273 :h3.Adhoc - action statement
274 .*---------------------------------------------------------------------*
275 Note: this is a positive test. Errors would have been catched by the
276 parser, thus not increasing code coverage of the semantic analyser.
277
278 :xmp tab=0.
279
280 <TC - Adhoc - action statement>
281
282 <COMPILE>
283 <VERDICT_LEAF PASS>
284 <MODULE TTCN Temp Temp.ttcn>
285 module Temp {
286
287 function F() {
288 action("qwerty");
289 }
290
291 }
292 <END_MODULE>
293 <RESULT>
294 (?im)\bnotify\b.+?\bfiles\b.+?\bupdated\b
295 <END_RESULT>
296 <END_TC>
297
298 :exmp.
299
300 .*---------------------------------------------------------------------*
301 :h3.Adhoc - start/stop non-port/timer/component
302 .*---------------------------------------------------------------------*
303 :xmp tab=0.
304
305 <TC - Adhoc - start/stop non-port/timer/component>
306
307 <COMPILE>
308 <VERDICT_LEAF PASS>
309 <MODULE TTCN Temp Temp.ttcn>
310 module Temp {
311
312 type port MyPortType message { inout integer }
313 type component MyComponent { port MyPortType MyPort; }
314 function F() runs on MyComponent { }
315 altstep AS(timer T) {
316 []T.timeout { }
317 }
318
319 testcase TC() runs on MyComponent {
320 var integer I, J, K;
321 I.start(1.0);
322 J.start(F());
323 K.start;
324 I.stop;
325 AS.start;
326 AS.stop;
327 }
328
329 }
330 <END_MODULE>
331 <RESULT COUNT 8>
332 (?is)\berror:
333 <END_RESULT>
334 <RESULT>
335 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
336 <END_RESULT>
337 <END_TC>
338
339 :exmp.
340
341 .*---------------------------------------------------------------------*
342 :h3.Adhoc - start port operation with argument
343 .*---------------------------------------------------------------------*
344 :xmp tab=0.
345
346 <TC - Adhoc - start port operation with argument>
347
348 <COMPILE>
349 <VERDICT_LEAF PASS>
350 <MODULE TTCN Temp Temp.ttcn>
351 module Temp {
352
353 type port MyPortType message { inout integer }
354 type component MyComponent { port MyPortType MyPort; }
355 function F() runs on MyComponent { }
356
357 testcase TC() runs on MyComponent {
358 MyPort.start(123.4);
359 MyPort.start(F());
360 }
361
362 }
363 <END_MODULE>
364 <RESULT COUNT 2>
365 (?im)start.+?port.+?operation.+?cannot.+?have.+?argument
366 <END_RESULT>
367 <RESULT COUNT 2>
368 (?is)\berror:
369 <END_RESULT>
370 <RESULT>
371 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
372 <END_RESULT>
373 <END_TC>
374
375 :exmp.
376
377 .*---------------------------------------------------------------------*
378 :h3.Adhoc - return type of signature
379 .*---------------------------------------------------------------------*
380 :xmp tab=0.
381
382 <TC - Adhoc - return type of signature>
383
384 <COMPILE>
385 <VERDICT_LEAF PASS>
386 <MODULE TTCN Temp Temp.ttcn>
387 module Temp {
388
389 signature Sig1() return integer;
390 signature Sig2();
391 signature Sig3() return integer;
392 signature Sig4();
393 type port MyPortType procedure { inout Sig1, Sig2 }
394 type component MyComponent { port MyPortType MyPort }
395
396 testcase TC() runs on MyComponent {
397 MyPort.reply(Sig1:{});
398 MyPort.reply(Sig2:{} value "qwerty");
399 MyPort.reply(Sig3:{});
400 MyPort.reply(Sig4:{} value 1);
401 }
402
403 }
404 <END_MODULE>
405 <RESULT COUNT 2>
406 (?im)missing.+?return.+?value
407 <END_RESULT>
408 <RESULT COUNT 2>
409 (?im)unexpected.+?return.+?value
410 <END_RESULT>
411 <RESULT COUNT 2>
412 (?im)signature.+?not.+?\bon\b.+?incoming.+?list
413 <END_RESULT>
414 <RESULT COUNT 6>
415 (?is)\berror:
416 <END_RESULT>
417 <RESULT>
418 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
419 <END_RESULT>
420 <END_TC>
421
422 :exmp.
423
424 .*---------------------------------------------------------------------*
425 :h3.Adhoc - raising port, signature and default type
426 .*---------------------------------------------------------------------*
427 :xmp tab=0.
428
429 <TC - Adhoc - raising port, signature and default type>
430
431 <COMPILE>
432 <VERDICT_LEAF PASS>
433 <MODULE TTCN Temp Temp.ttcn>
434 module Temp {
435
436 signature Sig1(); // no exception!
437 type port MyPortType procedure { inout Sig1 }
438 type component MyComponent { port MyPortType MyPort }
439
440 testcase TC() runs on MyComponent {
441 var default d;
442 // The following is a workaround to get a specific error message.
443 var MyPortType portVar;
444 MyPort.raise(Sig1, portVar);
445 MyPort.raise(Sig1, Sig1:{});
446 MyPort.raise(Sig1, d);
447 }
448
449 }
450 <END_MODULE>
451 <RESULT COUNT 1>
452 (?im)variable.+?cannot.+?\bbe\b.+?defined.+?\bfor\b.+?port
453 <END_RESULT>
454 <RESULT COUNT 1>
455 (?im)raise.+?parameter.+?port.+?cannot.+?\bbe\b.+?exception.+?type
456 <END_RESULT>
457 <RESULT COUNT 3>
458 (?im)signature.+?does.+?\bnot\b.+?have.+?exceptions
459 <END_RESULT>
460 <RESULT COUNT 1>
461 (?im)raise.+?parameter.+?default.+?cannot.+?\bbe\b.+?exception.+?type
462 <END_RESULT>
463 <RESULT COUNT 1>
464 (?im)raise.+?parameter.+?signature.+?cannot.+?\bbe\b.+?exception.+?type
465 <END_RESULT>
466 <RESULT COUNT 7>
467 (?is)\berror:
468 <END_RESULT>
469 <RESULT>
470 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
471 <END_RESULT>
472 <END_TC>
473
474 :exmp.
475
476 .*---------------------------------------------------------------------*
477 :h3.Adhoc - any port operation with parameter
478 .*---------------------------------------------------------------------*
479 :xmp tab=0.
480
481 <TC - Adhoc - any port operation with parameter>
482
483 <COMPILE>
484 <VERDICT_LEAF PASS>
485 <MODULE TTCN Temp Temp.ttcn>
486 module Temp {
487
488 signature Sig() exception(float);
489 type port MPortType message { inout integer }
490 type port PPortType procedure { inout Sig }
491 type component MyComponent {
492 port MPortType MPort;
493 port PPortType PPort;
494 }
495
496 testcase TC() runs on MyComponent {
497 alt {
498 []any port.receive(integer:?) { }
499 []any port.check(receive(integer:?)) { }
500
501 []any port.getcall(Sig:{}) { }
502 []any port.getreply(Sig:{}) { }
503 []any port.catch(Sig, float:?) { }
504 []any port.check(getcall(Sig:{})) { }
505 []any port.check(getreply(Sig:{})) { }
506 []any port.check(catch(Sig, float:?)) { }
507 }
508 }
509
510 }
511 <END_MODULE>
512 <RESULT COUNT 8>
513 (?im)operation.+?\bany\b.+?port.+?cannot.+?have.+?parameter
514 <END_RESULT>
515 <RESULT COUNT 8>
516 (?is)\berror:
517 <END_RESULT>
518 <RESULT>
519 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
520 <END_RESULT>
521 <END_TC>
522
523 :exmp.
524
525 .*---------------------------------------------------------------------*
526 :h3.Adhoc - any port operation with redirect
527 .*---------------------------------------------------------------------*
528 :xmp tab=0.
529
530 <TC - Adhoc - any port operation with redirect>
531
532 <COMPILE>
533 <VERDICT_LEAF PASS>
534 <MODULE TTCN Temp Temp.ttcn>
535 module Temp {
536
537 signature Sig(inout integer Par) return integer exception(float);
538 type port MPortType message { inout integer }
539 type port PPortType procedure { inout Sig }
540 type component MyComponent {
541 port MPortType MPort;
542 port PPortType PPort;
543 }
544
545 testcase TC() runs on MyComponent {
546 var integer I, J;
547 var float F;
548 alt {
549 []any port.receive(integer:?) -> value I { }
550 []any port.check(receive(integer:*) -> value I) { }
551
552 []any port.getcall(Sig:{0}) -> param(I) { }
553 []any port.getreply(Sig:{0}) -> value J param(I) { }
554 []any port.catch(Sig, float:*) -> value F { }
555 []any port.check(getcall(Sig:{0}) -> param(I)) { }
556 []any port.check(getreply(Sig:{0}) -> value J param(I)) { }
557 []any port.check(catch(Sig, float:*) -> value F) { }
558 }
559 }
560
561 }
562 <END_MODULE>
563 <RESULT COUNT 8>
564 (?im)operation.+?\bany\b.+?port.+?cannot.+?have.+?parameter\s*$
565 <END_RESULT>
566 <RESULT COUNT 6>
567 (?im)operation.+?\bany\b.+?port.+?cannot.+?have.+?value.+?redirect
568 <END_RESULT>
569 <RESULT COUNT 4>
570 (?im)operation.+?\bany\b.+?port.+?cannot.+?have.+?parameter.+?redirect
571 <END_RESULT>
572 <RESULT COUNT 18>
573 (?is)\berror:
574 <END_RESULT>
575 <RESULT>
576 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
577 <END_RESULT>
578 <END_TC>
579
580 :exmp.
581
582 .*---------------------------------------------------------------------*
583 :h3.Adhoc - message based port operation with procedure based ports
584 .*---------------------------------------------------------------------*
585 :xmp tab=0.
586
587 <TC - Adhoc - message based port operation with procedure based ports>
588
589 <COMPILE>
590 <VERDICT_LEAF PASS>
591 <MODULE TTCN Temp Temp.ttcn>
592 module Temp {
593
594 signature Sig();
595 type port MyPortType procedure { inout Sig }
596 type component MyComponent { port MyPortType MyPort; }
597
598 testcase TC() runs on MyComponent {
599 MyPort.send(9);
600 alt {
601 // TR-682: message based operation on procedure based port and vice versa
602 []MyPort.receive { }
603 []MyPort.trigger { }
604 []MyPort.check(receive) { }
605 }
606 }
607
608 }
609 <END_MODULE>
610 <RESULT COUNT 4>
611 (?im)message.+?based.+?operation.+?procedure.+?based.+?port
612 <END_RESULT>
613 <RESULT COUNT 4>
614 (?is)\berror:
615 <END_RESULT>
616 <RESULT>
617 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
618 <END_RESULT>
619 <END_TC>
620
621 :exmp.
622
623 .*---------------------------------------------------------------------*
624 :h3.Adhoc - procedure based port operation with message based ports
625 .*---------------------------------------------------------------------*
626 :xmp tab=0.
627
628 <TC - Adhoc - procedure based port operation with message based ports>
629
630 <COMPILE>
631 <VERDICT_LEAF PASS>
632 <MODULE TTCN Temp Temp.ttcn>
633 module Temp {
634
635 signature Sig() exception(integer);
636 type port MyPortType message { inout integer }
637 type component MyComponent { port MyPortType MyPort; }
638
639 testcase TC() runs on MyComponent {
640 MyPort.call(Sig:{ }, nowait);
641 MyPort.reply(Sig:{ });
642 MyPort.raise(Sig, 10);
643 alt {
644 // TR-682: message based operation on procedure based port and vice versa
645 []MyPort.check(getcall) { }
646 []MyPort.check(getreply(Sig:{ })) { }
647 []MyPort.check(catch(Sig, integer: ?)) { }
648 }
649 alt {
650 []MyPort.getcall(Sig:{ }) { }
651 []MyPort.getreply(Sig:{ }) { }
652 []MyPort.catch(Sig, integer: ?) { }
653 }
654 MyPort.call(Sig:{ }, 10.0) {
655 []MyPort.getreply(Sig:{ }) { }
656 []MyPort.catch(timeout) { }
657 }
658 }
659
660 }
661 <END_MODULE>
662 <RESULT COUNT 11>
663 (?im)procedure.+?based.+?operation.+?message.+?based.+?port
664 <END_RESULT>
665 <RESULT COUNT 1>
666 (?im)timeout.+?exception.+?message.+?based.+?port
667 <END_RESULT>
668 <RESULT COUNT 12>
669 (?is)\berror:
670 <END_RESULT>
671 <RESULT>
672 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
673 <END_RESULT>
674 <END_TC>
675
676 :exmp.
677
678 .*---------------------------------------------------------------------*
679 :h3.Adhoc - blocking call: getreply refers to different port
680 .*---------------------------------------------------------------------*
681 :xmp tab=0.
682
683 <TC - Adhoc - blocking call: getreply refers to different port>
684
685 <COMPILE>
686 <VERDICT_LEAF PASS>
687 <MODULE TTCN Temp Temp.ttcn>
688 module Temp {
689
690 signature Sig() exception(integer);
691
692 type port MyPortType1 procedure { inout Sig }
693 type port MyPortType2 procedure { inout Sig }
694
695 type component MyComponent {
696 port MyPortType1 MyPort1;
697 port MyPortType2 MyPort2
698 }
699
700 testcase TC() runs on MyComponent {
701 MyPort1.call(Sig:{ }, 10.0) {
702 []MyPort2.getreply(Sig:{ }) { }
703 []MyPort2.getreply { }
704 []MyPort2.catch(Sig, integer: ?) { }
705 []MyPort2.catch { }
706 []MyPort2.catch(timeout) { }
707 }
708 }
709
710 }
711 <END_MODULE>
712 <RESULT COUNT 5>
713 (?im)operation.+?refers.+?\bto\b.+?different.+?port
714 <END_RESULT>
715 <RESULT COUNT 5>
716 (?is)\berror:
717 <END_RESULT>
718 <RESULT>
719 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
720 <END_RESULT>
721 <END_TC>
722
723 :exmp.
724
725 .*---------------------------------------------------------------------*
726 :h3.Adhoc - message type not present on outgoing list of port
727 .*---------------------------------------------------------------------*
728 Note: this test is similar to one of the testcases in TTCN3_SA_5_TD.script
729 with the exception that the outgoing list contains more then one message type.
730 :xmp tab=0.
731
732 <TC - Adhoc - message type not present on outgoing list of port>
733
734 <COMPILE>
735 <VERDICT_LEAF PASS>
736 <MODULE TTCN Temp Temp.ttcn>
737 module Temp {
738
739 type port MyPortType message { out integer, float, charstring }
740 type component MyComponent { port MyPortType MyPort; }
741
742 testcase TC() runs on MyComponent {
743 MyPort.send('0111'B);
744 }
745
746 }
747 <END_MODULE>
748 <RESULT COUNT 1>
749 (?im)message.+?type.+?\bnot\b.+?\bon\b.+?outgoing.+?list
750 <END_RESULT>
751 <RESULT COUNT 1>
752 (?is)\berror:
753 <END_RESULT>
754 <RESULT>
755 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
756 <END_RESULT>
757 <END_TC>
758
759 :exmp.
760
761 .*---------------------------------------------------------------------*
762 :h3.Adhoc - inconsistent port connections
763 .*---------------------------------------------------------------------*
764 :xmp tab=0.
765
766 <TC - Adhoc - inconsistent port connections>
767
768 <COMPILE>
769 <VERDICT_LEAF PASS>
770 <MODULE TTCN Temp Temp.ttcn>
771 module Temp {
772
773 type port MyPortType1 message {
774 out integer, float, boolean;
775 in bitstring;
776 }
777 type port MyPortType2 message {
778 out bitstring, charstring, octetstring;
779 in integer;
780 }
781 type component MyComponent {
782 port MyPortType1 MyPort1;
783 port MyPortType2 MyPort2;
784 }
785
786 testcase TC() runs on MyComponent {
787 connect(self:MyPort1, self:MyPort2);
788 }
789
790 }
791 <END_MODULE>
792 <RESULT COUNT 1>
793 (?im)connection.+?between.+?port.+?types.+?\bnot\b.+?consistent
794 <END_RESULT>
795 <RESULT COUNT 4>
796 (?im)outgoing.+?message.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
797 <END_RESULT>
798 <RESULT COUNT 1>
799 (?is)\berror:
800 <END_RESULT>
801 <RESULT>
802 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
803 <END_RESULT>
804 <END_TC>
805
806 :exmp.
807
808 .*---------------------------------------------------------------------*
809 :h3.Adhoc - connecting message based port to procedure based port
810 .*---------------------------------------------------------------------*
811 :xmp tab=0.
812
813 <TC - Adhoc - connecting message based port to procedure based port>
814
815 <COMPILE>
816 <VERDICT_LEAF PASS>
817 <MODULE TTCN Temp Temp.ttcn>
818 module Temp {
819
820 signature Sig();
821 type port MyPortType1 message { inout integer }
822 type port MyPortType2 procedure { inout Sig }
823 type component MyComponent {
824 port MyPortType1 MyPort1;
825 port MyPortType2 MyPort2;
826 }
827
828 testcase TC() runs on MyComponent {
829 connect(self:MyPort1, self:MyPort2);
830 }
831
832 }
833 <END_MODULE>
834 <RESULT COUNT 1>
835 (?im)connection.+?between.+?port.+?types.+?\bnot\b.+?consistent
836 <END_RESULT>
837 <RESULT COUNT 1>
838 (?im)outgoing.+?message.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
839 <END_RESULT>
840 <RESULT COUNT 1>
841 (?im)outgoing.+?signature.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
842 <END_RESULT>
843 <RESULT COUNT 1>
844 (?is)\berror:
845 <END_RESULT>
846 <RESULT>
847 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
848 <END_RESULT>
849 <END_TC>
850
851 :exmp.
852
853 .*---------------------------------------------------------------------*
854 :h3.Adhoc - inconsistent port connections (with two components)
855 .*---------------------------------------------------------------------*
856 :xmp tab=0.
857
858 <TC - Adhoc - inconsistent port connections (with two components)>
859
860 <COMPILE>
861 <VERDICT_LEAF PASS>
862 <MODULE TTCN Temp Temp.ttcn>
863 module Temp {
864
865 type port MyPortType1 message {
866 out integer, float, boolean;
867 in bitstring;
868 }
869 type port MyPortType2 message {
870 out bitstring, charstring, octetstring;
871 in integer;
872 }
873 type component MyComponent1 { port MyPortType1 MyPort1 }
874 type component MyComponent2 { port MyPortType2 MyPort2 }
875
876 testcase TC() runs on MyComponent1 {
877 var MyComponent2 comp2;
878 connect(self:MyPort1, comp2:MyPort2);
879 }
880
881 }
882 <END_MODULE>
883 <RESULT COUNT 1>
884 (?im)connection.+?between.+?port.+?types.+?\bnot\b.+?consistent
885 <END_RESULT>
886 <RESULT COUNT 4>
887 (?im)outgoing.+?message.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
888 <END_RESULT>
889 <RESULT COUNT 1>
890 (?is)\berror:
891 <END_RESULT>
892 <RESULT>
893 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
894 <END_RESULT>
895 <END_TC>
896
897 :exmp.
898
899 .*---------------------------------------------------------------------*
900 :h3.Adhoc - connecting message based port to procedure based port (with two components)
901 .*---------------------------------------------------------------------*
902 :xmp tab=0.
903
904 <TC - Adhoc - connecting message based port to procedure based port (with two components)>
905
906 <COMPILE>
907 <VERDICT_LEAF PASS>
908 <MODULE TTCN Temp Temp.ttcn>
909 module Temp {
910
911 signature Sig();
912 type port MyPortType1 message { inout integer }
913 type port MyPortType2 procedure { inout Sig }
914
915 type component MyComponent1 { port MyPortType1 MyPort1 }
916 type component MyComponent2 { port MyPortType2 MyPort2 }
917
918 testcase TC() runs on MyComponent1 {
919 var MyComponent2 comp2;
920 connect(self:MyPort1, comp2:MyPort2);
921 }
922
923 }
924 <END_MODULE>
925 <RESULT COUNT 1>
926 (?im)connection.+?between.+?port.+?types.+?\bnot\b.+?consistent
927 <END_RESULT>
928 <RESULT COUNT 1>
929 (?im)outgoing.+?message.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
930 <END_RESULT>
931 <RESULT COUNT 1>
932 (?im)outgoing.+?signature.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
933 <END_RESULT>
934 <RESULT COUNT 1>
935 (?is)\berror:
936 <END_RESULT>
937 <RESULT>
938 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
939 <END_RESULT>
940 <END_TC>
941
942 :exmp.
943
944 .*---------------------------------------------------------------------*
945 :h3.Adhoc - mapping internal ports
946 .*---------------------------------------------------------------------*
947 :xmp tab=0.
948
949 <TC - Adhoc - mapping internal ports>
950
951 <COMPILE>
952 <VERDICT_LEAF PASS>
953 <MODULE TTCN Temp Temp.ttcn>
954 module Temp {
955
956 signature Sig();
957 type port MyPortType1 message { inout integer } with { extension "internal" }
958 type port MyPortType2 procedure { inout Sig } with { extension "internal" }
959
960 type component MyComponent {
961 port MyPortType1 MyPort1;
962 port MyPortType2 MyPort2;
963 }
964
965 testcase TC() runs on MyComponent system MyComponent {
966 // note: these will only cause warnings.
967 map(self:MyPort1, system:MyPort1);
968 map(self:MyPort2, system:MyPort2);
969 }
970
971 }
972 <END_MODULE>
973 <RESULT COUNT 4>
974 (?im)port.+?type.+?marked.+?\bas\b.+?internal
975 <END_RESULT>
976 <END_TC>
977
978 :exmp.
979
980 .*---------------------------------------------------------------------*
981 :h3.Adhoc - inconsistent port mappings
982 .*---------------------------------------------------------------------*
983 :xmp tab=0.
984
985 <TC - Adhoc - inconsistent port mappings>
986
987 <COMPILE>
988 <VERDICT_LEAF PASS>
989 <MODULE TTCN Temp Temp.ttcn>
990 module Temp {
991
992 type port MyPortType1 message {
993 out integer, float, boolean;
994 in bitstring;
995 }
996 type port MyPortType2 message {
997 out bitstring, charstring, octetstring;
998 in integer;
999 }
1000 type component MyComponent {
1001 port MyPortType1 MyPort1;
1002 port MyPortType2 MyPort2;
1003 }
1004
1005 testcase TC() runs on MyComponent system MyComponent {
1006 map(self:MyPort1, system:MyPort2);
1007 }
1008
1009 }
1010 <END_MODULE>
1011 <RESULT COUNT 1>
1012 (?im)mapping.+?between.+?port.+?type.+?\bnot\b.+?consistent
1013 <END_RESULT>
1014 <RESULT COUNT 3>
1015 (?im)outgoing.+?message.+?type.+?\bnot\b.+?present.+?\bon\b.+?outgoing.+?list
1016 <END_RESULT>
1017 <RESULT COUNT 1>
1018 (?im)incoming.+?message.+?type.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
1019 <END_RESULT>
1020 <RESULT COUNT 1>
1021 (?is)\berror:
1022 <END_RESULT>
1023 <RESULT>
1024 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1025 <END_RESULT>
1026 <END_TC>
1027
1028 :exmp.
1029
1030 .*---------------------------------------------------------------------*
1031 :h3.Adhoc - mapping message based port to procedure based port
1032 .*---------------------------------------------------------------------*
1033 :xmp tab=0.
1034
1035 <TC - Adhoc - mapping message based port to procedure based port>
1036
1037 <COMPILE>
1038 <VERDICT_LEAF PASS>
1039 <MODULE TTCN Temp Temp.ttcn>
1040 module Temp {
1041
1042 signature Sig();
1043 type port MyPortType1 message { inout integer }
1044 type port MyPortType2 procedure { inout Sig }
1045 type component MyComponent {
1046 port MyPortType1 MyPort1;
1047 port MyPortType2 MyPort2;
1048 }
1049
1050 testcase TC() runs on MyComponent system MyComponent {
1051 map(self:MyPort1, system:MyPort2);
1052 }
1053
1054 }
1055 <END_MODULE>
1056 <RESULT COUNT 1>
1057 (?im)mapping.+?between.+?port.+?type.+?\bnot\b.+?consistent
1058 <END_RESULT>
1059 <RESULT COUNT 1>
1060 (?im)outgoing.+?message.+?\bnot\b.+?present.+?\bon\b.+?outgoing.+?list
1061 <END_RESULT>
1062 <RESULT COUNT 1>
1063 (?im)incoming.+?signature.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
1064 <END_RESULT>
1065 <RESULT COUNT 1>
1066 (?is)\berror:
1067 <END_RESULT>
1068 <RESULT>
1069 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1070 <END_RESULT>
1071 <END_TC>
1072
1073 :exmp.
1074
1075 .*---------------------------------------------------------------------*
1076 :h3.Adhoc - mapping procedure based port to message based port
1077 .*---------------------------------------------------------------------*
1078 :xmp tab=0.
1079
1080 <TC - Adhoc - mapping procedure based port to message based port>
1081
1082 <COMPILE>
1083 <VERDICT_LEAF PASS>
1084 <MODULE TTCN Temp Temp.ttcn>
1085 module Temp {
1086
1087 signature Sig();
1088 type port MyPortType1 message { inout integer }
1089 type port MyPortType2 procedure { inout Sig }
1090 type component MyComponent {
1091 port MyPortType1 MyPort1;
1092 port MyPortType2 MyPort2;
1093 }
1094
1095 testcase TC() runs on MyComponent system MyComponent {
1096 map(self:MyPort2, system:MyPort1);
1097 }
1098
1099 }
1100 <END_MODULE>
1101 <RESULT COUNT 1>
1102 (?im)mapping.+?between.+?port.+?type.+?\bnot\b.+?consistent
1103 <END_RESULT>
1104 <RESULT COUNT 1>
1105 (?im)outgoing.+?signature.+?\bnot\b.+?present.+?\bon\b.+?outgoing.+?list
1106 <END_RESULT>
1107 <RESULT COUNT 1>
1108 (?im)incoming.+?message.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
1109 <END_RESULT>
1110 <RESULT COUNT 1>
1111 (?is)\berror:
1112 <END_RESULT>
1113 <RESULT>
1114 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1115 <END_RESULT>
1116 <END_TC>
1117
1118 :exmp.
1119
1120 .*---------------------------------------------------------------------*
1121 :h3.Adhoc - executing non-testcase
1122 .*---------------------------------------------------------------------*
1123 :xmp tab=0.
1124
1125 <TC - Adhoc - executing non-testcase>
1126
1127 <COMPILE>
1128 <VERDICT_LEAF PASS>
1129 <MODULE TTCN Temp Temp.ttcn>
1130 module Temp {
1131
1132 function F() { }
1133 external function extF();
1134 signature S();
1135 altstep A() {
1136 timer T;
1137 []T.timeout { }
1138 }
1139
1140 control {
1141 var integer I;
1142 execute(F());
1143 execute(extF());
1144 execute(S());
1145 execute(A());
1146 execute(I());
1147 }
1148
1149 }
1150 <END_MODULE>
1151 <RESULT COUNT 5>
1152 (?im)reference.+?\bto\b.+?testcase.+?expected
1153 <END_RESULT>
1154 <RESULT COUNT 2>
1155 (?im)referenced.+?cannot.+?have.+?actual.+?parameters
1156 <END_RESULT>
1157 <RESULT COUNT 7>
1158 (?is)\berror:
1159 <END_RESULT>
1160 <RESULT>
1161 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1162 <END_RESULT>
1163 <END_TC>
1164
1165 :exmp.
1166
1167 .*---------------------------------------------------------------------*
1168 :h3.Adhoc - return statement in control part
1169 .*---------------------------------------------------------------------*
1170 :xmp tab=0.
1171
1172 <TC - Adhoc - return statement in control part>
1173
1174 <COMPILE>
1175 <VERDICT_LEAF FAIL>
1176 <MODULE TTCN Temp Temp.ttcn>
1177 module Temp {
1178
1179 control {
1180 timer T;
1181 alt {
1182 []T.timeout { return 0; }
1183 }
1184 }
1185
1186 }
1187 <END_MODULE>
1188 <RESULT COUNT 1>
1189 (?im)\bparse\b.+?\berror\b
1190 <END_RESULT>
1191 <END_TC>
1192
1193 :exmp.
1194
1195 .*---------------------------------------------------------------------*
1196 :h3.Adhoc - port operation in control part
1197 .*---------------------------------------------------------------------*
1198 :xmp tab=0.
1199
1200 <TC - Adhoc - port operation in control part>
1201
1202 <COMPILE>
1203 <VERDICT_LEAF PASS>
1204 <MODULE TTCN Temp Temp.ttcn>
1205 module Temp {
1206
1207 control {
1208 alt { // standalone port operations would cause parser error
1209 []any port.receive { }
1210 []any port.getcall { }
1211 []any port.getreply { }
1212 []any port.catch { }
1213
1214 []any port.check(receive) { }
1215 []any port.check(getcall) { }
1216 []any port.check(getreply) { }
1217 []any port.check(catch) { }
1218 }
1219 }
1220
1221 }
1222 <END_MODULE>
1223 <RESULT COUNT 8>
1224 (?im)port.+?operation.+?\bnot\b.+?allowed.+?\bin\b.+?control.+?part
1225 <END_RESULT>
1226 <RESULT COUNT 8>
1227 (?is)\berror:
1228 <END_RESULT>
1229 <RESULT>
1230 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1231 <END_RESULT>
1232 <END_TC>
1233
1234 :exmp.
1235
1236 .*---------------------------------------------------------------------*
1237 :h3.Adhoc - port operation: redirect to constant
1238 .*---------------------------------------------------------------------*
1239 :xmp tab=0.
1240
1241 <TC - Adhoc - port operation: redirect to constant>
1242
1243 <COMPILE>
1244 <VERDICT_LEAF PASS>
1245 <MODULE TTCN Temp Temp.ttcn>
1246 module Temp {
1247
1248 signature Sig(inout integer Par) return bitstring exception(charstring);
1249 template Sig tSig := { Par:=? }
1250 type port PPortType procedure { inout Sig }
1251 type port MPortType message { inout integer }
1252 type component MyComponent { port PPortType PPort; port MPortType MPort; }
1253
1254 const integer cI:=0;
1255 const bitstring cBS:=''B;
1256 const charstring cCS:="";
1257
1258 testcase TC() runs on MyComponent {
1259 alt {
1260 []MPort.receive(integer:?) -> value cI { }
1261 []PPort.getcall(tSig) -> param(cI) { }
1262 []PPort.getreply(tSig value ?) -> value cBS param(cI) { }
1263 []PPort.check(catch(Sig, charstring:?) -> value cCS) { }
1264 }
1265 }
1266
1267 }
1268 <END_MODULE>
1269 <RESULT COUNT 5>
1270 (?im)reference.+?\bto\b.+?variable.+?\bor\b.+?value.+?parameter.+?expected
1271 <END_RESULT>
1272 <RESULT COUNT 5>
1273 (?is)\berror:
1274 <END_RESULT>
1275 <RESULT>
1276 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1277 <END_RESULT>
1278 <END_TC>
1279
1280 :exmp.
1281
1282 .*---------------------------------------------------------------------*
1283 :h3.Adhoc - port operation: redirect to type
1284 .*---------------------------------------------------------------------*
1285 :xmp tab=0.
1286
1287 <TC - Adhoc - port operation: redirect to type>
1288
1289 <COMPILE>
1290 <VERDICT_LEAF PASS>
1291 <MODULE TTCN Temp Temp.ttcn>
1292 module Temp {
1293
1294 signature Sig(inout integer Par) return bitstring exception(charstring);
1295 template Sig tSig := { Par:=? }
1296 type port PPortType procedure { inout Sig }
1297 type port MPortType message { inout integer }
1298 type component MyComponent { port PPortType PPort; port MPortType MPort; }
1299
1300 type integer tI;
1301 type bitstring tBS;
1302 type charstring tCS;
1303
1304 testcase TC() runs on MyComponent {
1305 alt {
1306 []MPort.receive(integer:?) -> value tI { }
1307 []PPort.getcall(tSig) -> param(tI) { }
1308 []PPort.getreply(tSig value ?) -> value tBS param(tI) { }
1309 []PPort.check(catch(Sig, charstring:?) -> value tCS) { }
1310 }
1311 }
1312
1313 }
1314 <END_MODULE>
1315 <RESULT COUNT 5>
1316 (?im)reference.+?\bto\b.+?variable.+?\bor\b.+?value.+?parameter.+?expected
1317 <END_RESULT>
1318 <RESULT COUNT 5>
1319 (?is)\berror:
1320 <END_RESULT>
1321 <RESULT>
1322 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1323 <END_RESULT>
1324 <END_TC>
1325
1326 :exmp.
1327
1328 .*---------------------------------------------------------------------*
1329 :h3.Adhoc - check port operation: sender redirect
1330 .*---------------------------------------------------------------------*
1331 :xmp tab=0.
1332
1333 <TC - Adhoc - check port operation: sender redirect>
1334
1335 <COMPILEGCC>
1336 <VERDICT_LEAF PASS>
1337 <MODULE TTCN Temp Temp.ttcn>
1338 module Temp {
1339
1340 type port MyPortType message { inout integer }
1341 type component MyComponent { port MyPortType MyPort; }
1342
1343 testcase TC() runs on MyComponent {
1344 var MyComponent Peer;
1345 alt {
1346 []MyPort.check (-> sender Peer) { }
1347 }
1348 }
1349
1350 }
1351 <END_MODULE>
1352 <RESULT IF_PASS NEGATIVE>
1353 (?is)\berror:
1354 <END_RESULT>
1355 <END_TC>
1356
1357 :exmp.
1358
1359 .*---------------------------------------------------------------------*
1360 :h3.Adhoc - component operation in control part
1361 .*---------------------------------------------------------------------*
1362 :xmp tab=0.
1363
1364 <TC - Adhoc - component operation in control part>
1365
1366 <COMPILE>
1367 <VERDICT_LEAF PASS>
1368 <MODULE TTCN Temp Temp.ttcn>
1369 module Temp {
1370
1371 signature Sig(inout integer Par) return bitstring exception(charstring);
1372 template Sig tSig := { Par:=? }
1373 type port PPortType procedure { inout Sig }
1374 type port MPortType message { inout integer }
1375 type component MyComponent { port PPortType PPort; port MPortType MPort; }
1376
1377 function F() runs on MyComponent { }
1378
1379 control {
1380 var MyComponent C1, C2;
1381 // TR-683: Create and running component operations in control part
1382 C2 := MyComponent.create;
1383 if(C1.running) { }
1384 alt {
1385 []C1.done {
1386 connect(C1:PPort, C2:PPort); // 2 operands -> 2 errors!
1387 map(C1:MPort, system:MPort); // 2 operands -> 2 errors!
1388 disconnect(C1:PPort, C2:PPort); // 2 operands -> 2 errors!
1389 unmap(C1:MPort, system:MPort); // 2 operands -> 2 errors!
1390 C1.start(F());
1391 }
1392 }
1393 C1.stop;
1394 }
1395
1396 }
1397 <END_MODULE>
1398 <RESULT COUNT 1>
1399 (?im)operation.+?create.+?\bnot\b.+?allowed.+?\bin\b.+?control.+?part
1400 <END_RESULT>
1401 <RESULT COUNT 1>
1402 (?im)operation.+?component.+?running.+?\bnot\b.+?allowed.+?\bin\b.+?control.+?part
1403 <END_RESULT>
1404 <RESULT COUNT 11>
1405 (?im)component.+?operation.+?\bnot\b.+?allowed.+?\bin\b.+?control.+?part
1406 <END_RESULT>
1407 <RESULT COUNT 13>
1408 (?is)\berror:
1409 <END_RESULT>
1410 <RESULT>
1411 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1412 <END_RESULT>
1413 <END_TC>
1414
1415 :exmp.
1416
1417 .*---------------------------------------------------------------------*
1418 :h3.Adhoc - operations on not allowed component types
1419 .*---------------------------------------------------------------------*
1420 :xmp tab=0.
1421
1422 <TC - Adhoc - operations on not allowed component types>
1423
1424 <COMPILE>
1425 <VERDICT_LEAF PASS>
1426 <MODULE TTCN Temp Temp.ttcn>
1427 module Temp {
1428
1429 type port MPortType message { inout integer }
1430 type component MyComponent { port MPortType MPort; }
1431
1432 function F() runs on MyComponent { }
1433
1434 const MyComponent Null := null;
1435
1436 testcase TC() runs on MyComponent system MyComponent {
1437 map(Null:MPort, system:MPort);
1438 unmap(Null:MPort, system:MPort);
1439 connect(Null:MPort, self:MPort);
1440 disconnect(self:MPort, Null:MPort);
1441 map(mtc:MPort, self:MPort);
1442 connect(self:MPort, system:MPort);
1443 Null.start(F());
1444 Null.stop;
1445 // TR-683: Create and running component operations in control part
1446 // (in the `note' section: running operation on null component reference)
1447 if(Null.running) { Null.done; }
1448 }
1449
1450 }
1451 <END_MODULE>
1452 <RESULT COUNT 1>
1453 (?im)operand.+?refers.+?\bto\b.+?null.+?component.+?reference
1454 <END_RESULT>
1455 <RESULT COUNT 7>
1456 (?im)null.+?component.+?reference.+?shall.+?not.+?used.+?operation
1457 <END_RESULT>
1458 <RESULT COUNT 1>
1459 (?im)both.+?endpoints.+?are.+?test.+?component.+?ports
1460 <END_RESULT>
1461 <RESULT COUNT 1>
1462 (?im)system.+?component.+?reference.+?shall.+?not.+?used.+?operation
1463 <END_RESULT>
1464 <RESULT COUNT 10>
1465 (?is)\berror:
1466 <END_RESULT>
1467 <RESULT>
1468 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1469 <END_RESULT>
1470 <END_TC>
1471
1472 :exmp.
1473
1474 .*---------------------------------------------------------------------*
1475 :h3.Adhoc - create, map/unmap operation on non-component
1476 .*---------------------------------------------------------------------*
1477 :xmp tab=0.
1478
1479 <TC - Adhoc - create, map/unmap operation on non-component>
1480
1481 <COMPILE>
1482 <VERDICT_LEAF PASS>
1483 <MODULE TTCN Temp Temp.ttcn>
1484 module Temp {
1485
1486 const integer cInt := 9;
1487 type integer INT;
1488
1489 function F() runs on INT { }
1490
1491 testcase TC() runs on INT system INT {
1492 var integer vInt := 10;
1493 vInt := INT.create;
1494 map(vInt:MyPort, system:MyPort);
1495 unmap(vInt:MyPort, system:MyPort);
1496 }
1497
1498 }
1499 <END_MODULE>
1500 <RESULT COUNT 3>
1501 (?im)reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?component.+?type
1502 <END_RESULT>
1503 <RESULT COUNT 2>
1504 (?im)type.+?\bof\b.+?operand.+?should.+?\bbe\b.+?component.+?type
1505 <END_RESULT>
1506 <RESULT COUNT 1>
1507 (?im)reference.+?\bto\b.+?component.+?type.+?expected
1508 <END_RESULT>
1509 <RESULT COUNT 6>
1510 (?is)\berror:
1511 <END_RESULT>
1512 <RESULT>
1513 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1514 <END_RESULT>
1515 <END_TC>
1516
1517 :exmp.
1518
1519 .*---------------------------------------------------------------------*
1520 :h3.Adhoc - connect/disconnect on non-component
1521 .*---------------------------------------------------------------------*
1522 :xmp tab=0.
1523
1524 <TC - Adhoc - connect/disconnect operation on non-component>
1525
1526 <COMPILE>
1527 <VERDICT_LEAF PASS>
1528 <MODULE TTCN Temp Temp.ttcn>
1529 module Temp {
1530
1531 const integer cInt := 9;
1532 type integer INT;
1533
1534 testcase TC() runs on INT system INT {
1535 var integer vInt := 10;
1536 connect(vInt:MyPort, cInt:MyPort);
1537 disconnect(vInt:MyPort, cInt:MyPort);
1538 }
1539
1540 }
1541 <END_MODULE>
1542 <RESULT COUNT 2>
1543 (?im)reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?component.+?type
1544 <END_RESULT>
1545 <RESULT COUNT 2>
1546 (?im)type.+?\bof\b.+?operand.+?should.+?\bbe\b.+?component.+?type
1547 <END_RESULT>
1548 <RESULT COUNT 2>
1549 (?im)component.+?reference.+?expected.+?\bas\b.+?operand
1550 <END_RESULT>
1551 <RESULT COUNT 6>
1552 (?is)\berror:
1553 <END_RESULT>
1554 <RESULT>
1555 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1556 <END_RESULT>
1557 <END_TC>
1558
1559 :exmp.
1560
1561 .*---------------------------------------------------------------------*
1562 :h3.Adhoc - start/stop operation on non-component
1563 .*---------------------------------------------------------------------*
1564 :xmp tab=0.
1565
1566 <TC - Adhoc - start/stop operation on non-component>
1567
1568 <COMPILE>
1569 <VERDICT_LEAF PASS>
1570 <MODULE TTCN Temp Temp.ttcn>
1571 module Temp {
1572
1573 const integer cInt := 9;
1574 type integer INT;
1575
1576 function F() runs on INT { }
1577
1578 testcase TC() runs on INT system INT {
1579 var integer vInt := 10;
1580 vInt.start(F());
1581 vInt.stop;
1582 }
1583
1584 }
1585 <END_MODULE>
1586 <RESULT COUNT 3>
1587 (?im)reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?component.+?type
1588 <END_RESULT>
1589 <RESULT COUNT 2>
1590 (?im)type.+?\bof\b.+?operand.+?should.+?\bbe\b.+?component.+?type
1591 <END_RESULT>
1592 <RESULT COUNT 5>
1593 (?is)\berror:
1594 <END_RESULT>
1595 <RESULT>
1596 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1597 <END_RESULT>
1598 <END_TC>
1599
1600 :exmp.
1601
1602 .*---------------------------------------------------------------------*
1603 :h3.Adhoc - running/done operation on non-component
1604 .*---------------------------------------------------------------------*
1605 :xmp tab=0.
1606
1607 <TC - Adhoc - running/done operation on non-component>
1608
1609 <COMPILE>
1610 <VERDICT_LEAF PASS>
1611 <MODULE TTCN Temp Temp.ttcn>
1612 module Temp {
1613
1614 const integer cInt := 9;
1615 const integer INT := 120;
1616
1617 testcase TC() runs on INT system INT {
1618 var integer vInt := 10;
1619 if(vInt.running) {
1620 vInt.done;
1621 }
1622 }
1623
1624 }
1625 <END_MODULE>
1626 <RESULT COUNT 2>
1627 (?im)reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?type
1628 <END_RESULT>
1629 <RESULT COUNT 1>
1630 (?im)type.+?\bof\b.+?operand.+?should.+?\bbe\b.+?component.+?type
1631 <END_RESULT>
1632 <RESULT COUNT 1>
1633 (?im)component.+?reference.+?expected
1634 <END_RESULT>
1635 <RESULT COUNT 4>
1636 (?is)\berror:
1637 <END_RESULT>
1638 <RESULT>
1639 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1640 <END_RESULT>
1641 <END_TC>
1642
1643 :exmp.
1644
1645 .*---------------------------------------------------------------------*
1646 :h3.Adhoc - connect/map on non-port
1647 .*---------------------------------------------------------------------*
1648 :xmp tab=0.
1649
1650 <TC - Adhoc - connect/map on non-port>
1651
1652 <COMPILE>
1653 <VERDICT_LEAF PASS>
1654 <MODULE TTCN Temp Temp.ttcn>
1655 module Temp {
1656
1657 type component MyComponent { var integer vInt; }
1658
1659 testcase TC() runs on MyComponent system MyComponent {
1660 var MyComponent C;
1661 connect(C:vInt, self:vInt);
1662 map(self:vInt, system:vInt);
1663 }
1664
1665 }
1666 <END_MODULE>
1667 <RESULT COUNT 4>
1668 (?im)definition.+?\bis\b.+?variable.+?\bnot\b.+?port
1669 <END_RESULT>
1670 <RESULT COUNT 4>
1671 (?is)\berror:
1672 <END_RESULT>
1673 <RESULT>
1674 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1675 <END_RESULT>
1676 <END_TC>
1677
1678 :exmp.
1679
1680 .*---------------------------------------------------------------------*
1681 :h3.Adhoc - send/receive on non-port
1682 .*---------------------------------------------------------------------*
1683 :xmp tab=0.
1684
1685 <TC - Adhoc - send/receive on non-port>
1686
1687 <COMPILE>
1688 <VERDICT_LEAF PASS>
1689 <MODULE TTCN Temp Temp.ttcn>
1690 module Temp {
1691
1692 type component MyComponent { var integer vInt; }
1693
1694 testcase TC() runs on MyComponent system MyComponent {
1695 var integer lInt;
1696 vInt.send(3);
1697 alt {
1698 []lInt.receive(integer:?) { }
1699 }
1700 }
1701
1702 }
1703 <END_MODULE>
1704 <RESULT COUNT 2>
1705 (?im)reference.+?\bto\b.+?port.+?expected
1706 <END_RESULT>
1707 <RESULT COUNT 2>
1708 (?is)\berror:
1709 <END_RESULT>
1710 <RESULT>
1711 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1712 <END_RESULT>
1713 <END_TC>
1714
1715 :exmp.
1716
1717 .*---------------------------------------------------------------------*
1718 :h3.Adhoc - call/getreply on non-port
1719 .*---------------------------------------------------------------------*
1720 :xmp tab=0.
1721
1722 <TC - Adhoc - call/getreply on non-port>
1723
1724 <COMPILE>
1725 <VERDICT_LEAF PASS>
1726 <MODULE TTCN Temp Temp.ttcn>
1727 module Temp {
1728
1729 signature Sig();
1730 type component MyComponent { var integer vInt; }
1731
1732 testcase TC() runs on MyComponent system MyComponent {
1733 var MyComponent C;
1734 vInt.call(Sig:{}, 10.0) {
1735 []vInt.getreply(Sig:{}) { }
1736 []vInt.catch { }
1737 []vInt.catch(timeout) { }
1738 }
1739 }
1740
1741 }
1742 <END_MODULE>
1743 <RESULT COUNT 4>
1744 (?im)reference.+?\bto\b.+?port.+?expected
1745 <END_RESULT>
1746 <RESULT COUNT 4>
1747 (?is)\berror:
1748 <END_RESULT>
1749 <RESULT>
1750 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1751 <END_RESULT>
1752 <END_TC>
1753
1754 :exmp.
1755
1756 .*---------------------------------------------------------------------*
1757 :h3.Adhoc - too few or too many parameters to reference
1758 .*---------------------------------------------------------------------*
1759 :xmp tab=0.
1760
1761 <TC - Adhoc - too few or too many parameters to reference>
1762
1763 <COMPILE>
1764 <VERDICT_LEAF PASS>
1765 <MODULE TTCN Temp Temp.ttcn>
1766 module Temp {
1767
1768 function F(in integer A, in float B, in charstring E) { }
1769
1770 function G() {
1771 F(0, 1.0);
1772 F(0, 1.0, "two", '0011'B);
1773 }
1774
1775 }
1776 <END_MODULE>
1777 <RESULT COUNT 1>
1778 (?im)\btoo\b.+?few.+?parameters
1779 <END_RESULT>
1780 <RESULT COUNT 1>
1781 (?im)\btoo\b.+?many.+?parameters
1782 <END_RESULT>
1783 <RESULT COUNT 2>
1784 (?is)\berror:
1785 <END_RESULT>
1786 <RESULT>
1787 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1788 <END_RESULT>
1789 <END_TC>
1790
1791 :exmp.
1792
1793 .*---------------------------------------------------------------------*
1794 :h3.Adhoc - imported component element hides a definition at module scope
1795 .*---------------------------------------------------------------------*
1796 NOTE: causes only warning messages.
1797 :xmp tab=0.
1798
1799 <TC - Adhoc - imported component element hides a definition at module scope>
1800
1801 <COMPILE>
1802 <VERDICT_LEAF PASS>
1803 <MODULE TTCN TempA TempA.ttcn>
1804 module TempA {
1805 type component MyComponent { const integer Hidden := 9; }
1806 }
1807 <END_MODULE>
1808 <MODULE TTCN TempB TempB.ttcn>
1809 module TempB {
1810 import from TempA all;
1811 const integer Hidden := 9;
1812 testcase TC() runs on MyComponent { }
1813 }
1814 <END_MODULE>
1815 <RESULT COUNT 1>
1816 (?im)warning.+?imported.+?component.+?element.+?definition.+?hides.+?definition.+?\bat\b.+?module.+?scope
1817 <END_RESULT>
1818 <RESULT COUNT 1>
1819 (?im)warning.+?hidden.+?definition.+?\bis\b.+?here
1820 <END_RESULT>
1821 <END_TC>
1822
1823 :exmp.
1824
1825 .*---------------------------------------------------------------------*
1826 :h3.Adhoc - constant definition for port and signature
1827 .*---------------------------------------------------------------------*
1828 :xmp tab=0.
1829
1830 <TC - Adhoc - constant definition for port and signature>
1831
1832 <COMPILE>
1833 <VERDICT_LEAF PASS>
1834 <MODULE TTCN Temp Temp.ttcn>
1835 module Temp {
1836 signature Sig();
1837 type port MyPortType procedure { inout Sig }
1838 const Sig cSig := 0;
1839 const MyPortType cMyPort := 0;
1840 }
1841 <END_MODULE>
1842 <RESULT COUNT 1>
1843 (?im)constant.+?cannot.+?\bbe\b.+?defined.+?for.+?signature
1844 <END_RESULT>
1845 <RESULT COUNT 1>
1846 (?im)constant.+?cannot.+?\bbe\b.+?defined.+?for.+?port.+?type
1847 <END_RESULT>
1848 <RESULT COUNT 2>
1849 (?is)\berror:
1850 <END_RESULT>
1851 <RESULT>
1852 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1853 <END_RESULT>
1854 <END_TC>
1855
1856 :exmp.
1857
1858 .*---------------------------------------------------------------------*
1859 :h3.Adhoc - external constant definition for port and signature
1860 .*---------------------------------------------------------------------*
1861 :xmp tab=0.
1862
1863 <TC - Adhoc - external constant definition for port and signature>
1864
1865 <COMPILE>
1866 <VERDICT_LEAF PASS>
1867 <MODULE TTCN Temp Temp.ttcn>
1868 module Temp {
1869 signature Sig();
1870 type port MyPortType procedure { inout Sig }
1871 external const Sig cSig;
1872 external const MyPortType cMyPort;
1873 }
1874 <END_MODULE>
1875 <RESULT COUNT 1>
1876 (?im)external.+?constant.+?cannot.+?\bbe\b.+?defined.+?for.+?signature
1877 <END_RESULT>
1878 <RESULT COUNT 1>
1879 (?im)external.+?constant.+?cannot.+?\bbe\b.+?defined.+?for.+?port.+?type
1880 <END_RESULT>
1881 <RESULT COUNT 2>
1882 (?is)\berror:
1883 <END_RESULT>
1884 <RESULT>
1885 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1886 <END_RESULT>
1887 <END_TC>
1888
1889 :exmp.
1890
1891 .*---------------------------------------------------------------------*
1892 :h3.Adhoc - signature as module parameter
1893 .*---------------------------------------------------------------------*
1894 :xmp tab=0.
1895
1896 <TC - Adhoc - signature as module parameter>
1897
1898 <COMPILE>
1899 <VERDICT_LEAF PASS>
1900 <MODULE TTCN Temp Temp.ttcn>
1901 module Temp {
1902 signature Sig();
1903 modulepar {
1904 Sig PSig;
1905 }
1906 }
1907 <END_MODULE>
1908 <RESULT COUNT 1>
1909 (?im)type.+?\bof\b.+?module.+?parameter.+?cannot.+?\bbe\b.+?signature
1910 <END_RESULT>
1911 <RESULT COUNT 1>
1912 (?is)\berror:
1913 <END_RESULT>
1914 <RESULT>
1915 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1916 <END_RESULT>
1917 <END_TC>
1918
1919 :exmp.
1920
1921 .*---------------------------------------------------------------------*
1922 :h3.Adhoc - template definition for port type
1923 .*---------------------------------------------------------------------*
1924 :xmp tab=0.
1925
1926 <TC - Adhoc - template definition for port type>
1927
1928 <COMPILE>
1929 <VERDICT_LEAF PASS>
1930 <MODULE TTCN Temp Temp.ttcn>
1931 module Temp {
1932 type port MyPortType message { inout integer; }
1933 template MyPortType tPort := 0;
1934 }
1935 <END_MODULE>
1936 <RESULT COUNT 1>
1937 (?im)template.+?cannot.+?\bbe\b.+?defined.+?\bfor\b.+?port.+?type
1938 <END_RESULT>
1939 <RESULT COUNT 1>
1940 (?is)\berror:
1941 <END_RESULT>
1942 <RESULT>
1943 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1944 <END_RESULT>
1945 <END_TC>
1946
1947 :exmp.
1948
1949 .*---------------------------------------------------------------------*
1950 :h3.Adhoc - modified template from non-template
1951 .*---------------------------------------------------------------------*
1952 :xmp tab=0.
1953
1954 <TC - Adhoc - modified template from non-template>
1955
1956 <COMPILE>
1957 <VERDICT_LEAF PASS>
1958 <MODULE TTCN Temp Temp.ttcn>
1959 module Temp {
1960 type record MyRecord { integer I, float F }
1961 const MyRecord cMyRecord := { 0, 1.0 }
1962 template MyRecord tMyRecord modifies cMyRecord := { F := 1.1 }
1963 }
1964 <END_MODULE>
1965 <RESULT COUNT 1>
1966 (?im)reference.+?\bto\b.+?template.+?expected.+?\bin\b.+?modifies
1967 <END_RESULT>
1968 <RESULT COUNT 1>
1969 (?is)\berror:
1970 <END_RESULT>
1971 <RESULT>
1972 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1973 <END_RESULT>
1974 <END_TC>
1975
1976 :exmp.
1977
1978 .*---------------------------------------------------------------------*
1979 :h3.Adhoc - modified template with parameters
1980 .*---------------------------------------------------------------------*
1981 :xmp tab=0.
1982
1983 <TC - Adhoc - modified template with parameters>
1984
1985 <COMPILE>
1986 <VERDICT_LEAF PASS>
1987 <MODULE TTCN Temp Temp.ttcn>
1988 module Temp {
1989 type record MyRecord { integer I, float F }
1990 template MyRecord MyBaseT (integer pI, template float pF) := {
1991 I := pI, F := pF
1992 }
1993
1994 // fewer parameters
1995 template MyRecord MyModifiedT1 (integer pI) modifies MyBaseT := {
1996 I := pI
1997 }
1998
1999 // different kind of parameters
2000 template MyRecord MyModifiedT2 (template integer pI, float pF)
2001 modifies MyBaseT:= {
2002 I := pI
2003 }
2004
2005 // different type of parameters
2006 template MyRecord MyModifiedT3 (charstring pI, template octetstring pF)
2007 modifies MyBaseT:= {
2008 I := 0
2009 }
2010 }
2011 <END_MODULE>
2012 <RESULT COUNT 1>
2013 (?im)modified.+?template.+?has.+?fewer.+?formal.+?parameters.+?than.+?base.+?template
2014 <END_RESULT>
2015 <RESULT COUNT 2>
2016 (?im)kind.+?\bof\b.+?parameter.+?\bis\b.+?\bnot\b.+?\bthe\b.+?same.+?\bas\b.+?\bin\b.+?base.+?template
2017 <END_RESULT>
2018 <RESULT COUNT 2>
2019 (?im)type.+?\bof\b.+?parameter.+?\bis\b.+?\bnot\b.+?\bthe\b.+?same.+?\bas\b.+?\bin\b.+?base.+?template
2020 <END_RESULT>
2021 <RESULT COUNT 5>
2022 (?is)\berror:
2023 <END_RESULT>
2024 <RESULT>
2025 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2026 <END_RESULT>
2027 <END_TC>
2028
2029 :exmp.
2030
2031 .*---------------------------------------------------------------------*
2032 :h3.Adhoc - variable definition for signature
2033 .*---------------------------------------------------------------------*
2034 :xmp tab=0.
2035
2036 <TC - Adhoc - variable definition for signature>
2037
2038 <COMPILE>
2039 <VERDICT_LEAF PASS>
2040 <MODULE TTCN Temp Temp.ttcn>
2041 module Temp {
2042 signature Sig();
2043 function F() {
2044 var Sig lSig;
2045 }
2046 }
2047 <END_MODULE>
2048 <RESULT COUNT 1>
2049 (?im)variable.+?cannot.+?\bbe\b.+?defined.+?for.+?signature
2050 <END_RESULT>
2051 <RESULT COUNT 1>
2052 (?is)\berror:
2053 <END_RESULT>
2054 <RESULT>
2055 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2056 <END_RESULT>
2057 <END_TC>
2058
2059 :exmp.
2060
2061 .*---------------------------------------------------------------------*
2062 :h3.Adhoc - template variable for port type
2063 .*---------------------------------------------------------------------*
2064 :xmp tab=0.
2065
2066 <TC - Adhoc - template variable for port type>
2067
2068 <COMPILE>
2069 <VERDICT_LEAF PASS>
2070 <MODULE TTCN Temp Temp.ttcn>
2071 module Temp {
2072 type port MyPortType message { inout charstring }
2073 function F() {
2074 var template MyPortType tMyPort;
2075 }
2076 }
2077 <END_MODULE>
2078 <RESULT COUNT 1>
2079 (?im)template.+?variable.+?cannot.+?\bbe\b.+?defined.+?for.+?port.+?type
2080 <END_RESULT>
2081 <RESULT COUNT 1>
2082 (?is)\berror:
2083 <END_RESULT>
2084 <RESULT>
2085 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2086 <END_RESULT>
2087 <END_TC>
2088
2089 :exmp.
2090
2091 .*---------------------------------------------------------------------*
2092 :h3.Adhoc - timer array without default duration
2093 .*---------------------------------------------------------------------*
2094 :xmp tab=0.
2095
2096 <TC - Adhoc - timer array without default duration>
2097
2098 <COMPILE>
2099 <VERDICT_LEAF PASS>
2100 <MODULE TTCN Temp Temp.ttcn>
2101 module Temp {
2102 function F() {
2103 timer MyTimers[10];
2104 MyTimers.start;
2105 MyTimers[0].start;
2106 }
2107 }
2108 <END_MODULE>
2109 <RESULT COUNT 2>
2110 (?im)timer.+?does.+?not.+?have.+?default.+?duration
2111 <END_RESULT>
2112 <RESULT COUNT 1>
2113 (?im)Reference.+?\bto\b.+?timer.+?array.+?without.+?array.+?index
2114 <END_RESULT>
2115 <RESULT COUNT 3>
2116 (?is)\berror:
2117 <END_RESULT>
2118 <RESULT>
2119 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2120 <END_RESULT>
2121 <END_TC>
2122
2123 :exmp.
2124
2125 .*---------------------------------------------------------------------*
2126 :h3.Adhoc - timer array with empty array as default duration
2127 .*---------------------------------------------------------------------*
2128 :xmp tab=0.
2129
2130 <TC - Adhoc - timer array with empty array as default duration>
2131
2132 <COMPILE>
2133 <VERDICT_LEAF PASS>
2134 <MODULE TTCN Temp Temp.ttcn>
2135 module Temp {
2136 function F() {
2137 // Def_Timer::has_default_duration()
2138 timer MyFaultyTimers[10]:={};
2139 timer MyOkTimers[3] := { 1.0, 1.2, 2.78 };
2140 MyFaultyTimers[0].start;
2141 MyOkTimers[2].start;
2142 }
2143 }
2144 <END_MODULE>
2145 <RESULT COUNT 1>
2146 (?im)Too.+?few.+?elements.+?\bin\b.+?default.+?duration.+?\bof\b.+?timer.+?array
2147 <END_RESULT>
2148 <RESULT COUNT 1>
2149 (?is)\berror:
2150 <END_RESULT>
2151 <RESULT>
2152 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2153 <END_RESULT>
2154 <END_TC>
2155
2156 :exmp.
2157
2158 .*---------------------------------------------------------------------*
2159 :h3.Adhoc - timer array with default duration of type other then SEQOF
2160 .*---------------------------------------------------------------------*
2161 :xmp tab=0.
2162
2163 <TC - Adhoc - timer array with default duration of type other then SEQOF>
2164
2165 <COMPILE>
2166 <VERDICT_LEAF PASS>
2167 <MODULE TTCN Temp Temp.ttcn>
2168 module Temp {
2169 function F() {
2170 timer MyFaultyTimers1[10] := ":)";
2171 timer MyFaultyTimers2[Nonexi] := '0101'B;
2172 MyFaultyTimers1[0].start;
2173 MyFaultyTimers2[0].start;
2174 }
2175 }
2176 <END_MODULE>
2177 <RESULT COUNT 2>
2178 (?im)array.+?value.+?was.+?expected.+?\bas\b.+?default.+?duration.+?\bof\b.+?timer.+?array
2179 <END_RESULT>
2180 <RESULT COUNT 1>
2181 (?im)\bno\b.+?definition.+?Nonexi
2182 <END_RESULT>
2183 <RESULT COUNT 3>
2184 (?is)\berror:
2185 <END_RESULT>
2186 <RESULT>
2187 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2188 <END_RESULT>
2189 <END_TC>
2190
2191 :exmp.
2192
2193 .*---------------------------------------------------------------------*
2194 :h3.Adhoc - reference does not refer to a port type
2195 .*---------------------------------------------------------------------*
2196 :xmp tab=0.
2197
2198 <TC - Adhoc - reference does not refer to a port type>
2199
2200 <COMPILE>
2201 <VERDICT_LEAF PASS>
2202 <MODULE TTCN Temp Temp.ttcn>
2203 module Temp {
2204 type integer Int;
2205 const integer cInt:=0;
2206 type component MyComponent {
2207 port Int PInt;
2208 port cInt PcInt;
2209 }
2210 }
2211 <END_MODULE>
2212 <RESULT COUNT 1>
2213 (?im)type.+?reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?port.+?type
2214 <END_RESULT>
2215 <RESULT COUNT 1>
2216 (?im)reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?\ba\b\s*type
2217 <END_RESULT>
2218 <RESULT COUNT 2>
2219 (?is)\berror:
2220 <END_RESULT>
2221 <RESULT>
2222 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2223 <END_RESULT>
2224 <END_TC>
2225
2226 :exmp.
2227
2228 .*---------------------------------------------------------------------*
2229 :h3.Adhoc - port and signature cannot be the return type of a function
2230 .*---------------------------------------------------------------------*
2231 :xmp tab=0.
2232
2233 <TC - Adhoc - port and signature cannot be the return type of a function>
2234
2235 <COMPILE>
2236 <VERDICT_LEAF PASS>
2237 <MODULE TTCN Temp Temp.ttcn>
2238 module Temp {
2239 signature Sig();
2240 type port MyPort procedure { inout Sig }
2241 function F() return Sig { }
2242 function G() return MyPort { }
2243 }
2244 <END_MODULE>
2245 <RESULT COUNT 1>
2246 (?im)value.+?\bof\b.+?signature.+?cannot.+?\bbe\b.+?return.+?type.+?\bof\b.+?function
2247 <END_RESULT>
2248 <RESULT COUNT 1>
2249 (?im)port.+?type.+?cannot.+?\bbe\b.+?return.+?type.+?\bof\b.+?function
2250 <END_RESULT>
2251 <RESULT COUNT 4>
2252 (?is)\berror:
2253 <END_RESULT>
2254 <RESULT>
2255 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2256 <END_RESULT>
2257 <END_TC>
2258
2259 :exmp.
2260
2261 .*---------------------------------------------------------------------*
2262 :h3.Adhoc - starting a function with return type `default' on a PTC
2263 .*---------------------------------------------------------------------*
2264 :xmp tab=0.
2265
2266 <TC - Adhoc - starting a function with return type `default' on a PTC>
2267
2268 <COMPILE>
2269 <VERDICT_LEAF PASS>
2270 <MODULE TTCN Temp Temp.ttcn>
2271 module Temp {
2272 type component MyComponent { }
2273 type port P message { out RRrof; }
2274 type record of RR RRrof;
2275 type record RR { RR2 rr2 optional, aref ar, aref_S arS, aref_C arA }
2276 type record RR2 { RRrof rrrof optional, default d }
2277
2278 type altstep aref();
2279 type altstep aref_C() runs on MyComponent;
2280 type altstep aref_S() runs on self;
2281
2282 function F() runs on MyComponent return default { return null; }
2283
2284 testcase TC() runs on MyComponent {
2285 var MyComponent C;
2286 C.start(F());
2287 }
2288 }
2289 <END_MODULE>
2290 <RESULT COUNT 1>
2291 (?im)Default type cannot be sent or received on a port
2292 <END_RESULT>
2293 <RESULT COUNT 1>
2294 (?im)Altstep type .+ with 'runs on self' clause cannot be sent or received on a port
2295 <END_RESULT>
2296 <RESULT COUNT 1>
2297 (?im)Default type cannot be the return type or embedded in the return type of function .+ if it is started on a parallel test component
2298 <END_RESULT>
2299 <RESULT COUNT 3>
2300 (?is)\berror:
2301 <END_RESULT>
2302 <RESULT>
2303 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2304 <END_RESULT>
2305 <END_TC>
2306
2307 :exmp.
2308
2309 .*---------------------------------------------------------------------*
2310 :h3.Adhoc - port and signature cannot be the return type of an external function
2311 .*---------------------------------------------------------------------*
2312 :xmp tab=0.
2313
2314 <TC - Adhoc - port and signature cannot be the return type of an external function>
2315
2316 <COMPILE>
2317 <VERDICT_LEAF PASS>
2318 <MODULE TTCN Temp Temp.ttcn>
2319 module Temp {
2320 signature Sig();
2321 type port MyPort procedure { inout Sig }
2322 external function F() return Sig;
2323 external function G() return MyPort;
2324 }
2325 <END_MODULE>
2326 <RESULT COUNT 1>
2327 (?im)value.+?\bof\b.+?signature.+?cannot.+?\bbe\b.+?return.+?type.+?\bof\b.+?external.+?function
2328 <END_RESULT>
2329 <RESULT COUNT 1>
2330 (?im)port.+?type.+?cannot.+?\bbe\b.+?return.+?type.+?\bof\b.+?external.+?function
2331 <END_RESULT>
2332 <RESULT COUNT 2>
2333 (?is)\berror:
2334 <END_RESULT>
2335 <RESULT>
2336 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2337 <END_RESULT>
2338 <END_TC>
2339
2340 :exmp.
2341
2342 .*---------------------------------------------------------------------*
2343 :h3.Adhoc - reference to omit value
2344 .*---------------------------------------------------------------------*
2345 :xmp tab=0.
2346
2347 <TC - Adhoc - reference to omit value>
2348
2349 <COMPILE>
2350 <VERDICT_LEAF PASS>
2351 <MODULE TTCN Temp Temp.ttcn>
2352 module Temp {
2353 type record MyType1 {
2354 integer I,
2355 float F optional
2356 }
2357 type record MyType2 {
2358 integer I optional,
2359 float F
2360 }
2361 template MyType1 T1 := { 1, omit };
2362 // TR-702: Optional field in record type
2363 template MyType2 T2 := { omit, T1.F };
2364 }
2365 <END_MODULE>
2366 <RESULT COUNT 1>
2367 (?im)error.+?omit.+?not.+?allowed.+?context
2368 <END_RESULT>
2369 <RESULT COUNT 1>
2370 (?is)\berror:
2371 <END_RESULT>
2372 <RESULT>
2373 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2374 <END_RESULT>
2375 <END_TC>
2376
2377 :exmp.
2378
2379 .*---------------------------------------------------------------------*
2380 :h3.Adhoc - reference to inactive template field
2381 .*---------------------------------------------------------------------*
2382 :xmp tab=0.
2383
2384 <TC - Adhoc - reference to inactive template field>
2385
2386 <COMPILE>
2387 <VERDICT_LEAF PASS>
2388 <MODULE TTCN Temp Temp.ttcn>
2389 module Temp {
2390 type union MyType {
2391 integer I,
2392 float F
2393 }
2394 template MyType T1 := { I := 1 }
2395 template float T2 := T1.F;
2396 }
2397 <END_MODULE>
2398 <RESULT COUNT 1>
2399 (?im)reference.+?\bto\b.+?inactive.+?field.+?\bin\b.+?template
2400 <END_RESULT>
2401 <RESULT COUNT 1>
2402 (?is)\berror:
2403 <END_RESULT>
2404 <RESULT>
2405 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2406 <END_RESULT>
2407 <END_TC>
2408
2409 :exmp.
2410
2411 .*---------------------------------------------------------------------*
2412 :h3.Adhoc - reference to field of value list match
2413 .*---------------------------------------------------------------------*
2414 :xmp tab=0.
2415
2416 <TC - Adhoc - reference to field of value list match>
2417
2418 <COMPILE>
2419 <VERDICT_LEAF PASS>
2420 <MODULE TTCN Temp Temp.ttcn>
2421 module Temp {
2422 type union MyType {
2423 integer I,
2424 float F
2425 }
2426 template MyType T1 := ({ I := 1 }, { I := 2 }, { F := 3.0 });
2427 template float T2 := T1.F;
2428 }
2429 <END_MODULE>
2430 <RESULT COUNT 1>
2431 (?im)reference.+?\bto\b.+?field.+?\bof\b.+?value.+?list.+?match
2432 <END_RESULT>
2433 <RESULT COUNT 1>
2434 (?is)\berror:
2435 <END_RESULT>
2436 <RESULT>
2437 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2438 <END_RESULT>
2439 <END_TC>
2440
2441 :exmp.
2442
2443 .*---------------------------------------------------------------------*
2444 :h3.Adhoc - valueof operation on field of a template which has no fields
2445 .*---------------------------------------------------------------------*
2446 :xmp tab=0.
2447
2448 <TC - Adhoc - valueof operation on field of a template which has no fields>
2449
2450 <COMPILE>
2451 <VERDICT_LEAF PASS>
2452 <MODULE TTCN Temp Temp.ttcn>
2453 module Temp {
2454 template integer tI := 1;
2455 function F() {
2456 // TR-691: Three error messages for valueof operation on template's
2457 // nonexistent filed
2458 var integer I := valueof(tI.Nonexi);
2459 }
2460 }
2461 <END_MODULE>
2462 <RESULT COUNT 1>
2463 (?im)invalid.+?field.+?reference.+?integer.+?does.+?not.+?have.+?fields
2464 <END_RESULT>
2465 <RESULT COUNT 1>
2466 (?is)\berror:
2467 <END_RESULT>
2468 <RESULT>
2469 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2470 <END_RESULT>
2471 <RESULT IF_FAIL POSITIVE>
2472 (?im)invalid.+?field.+?reference.+?integer.+?does.+?not.+?have.+?fields
2473 <END_RESULT>
2474 <END_TC>
2475
2476 :exmp.
2477
2478 .*---------------------------------------------------------------------*
2479 :h3.Adhoc - referenced template array
2480 .*---------------------------------------------------------------------*
2481 :xmp tab=0.
2482
2483 <TC - Adhoc - referenced template array>
2484
2485 <COMPILE>
2486 <VERDICT_LEAF FAIL>
2487 <MODULE TTCN Temp Temp.ttcn>
2488 module Temp {
2489 type set of integer RI;
2490 template RI tI := { 0, 1, 2 }
2491 const charstring cCS := "foobar";
2492 const bitstring cBS := '0010'B;
2493 type record OmitType { integer Omit optional }
2494 template OmitType OmitRec := { omit };
2495 type record of charstring recofCharstring;
2496
2497 function F() {
2498 var integer I := valueof(tI[-1]);
2499 var integer J := valueof(tI[1274]);
2500
2501 // TR-692: Strange error messages with valueof operation used on
2502 // record of templates
2503 var integer K := valueof(tI[Nonexi]);
2504 var integer L := valueof(tI[valueof(OmitRec.Omit)]);
2505 var integer M := valueof(tI[omit]);
2506 var integer N := valueof(OmitRec.Omit);
2507
2508 if(match(tI[cBS], I)) { }
2509
2510 var template recofCharstring T:= {"first", "second"};
2511 const charstring temp := valueof(T[0]);
2512 }
2513 }
2514 <END_MODULE>
2515 <RESULT COUNT 1>
2516 (?im)non-negative.+?integer.+?value.+?expected
2517 <END_RESULT>
2518 <RESULT COUNT 1>
2519 (?im)index.+?overflow
2520 <END_RESULT>
2521 <RESULT COUNT 1>
2522 (?im)\bno\b.+?definition.+?Nonexi
2523 <END_RESULT>
2524 <RESULT COUNT 2>
2525 (?im)specific.+?value.+?expected.+?instead.+?\bof\b.+?omit
2526 <END_RESULT>
2527 <RESULT COUNT 2>
2528 (?im)value.+?\bor\b.+?expression.+?\bof\b.+?type.+?integer.+?expected
2529 <END_RESULT>
2530 <RESULT COUNT 1>
2531 (?im)reference.+?\bto\b.+?value.+?expected.+?instead.+?\bof\b.+?template
2532 <END_RESULT>
2533 <RESULT COUNT 8>
2534 (?is)\berror:
2535 <END_RESULT>
2536 <RESULT>
2537 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2538 <END_RESULT>
2539 <RESULT IF_FAIL COUNT 1>
2540 (?im)non-negative.+?integer.+?value.+?expected
2541 <END_RESULT>
2542 <RESULT IF_FAIL COUNT 1>
2543 (?im)index.+?overflow
2544 <END_RESULT>
2545 <RESULT IF_FAIL COUNT 1>
2546 (?im)\bno\b.+?definition.+?Nonexi
2547 <END_RESULT>
2548 <RESULT IF_FAIL COUNT 2>
2549 (?im)specific.+?value.+?expected.+?instead.+?\bof\b.+?omit
2550 <END_RESULT>
2551 <RESULT IF_FAIL COUNT 2>
2552 (?im)value.+?\bor\b.+?expression.+?\bof\b.+?type.+?integer.+?expected
2553 <END_RESULT>
2554 <RESULT IF_FAIL COUNT 2>
2555 (?im)reference.+?\bto\b.+?value.+?expected.+?instead.+?\bof\b.+?template
2556 <END_RESULT>
2557 <END_TC>
2558
2559 :exmp.
2560
2561 .*---------------------------------------------------------------------*
2562 :h3.Adhoc - too many/few elements in value list for record template
2563 .*---------------------------------------------------------------------*
2564 :xmp tab=0.
2565
2566 <TC - Adhoc - too many/few elements in value list for record template>
2567
2568 <COMPILE>
2569 <VERDICT_LEAF PASS>
2570 <MODULE TTCN Temp Temp.ttcn>
2571 module Temp {
2572 type record MyType {
2573 integer I,
2574 float F
2575 }
2576 template MyType T1 := { 0 }
2577 template MyType T2 := { 0, 1.0, 2 }
2578 }
2579 <END_MODULE>
2580 <RESULT COUNT 0>
2581 (?im)\berror\b.+?too.+?few.+?elements.+?in.+?value.+?list
2582 <END_RESULT>
2583 <RESULT COUNT 1>
2584 (?im)\berror\b.+?too.+?many.+?elements.+?in.+?value.+?list
2585 <END_RESULT>
2586 <RESULT COUNT 1>
2587 (?is)\berror:
2588 <END_RESULT>
2589 <RESULT>
2590 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2591 <END_RESULT>
2592 <END_TC>
2593 :exmp.
2594
2595
2596 .*---------------------------------------------------------------------*
2597 :h3.TTCN-3:: IsValue - for a type reference
2598 .*---------------------------------------------------------------------*
2599 :xmp tab=0.
2600 <TC - TTCN-3::IsValue - for a type reference>
2601
2602 <COMPILE>
2603 <VERDICT_LEAF PASS>
2604 <MODULE TTCN ModuleA ModuleA.ttcn>
2605 module ModuleA {
2606
2607 type record length (10) of integer int10;
2608
2609 type component C1
2610 {
2611 }
2612
2613 testcase tc_isvalue_const() runs on C1
2614 {
2615 if ( isvalue(int10) ) {
2616 setverdict(pass);
2617 } else {
2618 setverdict(fail);
2619 }
2620 }
2621 }
2622 <END_MODULE>
2623 <RESULT IF_PASS COUNT 1>
2624 (?im)\bReference to a value or template was expected instead of type `@ModuleA.int10'
2625 <END_RESULT>
2626 <RESULT IF_PASS COUNT 1>
2627 (?is)\berror:
2628 <END_RESULT>
2629 <RESULT IF_PASS POSITIVE>
2630 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2631 <END_RESULT>
2632 <END_TC>
2633 :exmp.
2634
2635
2636 .*---------------------------------------------------------------------*
2637 :h3.TTCN-3:: IsValue - for a port reference
2638 .*---------------------------------------------------------------------*
2639 :xmp tab=0.
2640 <TC - TTCN-3::IsValue - for a port reference>
2641
2642 <COMPILE>
2643 <VERDICT_LEAF PASS>
2644 <MODULE TTCN ModuleA ModuleA.ttcn>
2645 module ModuleA {
2646
2647 type record length (10) of integer int10;
2648
2649 type port P1 message
2650 {
2651 out integer;
2652 }
2653
2654 type component C1
2655 {
2656 port P1 p1;
2657 }
2658
2659 testcase tc_isvalue_const() runs on C1
2660 {
2661 var C1 c1;
2662
2663 if ( isvalue(p1) ) {
2664 setverdict(pass);
2665 } else {
2666 setverdict(fail);
2667 }
2668 }
2669 }
2670 <END_MODULE>
2671 <RESULT IF_PASS COUNT 1>
2672 (?im)\bReference to a value or template was expected instead of port `@ModuleA.C1.p1'
2673 <END_RESULT>
2674 <RESULT IF_PASS COUNT 1>
2675 (?is)\berror:
2676 <END_RESULT>
2677 <RESULT IF_PASS POSITIVE>
2678 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2679 <END_RESULT>
2680
2681 <END_TC>
2682 :exmp.
2683
2684
2685 .*---------------------------------------------------------------------*
2686 :h3.TTCN-3:: IsValue - for a testcase reference
2687 .*---------------------------------------------------------------------*
2688 :xmp tab=0.
2689 <TC - TTCN-3::IsValue - for a testcase reference>
2690
2691 <COMPILE>
2692 <VERDICT_LEAF PASS>
2693 <MODULE TTCN ModuleA ModuleA.ttcn>
2694 module ModuleA {
2695
2696 type record length (10) of integer int10;
2697
2698 type component C1
2699 {
2700 }
2701
2702 testcase tc_isvalue_const() runs on C1
2703 {
2704 var boolean dontcare1 := isvalue(tc_isvalue_const);
2705 }
2706 }
2707 <END_MODULE>
2708 <RESULT IF_PASS COUNT 1>
2709 (?im)\bReference to parameterized definition `tc_isvalue_const' without actual parameter list
2710 <END_RESULT>
2711 <RESULT IF_PASS COUNT 1>
2712 (?im)\bReference to a value or template was expected instead of testcase `@ModuleA.tc_isvalue_const'
2713 <END_RESULT>
2714 <RESULT IF_PASS COUNT 2>
2715 (?is)\berror:
2716 <END_RESULT>
2717 <RESULT IF_PASS POSITIVE>
2718 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2719 <END_RESULT>
2720
2721 <END_TC>
2722 :exmp.
2723
2724
2725
2726 .*---------------------------------------------------------------------*
2727 :h3.Adhoc:: Function reference - used in expression, no return value
2728 .*---------------------------------------------------------------------*
2729 :xmp tab=0.
2730 <TC - Adhoc::Function reference - used in expression, no return value>
2731 <COMPILE>
2732 <VERDICT_LEAF FAIL>
2733 <MODULE TTCN x x.ttcn>
2734 module x {
2735 // no return value:
2736 type function f_FT();
2737 // a function which happens to be compatible with f_FT
2738 function f_str(){}
2739 control {
2740 var f_FT f := refers(f_str);
2741 var charstring vl_result := f.apply() & "";
2742 }
2743 }
2744 <END_MODULE>
2745 <RESULT IF_FAIL COUNT 1>
2746 (?is)\berror: Reference.+?value.+?expected.+?invocation.+?behavior.+?no return type\b
2747 <END_RESULT>
2748 <RESULT IF_FAIL POSITIVE>
2749 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2750 <END_RESULT>
2751 <END_TC>
2752 :exmp.
2753
2754 .*---------------------------------------------------------------------*
2755 :h3.Adhoc:: Function reference - incompatible function type used for record func.ref. value
2756 .*---------------------------------------------------------------------*
2757 :xmp tab=0.
2758 <TC - Adhoc::Function reference - incompatible function type used for record func.ref. value>
2759 <COMPILE>
2760 <VERDICT_LEAF FAIL>
2761 <MODULE TTCN x x.ttcn>
2762 module x {
2763 type record adat_rekord {
2764 function (integer par1, integer par2) return integer muv_f,
2765 function (in integer par) return verdicttype ell_f
2766 };
2767 function fn1(integer par1, integer par2) return float { return 1.1; }
2768 function fn2(in integer par) return verdicttype { return pass; }
2769 function fff()
2770 {
2771 var adat_rekord ar := { refers(fn1), refers(fn2) }
2772 }
2773 }
2774 <END_MODULE>
2775 <RESULT IF_FAIL COUNT 1>
2776 (?is)\berror:
2777 <END_RESULT>
2778 <RESULT IF_FAIL POSITIVE>
2779 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2780 <END_RESULT>
2781 <END_TC>
2782 :exmp.
2783
2784 .*---------------------------------------------------------------------*
2785 :h3.Adhoc:: Function reference - bogus dereference
2786 .*---------------------------------------------------------------------*
2787 :xmp tab=0.
2788 <TC - Adhoc::Function reference - bogus dereference>
2789 <COMPILE>
2790 <VERDICT_LEAF PASS>
2791 <MODULE TTCN deref_bogus deref_bogus.ttcn>
2792 module deref_bogus {
2793 control {
2794 execute(derefers(Noexi)())
2795 }
2796 }
2797 <END_MODULE>
2798 <RESULT COUNT 1>
2799 (?im)There.+?is.+?no.+?local.+?imported.+?definition.+?name
2800 <END_RESULT>
2801 <RESULT COUNT 1>
2802 (?is)\berror:
2803 <END_RESULT>
2804 <RESULT COUNT 1>
2805 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2806 <END_RESULT>
2807 <END_TC>
2808 :exmp.
2809
2810 .*---------------------------------------------------------------------*
2811 :h3.Adhoc:: Named actual parameters - no such parameter in function
2812 .*---------------------------------------------------------------------*
2813 :xmp tab=0.
2814 <TC - Adhoc::Named actual parameters - no such parameter in function>
2815 <COMPILE>
2816 <VERDICT_LEAF PASS>
2817 <MODULE TTCN nosuchname nosuchname.ttcn>
2818 module nosuchname {
2819 type component C1 { }
2820 function f1(in integer par1, in float par2, in charstring par3,
2821 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
2822 {
2823 }
2824
2825 testcase tc1() runs on C1
2826 {
2827 f1(1, 2.2, "3", pardon := 3);
2828 }
2829 }
2830 <END_MODULE>
2831 <RESULT COUNT 1>
2832 (?im)Function\s+`\S+'\s+has\s+no\s+formal\s+parameter
2833 <END_RESULT>
2834 <RESULT COUNT 1>
2835 (?is)\berror:
2836 <END_RESULT>
2837 <RESULT COUNT 1>
2838 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2839 <END_RESULT>
2840 <END_TC>
2841 :exmp.
2842
2843 .*---------------------------------------------------------------------*
2844 :h3.Adhoc:: Named actual parameters - no such parameter in altstep
2845 .*---------------------------------------------------------------------*
2846 :xmp tab=0.
2847 <TC - Adhoc::Named actual parameters - no such parameter in altstep>
2848 <COMPILE>
2849 <VERDICT_LEAF PASS>
2850 <MODULE TTCN nosuchname_altstep nosuchname_altstep.ttcn>
2851 module nosuchname_altstep {
2852 type component C1 { }
2853 altstep f1(in integer par1, in float par2, in charstring par3,
2854 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
2855 {
2856 [] any timer.timeout { setverdict(pass); }
2857 }
2858
2859 testcase tc1() runs on C1
2860 {
2861 f1(1, 2.2, "3", pardon := 3);
2862 }
2863 }
2864 <END_MODULE>
2865 <RESULT COUNT 1>
2866 (?im)Altstep\s+`\S+'\s+has\s+no\s+formal\s+parameter
2867 <END_RESULT>
2868 <RESULT COUNT 1>
2869 (?is)\berror:
2870 <END_RESULT>
2871 <RESULT COUNT 1>
2872 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2873 <END_RESULT>
2874 <END_TC>
2875 :exmp.
2876
2877 .*---------------------------------------------------------------------*
2878 :h3.Adhoc:: Named actual parameters - no such parameter in testcase
2879 .*---------------------------------------------------------------------*
2880 :xmp tab=0.
2881 <TC - Adhoc::Named actual parameters - no such parameter in testcase>
2882 <COMPILE>
2883 <VERDICT_LEAF PASS>
2884 <MODULE TTCN nosuchname_testcase nosuchname_testcase.ttcn>
2885 module nosuchname_testcase {
2886 type component C1 { }
2887 testcase f1(in integer par1, in float par2, in charstring par3,
2888 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H) runs on C1
2889 {
2890 alt{
2891 [] any timer.timeout { setverdict(pass); }
2892 }
2893 }
2894
2895 control
2896 {
2897 execute(f1(1, 2.2, "3", pardon := 3));
2898 }
2899 }
2900 <END_MODULE>
2901 <RESULT COUNT 1>
2902 (?im)Testcase\s+`\S+'\s+has\s+no\s+?formal\s+?parameter
2903 <END_RESULT>
2904 <RESULT COUNT 1>
2905 (?is)\berror:
2906 <END_RESULT>
2907 <RESULT COUNT 1>
2908 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2909 <END_RESULT>
2910 <END_TC>
2911 :exmp.
2912
2913 .*---------------------------------------------------------------------*
2914 :h3.Adhoc:: Named actual parameters - not enough parameters in function
2915 .*---------------------------------------------------------------------*
2916 :xmp tab=0.
2917 <TC - Adhoc::Named actual parameters - not enough parameters in function>
2918 <COMPILE>
2919 <VERDICT_LEAF PASS>
2920 <MODULE TTCN notenough notenough.ttcn>
2921 module notenough {
2922 type component C1 { }
2923 function f1(in integer par1, in float par2, in charstring par3,
2924 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
2925 {
2926 }
2927
2928 testcase tc1() runs on C1
2929 {
2930 f1();
2931 }
2932 }
2933 <END_MODULE>
2934 <RESULT COUNT 1>
2935 (?im)Too.+?few.+?parameters:.+?least.+?expected.+?instead
2936 <END_RESULT>
2937 <RESULT COUNT 1>
2938 (?is)\berror:
2939 <END_RESULT>
2940 <RESULT COUNT 1>
2941 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2942 <END_RESULT>
2943 <END_TC>
2944 :exmp.
2945
2946 .*---------------------------------------------------------------------*
2947 :h3.Adhoc:: Named actual parameters - not enough parameters in altstep
2948 .*---------------------------------------------------------------------*
2949 :xmp tab=0.
2950 <TC - Adhoc::Named actual parameters - not enough parameters in altstep>
2951 <COMPILE>
2952 <VERDICT_LEAF PASS>
2953 <MODULE TTCN notenough_altstep notenough_altstep.ttcn>
2954 module notenough_altstep {
2955 type component C1 { }
2956 altstep f1(in integer par1, in float par2, in charstring par3,
2957 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
2958 {
2959 [] any timer.timeout { setverdict(pass); }
2960 }
2961
2962 testcase tc1() runs on C1
2963 {
2964 f1();
2965 }
2966 }
2967 <END_MODULE>
2968 <RESULT COUNT 1>
2969 (?im)Too.+?few.+?parameters:.+?least.+?expected.+?instead
2970 <END_RESULT>
2971 <RESULT COUNT 1>
2972 (?is)\berror:
2973 <END_RESULT>
2974 <RESULT COUNT 1>
2975 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2976 <END_RESULT>
2977 <END_TC>
2978 :exmp.
2979
2980 .*---------------------------------------------------------------------*
2981 :h3.Adhoc:: Named actual parameters - parameter overriding in function
2982 .*---------------------------------------------------------------------*
2983 :xmp tab=0.
2984 <TC - Adhoc::Named actual parameters - parameter overriding in function>
2985 <COMPILE>
2986 <VERDICT_LEAF PASS>
2987 <MODULE TTCN override_override override_override.ttcn>
2988 module override_override {
2989 type component C1 { }
2990 function f1(in integer par1, in float par2, in charstring par3,
2991 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
2992 {
2993 }
2994
2995 testcase tc1() runs on C1
2996 {
2997 f1(1, 2.2, "3", par1 := 42, par4 := true);
2998 }
2999 }
3000 <END_MODULE>
3001 <RESULT COUNT 1>
3002 (?im)Formal parameter `\S+' assigned more than once
3003 <END_RESULT>
3004 <RESULT COUNT 1>
3005 (?is)\berror:
3006 <END_RESULT>
3007 <RESULT COUNT 1>
3008 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3009 <END_RESULT>
3010 <END_TC>
3011 :exmp.
3012
3013 .*---------------------------------------------------------------------*
3014 :h3.Adhoc:: Named actual parameters - parameter overriding in altstep
3015 .*---------------------------------------------------------------------*
3016 :xmp tab=0.
3017 <TC - Adhoc::Named actual parameters - parameter overriding in altstep>
3018 <COMPILE>
3019 <VERDICT_LEAF PASS>
3020 <MODULE TTCN override_altstep override_altstep.ttcn>
3021 module override_altstep {
3022 type component C1 { }
3023 altstep f1(in integer par1, in float par2, in charstring par3,
3024 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
3025 {
3026 [] any timer.timeout { setverdict(pass); }
3027 }
3028
3029 testcase tc1() runs on C1
3030 {
3031 f1(1, 2.2, "3", par1 := 42, par4 := true);
3032 }
3033 }
3034 <END_MODULE>
3035 <RESULT COUNT 1>
3036 (?im)Formal parameter `\S+' assigned more than once
3037 <END_RESULT>
3038 <RESULT COUNT 1>
3039 (?is)\berror:
3040 <END_RESULT>
3041 <RESULT COUNT 1>
3042 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3043 <END_RESULT>
3044 <END_TC>
3045 :exmp.
3046
3047 .*---------------------------------------------------------------------*
3048 :h3.Adhoc:: Named actual parameters - too many parameters in function
3049 .*---------------------------------------------------------------------*
3050 :xmp tab=0.
3051 <TC - Adhoc::Named actual parameters - too many parameters in function>
3052 <COMPILE>
3053 <VERDICT_LEAF PASS>
3054 <MODULE TTCN toomany toomany.ttcn>
3055 module toomany {
3056 type component C1 { }
3057 function f1(in integer par1, in float par2, in charstring par3,
3058 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
3059 {
3060 }
3061
3062 testcase tc1() runs on C1
3063 {
3064 f1(13, 0.99, "foo", true, 'BAADF00D'H, -);
3065 }
3066 }
3067 <END_MODULE>
3068 <RESULT COUNT 1>
3069 (?im)Too.+?many.+?parameters.+?most.+?was.+?expected.+?instead
3070 <END_RESULT>
3071 <RESULT COUNT 1>
3072 (?is)\berror:
3073 <END_RESULT>
3074 <RESULT COUNT 1>
3075 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3076 <END_RESULT>
3077 <END_TC>
3078 :exmp.
3079
3080 .*---------------------------------------------------------------------*
3081 :h3.Adhoc:: Named actual parameters - too many parameters in altstep
3082 .*---------------------------------------------------------------------*
3083 :xmp tab=0.
3084 <TC - Adhoc::Named actual parameters - too many parameters in altstep>
3085 <COMPILE>
3086 <VERDICT_LEAF PASS>
3087 <MODULE TTCN toomany_altstep toomany_altstep.ttcn>
3088 module toomany_altstep {
3089 type component C1 { }
3090 altstep f1(in integer par1, in float par2, in charstring par3,
3091 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
3092 {
3093 [] any timer.timeout { setverdict(pass); }
3094 }
3095
3096 testcase tc1() runs on C1
3097 {
3098 f1(13, 0.99, "foo", true, 'BAADF00D'H, -);
3099 }
3100 }
3101 <END_MODULE>
3102 <RESULT COUNT 1>
3103 (?im)Too.+?many.+?parameters.+?most.+?was.+?expected.+?instead
3104 <END_RESULT>
3105 <RESULT COUNT 1>
3106 (?is)\berror:
3107 <END_RESULT>
3108 <RESULT COUNT 1>
3109 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3110 <END_RESULT>
3111 <END_TC>
3112 :exmp.
3113
3114 .*---------------------------------------------------------------------*
3115 :h3.Adhoc:: Named actual parameters - same parameter more than once in function
3116 .*---------------------------------------------------------------------*
3117 :xmp tab=0.
3118 <TC - Adhoc::Named actual parameters - same parameter more than once in function>
3119 <COMPILE>
3120 <VERDICT_LEAF PASS>
3121 <MODULE TTCN twicetobesure twicetobesure.ttcn>
3122 module twicetobesure {
3123 type component C1 { }
3124 function f1(in integer par1, in float par2, in charstring par3,
3125 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
3126 {
3127 }
3128
3129 testcase tc1() runs on C1
3130 {
3131 f1(1, 1.1, "!!!!11one!!", par4 := true, par4 := true);
3132 }
3133 }
3134 <END_MODULE>
3135 <RESULT COUNT 1>
3136 (?im)Formal.+?parameter.+?assigned.+?more.+?than.+?once
3137 <END_RESULT>
3138 <RESULT COUNT 1>
3139 (?is)\berror:
3140 <END_RESULT>
3141 <RESULT COUNT 1>
3142 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3143 <END_RESULT>
3144 <END_TC>
3145 :exmp.
3146
3147 .*---------------------------------------------------------------------*
3148 :h3.Adhoc:: Named actual parameters - same parameter more than once in altstep
3149 .*---------------------------------------------------------------------*
3150 :xmp tab=0.
3151 <TC - Adhoc::Named actual parameters - same parameter more than once in altstep>
3152 <COMPILE>
3153 <VERDICT_LEAF PASS>
3154 <MODULE TTCN twicetobesure_altstep twicetobesure_altstep.ttcn>
3155 module twicetobesure_altstep {
3156 type component C1 { }
3157 altstep f1(in integer par1, in float par2, in charstring par3,
3158 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
3159 {
3160 [] any timer.timeout { setverdict(pass); }
3161 }
3162
3163 testcase tc1() runs on C1
3164 {
3165 f1(1, 1.1, "!!!!11one!!", par4 := true, par4 := true);
3166 }
3167 }
3168 <END_MODULE>
3169 <RESULT COUNT 1>
3170 (?im)Formal.+?parameter.+assigned.+?more.+?than.+?once
3171 <END_RESULT>
3172 <RESULT COUNT 1>
3173 (?is)\berror:
3174 <END_RESULT>
3175 <RESULT COUNT 1>
3176 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3177 <END_RESULT>
3178 <END_TC>
3179 :exmp.
3180
3181 .*---------------------------------------------------------------------*
3182 :h3.Adhoc:: Named actual parameters - wrong type for parameters in function
3183 .*---------------------------------------------------------------------*
3184 :xmp tab=0.
3185 <TC - Adhoc::Named actual parameters - wrong type for parameters in function>
3186 <COMPILE>
3187 <VERDICT_LEAF PASS>
3188 <MODULE TTCN wrongtype wrongtype.ttcn>
3189 module wrongtype {
3190 type component C1 { }
3191 function f1(in integer par1, in float par2, in charstring par3,
3192 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
3193 {
3194 }
3195
3196 testcase tc1() runs on C1
3197 {
3198 f1(1, 2.2, par3 := true, par4 := "true");
3199 }
3200 }
3201 <END_MODULE>
3202 <RESULT COUNT 1>
3203 (?im)boolean.+?value.+?expected
3204 <END_RESULT>
3205 <RESULT COUNT 1>
3206 (?im)character.+?string.+?value.+?was.+?expected
3207 <END_RESULT>
3208 <RESULT COUNT 2>
3209 (?is)\berror:
3210 <END_RESULT>
3211 <RESULT COUNT 1>
3212 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3213 <END_RESULT>
3214 <END_TC>
3215 :exmp.
3216
3217 .*---------------------------------------------------------------------*
3218 :h3.Adhoc:: Named actual parameters - TR922
3219 .*---------------------------------------------------------------------*
3220 :xmp tab=0.
3221 <TC - Adhoc::Named actual parameters - TR922>
3222 <COMPILE>
3223 <VERDICT_LEAF PASS>
3224 <MODULE TTCN TR922 TR922.ttcn>
3225 module TR922 {
3226 type component CT{}
3227
3228 // a do-nothing function
3229 function twoparfn(in integer foo, in integer bar){}
3230
3231 // a function reference
3232 type function twopar(in integer foo, in integer bar);
3233 // an altstep reference
3234 type altstep twoalt(in integer foo, in integer bar);
3235 // a testcase reference
3236 type testcase twotc(in integer foo, in integer bar) runs on CT;
3237
3238 type record of integer integers;
3239
3240 function f0()
3241 {
3242 twoparfn( 42, );
3243
3244 // this is the part the compiler accidentally stumbles upon
3245 // and considers a named parameter
3246 var integers not_a_named_param := {};
3247 some_random_function(some, random, parameter, list);
3248 }
3249
3250 function f1()
3251 {
3252 var twopar fn := null;
3253 fn.apply( 42, );
3254
3255 // this is the part the compiler accidentally stumbles upon
3256 // and considers a named parameter
3257 var integers not_a_named_param := {};
3258 some_random_function(some, random, parameter, list);
3259 }
3260
3261 function f2()
3262 {
3263
3264 var twoalt alt2;
3265 alt2.apply(42,);
3266
3267 // this is the part the compiler accidentally stumbles upon
3268 // and considers a named parameter
3269 var integers not_a_named_param := {};
3270 some_random_function(some, random, parameter, list);
3271
3272 }
3273
3274 function f3()
3275 {
3276 var twotc tc2 := null;
3277 execute(derefers(tc2)(42,)));
3278
3279 // this is the part the compiler accidentally stumbles upon
3280 // and considers a named parameter
3281 var integers not_a_named_param := {};
3282 some_random_function(some, random, parameter, list);
3283 }
3284
3285 control
3286 {
3287 f0();
3288 f1();
3289 f2();
3290 f3();
3291 }
3292
3293 }
3294 <END_MODULE>
3295 <RESULT COUNT 4>
3296 syntax error, unexpected '\)'
3297 <END_RESULT>
3298 <RESULT COUNT 4>
3299 syntax error, unexpected ';', expecting '\)' or ','
3300 <END_RESULT>
3301 <RESULT COUNT 8>
3302 (?is)\berror:
3303 <END_RESULT>
3304 <RESULT COUNT 1>
3305 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3306 <END_RESULT>
3307 <END_TC>
3308 :exmp.
3309
3310 .*---------------------------------------------------------------------*
3311 :h3.Adhoc:: Named actual parameters - wrong type for the parameters in altstep
3312 .*---------------------------------------------------------------------*
3313 :xmp tab=0.
3314 <TC - Adhoc::Named actual parameters - wrong type for the parameters in altstep>
3315 <COMPILE>
3316 <VERDICT_LEAF PASS>
3317 <MODULE TTCN wrongtype_altstep wrongtype_altstep.ttcn>
3318 module wrongtype_altstep {
3319 type component C1 { }
3320 altstep f1(in integer par1, in float par2, in charstring par3,
3321 in boolean par4 := false, in hexstring par5 := 'DECAFBAD'H)
3322 {
3323 [] any timer.timeout { setverdict(pass); }
3324 }
3325
3326 testcase tc1() runs on C1
3327 {
3328 f1(1, 2.2, par3 := true, par4 := "true");
3329 }
3330 }
3331 <END_MODULE>
3332 <RESULT COUNT 1>
3333 (?im)boolean.+?value.+?expected
3334 <END_RESULT>
3335 <RESULT COUNT 1>
3336 (?im)character.+?string.+?value.+?was.+?expected
3337 <END_RESULT>
3338 <RESULT COUNT 2>
3339 (?is)\berror:
3340 <END_RESULT>
3341 <RESULT COUNT 1>
3342 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3343 <END_RESULT>
3344 <END_TC>
3345 :exmp.
3346
3347 .*---------------------------------------------------------------------*
3348 :h3.Adhoc:: Assignment notation with array indices - unsuitable type indices
3349 .*---------------------------------------------------------------------*
3350 :xmp tab=0.
3351 <TC - Adhoc::Assignment notation with array indices - unsuitable type indices>
3352 <COMPILE>
3353 <VERDICT_LEAF PASS>
3354 <MODULE TTCN unsuitable_indices unsuitable_indices.ttcn>
3355 module unsuitable_indices
3356 {
3357 type component empty { }
3358 type record of integer intlist
3359 type set of integer intsetof
3360 type integer intarr[1]
3361 type record intrec { integer f1, integer f2 }
3362 type set intset { integer f1, integer f2 }
3363 testcase tc () runs on empty
3364 {
3365 var float float_val := 1.0
3366 var float neg_float_val := -1.0
3367 var integer neg_int_val := -1
3368 template intlist a := { 1, 2, 3 }
3369 template intlist a_m1 modifies a := { [1.0] := 0 }
3370 template intlist a_m2 modifies a := { [float_val] := 0 }
3371 template intlist a_m3 modifies a := { [neg_float_val] := 0 }
3372 template intlist a_m4 modifies a := { [-1] := 0 }
3373 template intlist a_m5 modifies a := { [neg_int_val] := 0 }
3374 template intlist a_m6 modifies a := { [-1.0] := 0 }
3375 var intlist ilist := { 1, 2, 3 }
3376 ilist := { [1.0] := 0 }
3377 ilist := { [float_val] := 0 }
3378 ilist := { [neg_float_val] := 0 }
3379 ilist := { [-1] := 0 }
3380 ilist := { [neg_int_val] := 0 }
3381 ilist := { [-1.0] := 0 }
3382 var intsetof iset := { 1, 2, 3 }
3383 iset := { [1.0] := 0 }
3384 iset := { [float_val] := 0 }
3385 iset := { [neg_float_val] := 0 }
3386 iset := { [-1] := 0 }
3387 iset := { [neg_int_val] := 0 }
3388 iset := { [-1.0] := 0 }
3389 var intarr iarr := { 1 }
3390 iarr := { [1.0] := 0 }
3391 iarr := { [float_val] := 0 }
3392 iarr := { [neg_float_val] := 0 }
3393 iarr := { [-1] := 0 }
3394 iarr := { [neg_int_val] := 0 }
3395 iarr := { [-1.0] := 0 }
3396 var intrec ir := { [0] := 0, [1] := 1 }
3397 var intset is := { [0] := 0, [1] := 1 }
3398 }
3399 }
3400 <END_MODULE>
3401 <RESULT COUNT 16>
3402 (?is)\berror:.+?A.+?value.+?or.+?expression.+?type.+?integer.+?was.+?expected
3403 <END_RESULT>
3404 <RESULT COUNT 3>
3405 (?is)\berror:.+?A.+?non-negative.+?integer.+?expected.+?indexing.+?instead.+?of
3406 <END_RESULT>
3407 <RESULT COUNT 1>
3408 (?is)\berror:.+?Indexed assignment notation cannot be used for record type
3409 <END_RESULT>
3410 <RESULT COUNT 1>
3411 (?is)\berror:.+?Value list notation cannot be used for set type
3412 <END_RESULT>
3413 <RESULT COUNT 1>
3414 (?is)\berror:.+?Array index underflow: the index value must be at least `0' instead of `-1'
3415 <END_RESULT>
3416 <RESULT COUNT 22>
3417 (?is)\berror:
3418 <END_RESULT>
3419 <RESULT COUNT 1>
3420 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3421 <END_RESULT>
3422 <END_TC>
3423 :exmp.
3424
3425 .*---------------------------------------------------------------------*
3426 :h3.Adhoc:: Arrays with indexed assignment notation - Variables
3427 .*---------------------------------------------------------------------*
3428 :xmp tab=0.
3429 <TC - Adhoc::Arrays with indexed assignment notation - Variables>
3430 <COMPILE>
3431 <VERDICT_LEAF PASS>
3432 <MODULE TTCN IndexedArrayVariables IndexedArrayVariables.ttcn>
3433 module IndexedArrayVariables {
3434 type component Empty { }
3435 type integer intarr1[1]
3436 type integer intarr2[1..2]
3437 testcase tc() runs on Empty
3438 {
3439 // With one dynamic index.
3440 var integer i := 1
3441 var intarr1 a1 := { [1] := 0 } // Overflow.
3442 var intarr1 a2 := { [2] := 0 } // Overflow.
3443 var intarr1 a3 := { [0] := 0, [1] := 1 } // Overflow and too many elements.
3444 var intarr1 a4 := { [0] := 0, [0] := 0 } // Same index.
3445 var intarr1 a5 := { [0] := 0, [i] := 0, [0] := 0 } // Same index.
3446 var intarr2 a6 := { [0] := 0 } // Underflow.
3447 var intarr2 a7 := { [6] := 6 } // Overflow.
3448 var intarr2 a8 := { [0] := 0, [1] := 1, [2] := 2 } // Underflow and too many elements.
3449 var intarr2 a9 := { [1] := 1, [2] := 2, [3] := 4 } // Overflow and too many elements.
3450 var intarr2 a10 := { [1] := 1, [1] := 1 } // Same index.
3451 }
3452 }
3453 <END_MODULE>
3454 <RESULT COUNT 2>
3455 (?is)\berror: Array index overflow: the index value must be at most `0' instead of `1'
3456 <END_RESULT>
3457 <RESULT COUNT 1>
3458 (?is)\berror: Array index overflow: the index value must be at most `0' instead of `2'
3459 <END_RESULT>
3460 <RESULT COUNT 1>
3461 (?is)\berror: Duplicate index value `0' for components `2' and `1'
3462 <END_RESULT>
3463 <RESULT COUNT 1>
3464 (?is)\berror: Duplicate index value `0' for components `3' and `1'
3465 <END_RESULT>
3466 <RESULT COUNT 2>
3467 (?is)\berror: Array index underflow: the index value must be at least `1' instead of `0'
3468 <END_RESULT>
3469 <RESULT COUNT 1>
3470 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `6'
3471 <END_RESULT>
3472 <RESULT COUNT 1>
3473 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `3'
3474 <END_RESULT>
3475 <RESULT COUNT 1>
3476 (?is)\berror: Duplicate index value `1' for components `2' and `1'
3477 <END_RESULT>
3478 <RESULT COUNT 10>
3479 (?is)\berror:
3480 <END_RESULT>
3481 <RESULT COUNT 1>
3482 (?im)\bnotify: Errors found in the input module. Code will not be generated.
3483 <END_RESULT>
3484 <END_TC>
3485 :exmp.
3486
3487 .*---------------------------------------------------------------------*
3488 :h3.Adhoc:: Arrays with indexed assignment notation - Constants
3489 .*---------------------------------------------------------------------*
3490 :xmp tab=0.
3491 <TC - Adhoc::Arrays with indexed assignment notation - Constants>
3492 <COMPILE>
3493 <VERDICT_LEAF PASS>
3494 <MODULE TTCN IndexedArrayConstants IndexedArrayConstants.ttcn>
3495 module IndexedArrayConstants {
3496 type component Empty { }
3497 type integer intarr1[2]
3498 type integer intarr2[2..4]
3499 testcase tc() runs on Empty
3500 {
3501 const intarr1 a1 := { [3] := 0 } // Overflow.
3502 const intarr1 a2 := { [0] := 0 } // Holes are not allowed.
3503 const intarr1 a3 := { [0] := 0, [1] := 1, [2] := 2 } // Overflow and too many elements.
3504 const intarr1 a4 := { [0] := 0, [0] := 0 } // Same index.
3505 const intarr2 a5 := { [0] := 0 } // Underflow.
3506 const intarr2 a6 := { [6] := 6 } // Overflow.
3507 const intarr2 a7 := { [0] := 0, [1] := 1, [2] := 2 } // Underflow.
3508 }
3509 }
3510 <END_MODULE>
3511 <RESULT COUNT 1>
3512 (?is)\berror: Array index overflow: the index value must be at most `1' instead of `3'
3513 <END_RESULT>
3514 <RESULT COUNT 1>
3515 (?is)\berror: It's not allowed to create hole\(s\) in constant values
3516 <END_RESULT>
3517 <RESULT COUNT 1>
3518 (?is)\berror: Array index overflow: the index value must be at most `1' instead of `2'
3519 <END_RESULT>
3520 <RESULT COUNT 1>
3521 (?is)\berror: Duplicate index value `0' for components `2' and `1'
3522 <END_RESULT>
3523 <RESULT COUNT 2>
3524 (?is)\berror: Array index underflow: the index value must be at least `2' instead of `0'
3525 <END_RESULT>
3526 <RESULT COUNT 1>
3527 (?is)\berror: Array index overflow: the index value must be at most `4' instead of `6'
3528 <END_RESULT>
3529 <RESULT COUNT 1>
3530 (?is)\berror: Array index underflow: the index value must be at least `2' instead of `1'
3531 <END_RESULT>
3532 <RESULT COUNT 8>
3533 (?is)\berror:
3534 <END_RESULT>
3535 <RESULT COUNT 1>
3536 (?im)\bnotify: Errors found in the input module. Code will not be generated.
3537 <END_RESULT>
3538 <END_TC>
3539 :exmp.
3540
3541 .*---------------------------------------------------------------------*
3542 :h3.Adhoc:: Arrays with indexed assignment notation - Templates
3543 .*---------------------------------------------------------------------*
3544 :xmp tab=0.
3545 <TC - Adhoc::Arrays with indexed assignment notation - Templates>
3546 <COMPILE>
3547 <VERDICT_LEAF PASS>
3548 <MODULE TTCN IndexedArrayTemplates IndexedArrayTemplates.ttcn>
3549 module IndexedArrayTemplates {
3550 type component Empty { }
3551 type integer intarr1[1]
3552 type integer intarr2[1..2]
3553 testcase tc() runs on Empty
3554 {
3555 template intarr1 a1 := { 1 }
3556 template intarr1 a2 modifies a1 := { [1] := 0 } // Overflow.
3557 template intarr1 a3 modifies a1 := { [0] := 0, [1] := 1 } // Overflow and too many elements.
3558 template intarr1 a4 modifies a1 := { [0] := 0, [1] := 1 } // Overflow and too many elements.
3559 template intarr1 a5 modifies a1 := { [0] := 0, [0] := 0 } // Same index.
3560 template intarr2 a6 := { [0] := 0 } // Underflow.
3561 template intarr2 a7 := { [6] := 6 } // Overflow.
3562 template intarr2 a8 := { [0] := 0, [1] := 1, [2] := 2 } // Underflow and too many elements.
3563 template intarr2 a9 := { [1] := 1, [2] := 2, [3] := 4 } // Overflow and too many elements.
3564 }
3565 }
3566 <END_MODULE>
3567 <RESULT COUNT 3>
3568 (?is)\berror: Array index overflow: the index value must be at most `0' instead of `1'
3569 <END_RESULT>
3570 <RESULT COUNT 1>
3571 (?is)\berror: Duplicate index value `0' for components `2' and `1'
3572 <END_RESULT>
3573 <RESULT COUNT 2>
3574 (?is)\berror: Array index underflow: the index value must be at least `1' instead of `0'
3575 <END_RESULT>
3576 <RESULT COUNT 1>
3577 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `6'
3578 <END_RESULT>
3579 <RESULT COUNT 1>
3580 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `3'
3581 <END_RESULT>
3582 <RESULT COUNT 8>
3583 (?is)\berror:
3584 <END_RESULT>
3585 <RESULT COUNT 1>
3586 (?im)\bnotify: Errors found in the input module. Code will not be generated.
3587 <END_RESULT>
3588 <END_TC>
3589 :exmp.
3590
3591 .*---------------------------------------------------------------------*
3592 :h3.Adhoc:: Arrays with indexed assignment notation - Timers
3593 .*---------------------------------------------------------------------*
3594 :xmp tab=0.
3595 <TC - Adhoc::Arrays with indexed assignment notation - Timers>
3596 <COMPILE>
3597 <VERDICT_LEAF PASS>
3598 <MODULE TTCN IndexedArrayTimers IndexedArrayTimers.ttcn>
3599 module IndexedArrayTimers {
3600 type component Empty { }
3601 testcase tc() runs on Empty
3602 {
3603 timer a1[1] := { [0] := 0.0, [1] := 1.0 } // Overflow.
3604 timer a2[1] := { [0] := 0.0, [0] := 0.0 } // Same index.
3605 timer a3[1..2] := { [0] := 0.0 } // Underflow.
3606 timer a4[1..2] := { [3] := 3.0 } // Overflow.
3607 timer a5[1..2] := { [0] := 0.0, [1] := 1.0, [2] := 2.0 } // Underflow and too many elements.
3608 timer a6[1..2] := { [2] := 2.0, [3] := 3.0, [4] := 4.0 } // Overflow and too many elements.
3609 }
3610 }
3611 <END_MODULE>
3612 <RESULT COUNT 1>
3613 (?is)\berror: Array index overflow: the index value must be at most `0' instead of `1'
3614 <END_RESULT>
3615 <RESULT COUNT 1>
3616 (?is)\berror: Duplicate index value `0' for timer array elements `2' and `1'
3617 <END_RESULT>
3618 <RESULT COUNT 2>
3619 (?is)\berror: Array index underflow: the index value must be at least `1' instead of `0'
3620 <END_RESULT>
3621 <RESULT COUNT 2>
3622 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `3'
3623 <END_RESULT>
3624 <RESULT COUNT 1>
3625 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `4'
3626 <END_RESULT>
3627 <RESULT COUNT 7>
3628 (?is)\berror:
3629 <END_RESULT>
3630 <RESULT COUNT 1>
3631 (?im)\bnotify: Errors found in the input module. Code will not be generated.
3632 <END_RESULT>
3633 <END_TC>
3634 :exmp.
3635
3636 .*---------------------------------------------------------------------*
3637 :h3.Adhoc:: replace() predefined function - bad arguments
3638 .*---------------------------------------------------------------------*
3639 :xmp tab=0.
3640 <TC - Adhoc::replace() predefined function - bad arguments>
3641 <COMPILE>
3642 <VERDICT_LEAF PASS>
3643 <MODULE TTCN bad_arguments bad_arguments.ttcn>
3644 module bad_arguments
3645 {
3646 type component empty { }
3647 type record of integer intlist1
3648 type record of integer intlist2
3649 testcase tc () runs on empty
3650 {
3651 var integer a := 0
3652 var charstring cs_1 := "My name is JJ"
3653 var bitstring bs_1 := '11'B
3654 var charstring cs_2 := replace("My name is JJ", -1, 2, "xx")
3655 var intlist1 il1 := { 1, 2, 3 }
3656 var intlist2 il2 := { 4 }
3657 cs_2 := replace("My name is JJ", 1, 2, '11'B)
3658 cs_2 := replace("My name is JJ", 100, 2, "x")
3659 cs_2 := replace("My name is JJ", a, 100, "x")
3660 cs_2 := replace(cs_1, 1, 2, bs_1)
3661 cs_2 := replace(cs_1, 1.0, 2, "xx")
3662 il1 := replace(il1, 1, 1, il2)
3663 il1 := replace(il1, 1, 1, cs_1[10])
3664 }
3665 }
3666 <END_MODULE>
3667 <RESULT COUNT 1>
3668 (?is)\berror:.+?Second operand of operation `replace\(\)' should not be negative
3669 <END_RESULT>
3670 <RESULT COUNT 2>
3671 (?is)\berror:.+?Fourth operand of operation `replace\(\)' is of type `bitstring', but a value of type `charstring' was expected here
3672 <END_RESULT>
3673 <RESULT LTRT COUNT 1>
3674 (?is)\berror:.+?Fourth operand of operation `replace\(\)' is of type `\@bad_arguments.intlist2', but a value of type `\@bad_arguments.intlist1' was expected here
3675 <END_RESULT>
3676 <RESULT COUNT 1>
3677 (?is)\berror:.+?Fourth operand of operation `replace\(\)' is of type `charstring', but a value of type `\@bad_arguments.intlist1' was expected here
3678 <END_RESULT>
3679 <RESULT COUNT 1>
3680 (?is)\berror:.+?The sum of second operand `index' \(100\) and third operand `len' \(2\) is greater than the length of the first operand \(13\)
3681 <END_RESULT>
3682 <RESULT COUNT 1>
3683 (?is)\berror:.+?Third operand `len' \(100\) is greater than the length of the first operand \(13\)
3684 <END_RESULT>
3685 <RESULT COUNT 1>
3686 (?is)\berror:.+?Second operand of operation `replace\(\)' should be integer value
3687 <END_RESULT>
3688 <END_TC>
3689 :exmp.
3690
3691 .*---------------------------------------------------------------------*
3692 :h3.Adhoc:: runs on self + refers in component type definition
3693 .*---------------------------------------------------------------------*
3694 :xmp tab=0.
3695 <TC - runs on self + refers in component type definition>
3696 <COMPILE>
3697 <VERDICT_LEAF PASS>
3698 <MODULE TTCN MTTSM00016005 MTTSM00016005.ttcn>
3699 module MTTSM00016005
3700 {
3701 type function FT_f_runsOnSelf() runs on self;
3702 type component C { const integer ci:=1; }
3703 type component D extends My_RunsOnSelf_CT { const integer di:=9; }
3704 type component E {const integer ei:=0; }
3705 type component My_RunsOnSelf_CT extends C {
3706 var FT_f_runsOnSelf v_f_runsOnSelf := refers(f_runsOnSomething);
3707 var FT_f_runsOnSelf v_f_runsOnSelf2 := refers(f_runsOnC);
3708 var FT_f_runsOnSelf v_f_runsOnSelf3 := refers(f_runsOnD);
3709 var FT_f_runsOnSelf v_f_runsOnSelf4 := refers(f_runsOnE);
3710 }
3711
3712 function f_runsOnSomething() runs on My_RunsOnSelf_CT { }
3713 function f_runsOnC() runs on C { }
3714 function f_runsOnD() runs on D { }
3715 function f_runsOnE() runs on E { }
3716 control { }
3717 }
3718 <END_MODULE>
3719 <RESULT COUNT 1>
3720 (?is)\berror: Runs on clause mismatch: type `.+FT_f_runsOnSelf' has a 'runs on self' clause and the current component definition is of type `.+My_RunsOnSelf_CT', but function `.+f_runsOnD' runs on `.+D'
3721 <END_RESULT>
3722 <RESULT COUNT 1>
3723 (?is)\berror: Runs on clause mismatch: type `.+FT_f_runsOnSelf' has a 'runs on self' clause and the current component definition is of type `.+My_RunsOnSelf_CT', but function `.+f_runsOnE' runs on `.+E'
3724 <END_RESULT>
3725 <END_TC>
3726 :exmp.
3727
3728 .*---------------------------------------------------------------------*
3729 :h3.Adhoc:: large integers - array definitions
3730 .*---------------------------------------------------------------------*
3731 :xmp tab=0.
3732 <TC - large integers - arrays and large integers>
3733 <COMPILE>
3734 <VERDICT_LEAF PASS>
3735 <MODULE TTCN LargeIntArr LargeIntArr.ttcn>
3736 module LargeIntArr
3737 {
3738 type integer intarr1[2222222222222222222222222222222]
3739 type integer intarr2[1111111111111111111111111111111..2222222222222222222222222222222]
3740 type integer intarr3[1111111111111111111111111111111..1]
3741 type integer intarr4[2..2222222222222222222222222222222]
3742 control {
3743 }
3744 }
3745 <END_MODULE>
3746 <RESULT COUNT 1>
3747 (?is)\berror: The array size should be less than `2147483647' instead of `2222222222222222222222222222222'
3748 <END_RESULT>
3749 <RESULT COUNT 2>
3750 (?is)\berror: The lower bound of an array index should be less than `2147483647' instead of `1111111111111111111111111111111'
3751 <END_RESULT>
3752 <RESULT COUNT 2>
3753 (?is)\berror: The upper bound of an array index should be less than `2147483647' instead of `2222222222222222222222222222222'
3754 <END_RESULT>
3755 <END_TC>
3756 :exmp.
3757
3758 .*---------------------------------------------------------------------*
3759 :h3.Adhoc:: large integers - array indexing
3760 .*---------------------------------------------------------------------*
3761 :xmp tab=0.
3762 <TC - large integers - array indexing>
3763 <COMPILE>
3764 <VERDICT_LEAF PASS>
3765 <MODULE TTCN LargeIntIndexing LargeIntIndexing.ttcn>
3766 module LargeIntIndexing
3767 {
3768 type integer intarr4[4]
3769 control {
3770 const integer ci1 := 11111111111111111111111111111111111111
3771 var intarr4 iarr1 := {1, 2, 3, 4}
3772 var intarr4 iarr2 := {1, 2, 3, -444444444444444444444444444}
3773 iarr2[ci1] := 1
3774 iarr2[12345678910111213141516] := 1
3775 }
3776 }
3777 <END_MODULE>
3778 <RESULT COUNT 1>
3779 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `11111111111111111111111111111111111111'
3780 <END_RESULT>
3781 <RESULT COUNT 1>
3782 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `12345678910111213141516'
3783 <END_RESULT>
3784 <END_TC>
3785 :exmp.
3786
3787 .*---------------------------------------------------------------------*
3788 :h3.Adhoc:: large integers - universal charstring elements
3789 .*---------------------------------------------------------------------*
3790 :xmp tab=0.
3791 <TC - large integers - universal charstring elements>
3792 <COMPILE>
3793 <VERDICT_LEAF PASS>
3794 <MODULE TTCN LargeIntUni LargeIntUni.ttcn>
3795 module LargeIntUni
3796 {
3797 control {
3798 var universal charstring vus1 := char(11111111111111111111111111111111, 0, 0, 0) & char(1, 1, 1, 1)
3799 var universal charstring vus2 := char(-11111111111111111111111111111111, 0, 0, 0) & char(1, 1, 1, 1)
3800 var universal charstring vus3 := char(11111111111111111111111111111111, 12345678910111213141516171819202, 0, 0) & char(1, 1, 1, -1) & char(11111111111111111111111111111111, 22222222222222222222222222222222, 33333333333333333333333333333333, 44444444444444444444444444444444)
3801 }
3802 }
3803 <END_MODULE>
3804 <RESULT COUNT 4>
3805 (?is)\berror: The first number of quadruple \(group\) must be within the range 0 .. 127 instead of 11111111111111111111111111111111
3806 <END_RESULT>
3807 <RESULT COUNT 2>
3808 (?is)\berror: at or before token `-': syntax error, unexpected '-', expecting Number
3809 <END_RESULT>
3810 <RESULT COUNT 1>
3811 (?is)\berror: The second number of quadruple \(plane\) must be within the range 0 .. 255 instead of 12345678910111213141516171819202
3812 <END_RESULT>
3813 <RESULT COUNT 1>
3814 (?is)\berror: The second number of quadruple \(plane\) must be within the range 0 .. 255 instead of 22222222222222222222222222222222
3815 <END_RESULT>
3816 <RESULT COUNT 1>
3817 (?is)\berror: The third number of quadruple \(row\) must be within the range 0 .. 255 instead of 33333333333333333333333333333333
3818 <END_RESULT>
3819 <RESULT COUNT 1>
3820 (?is)\berror: The fourth number of quadruple \(cell\) must be within the range 0 .. 255 instead of 44444444444444444444444444444444
3821 <END_RESULT>
3822 <END_TC>
3823 :exmp.
3824
3825 .*---------------------------------------------------------------------*
3826 :h3.Adhoc:: large integers - timer arrays
3827 .*---------------------------------------------------------------------*
3828 :xmp tab=0.
3829 <TC - large integers - timer arrays>
3830 <COMPILE>
3831 <VERDICT_LEAF PASS>
3832 <MODULE TTCN LargeIntTimer LargeIntTimer.ttcn>
3833 module LargeIntTimer
3834 {
3835 control {
3836 const integer ci1 := 11111111111111111111111111111111111111
3837 var integer vi1 := ci1
3838 timer tarr1[1] := {[11111111111111111111111111111111111111] := 1}
3839 timer tarr2[vi1] := {[22222222222222222222222222222222222222] := 1, [vi1] := vi1, [vi1 + 1] := 11111111111111111111111111111111111111}
3840 }
3841 }
3842 <END_MODULE>
3843 <RESULT COUNT 1>
3844 (?is)\berror: Array index overflow: the index value must be at most `0' instead of `11111111111111111111111111111111111111'
3845 <END_RESULT>
3846 <RESULT COUNT 1>
3847 (?is)\berror: Reference to a constant value was expected instead of variable `vi1'
3848 <END_RESULT>
3849 <RESULT COUNT 4>
3850 (?is)\berror: A value or expression of type float was expected
3851 <END_RESULT>
3852 <RESULT COUNT 1>
3853 (?is)\berror: An integer value less than `2147483647' was expected for indexing timer array instead of `22222222222222222222222222222222222222'
3854 <END_RESULT>
3855 <END_TC>
3856 :exmp.
3857
3858 .*---------------------------------------------------------------------*
3859 :h3.Adhoc:: large integers - indexed notation
3860 .*---------------------------------------------------------------------*
3861 :xmp tab=0.
3862 <TC - large integers - indexed notation>
3863 <COMPILE>
3864 <VERDICT_LEAF PASS>
3865 <MODULE TTCN LargeIntIndexed LargeIntIndexed.ttcn>
3866 module LargeIntIndexed
3867 {
3868 type record of integer intlist
3869 type set of integer intset
3870 type integer intarr4[4]
3871 template intlist itemp1 := {11111111111111111111111111111111, 11, 111}
3872 template intlist itemp2 := {[11111111111111111111111111111111] := 1}
3873 template intlist itemp3 := {[valueof(itemp1[1])] := 1, [1] := 1, [11111111111111111111111111111111] := 1, [11] := 1, [11111111111111111111111111111111] := 1 }
3874 template intset itemp4 := {[11111111111111111111111111111111] := 1}
3875 template intset itemp5 := {[valueof(itemp1[1])] := 1, [1] := 1, [11111111111111111111111111111111] := 1, [11] := 1, [11111111111111111111111111111111] := 1 }
3876 template intarr4 itemp6 := {[12345678910111213141516171819202] := 1}
3877 template intarr4 itemp7 := {[0] := 1, [12345678910111213141516171819202] := 1, [11111111111111111111111111111111] := 1, [1] := 1, [1] := 1}
3878 control {
3879 }
3880 }
3881 <END_MODULE>
3882 <RESULT COUNT 3>
3883 (?is)\berror: An integer value less than `2147483647' was expected for indexing type `.+?intlist' instead of `11111111111111111111111111111111'
3884 <END_RESULT>
3885 <RESULT COUNT 3>
3886 (?is)\berror: An integer value less than `2147483647' was expected for indexing type `.+?intset' instead of `11111111111111111111111111111111'
3887 <END_RESULT>
3888 <RESULT COUNT 2>
3889 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `12345678910111213141516171819202'
3890 <END_RESULT>
3891 <RESULT COUNT 1>
3892 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `11111111111111111111111111111111'
3893 <END_RESULT>
3894 <RESULT COUNT 1>
3895 (?is)\berror: Duplicate index value `1' for components `5' and `4'
3896 <END_RESULT>
3897 <END_TC>
3898 :exmp.
3899
3900 .*---------------------------------------------------------------------*
3901 :h3.Adhoc:: large integers - the substr() predefined function
3902 .*---------------------------------------------------------------------*
3903 :xmp tab=0.
3904 <TC - large integers - the substr() predefined function>
3905 <COMPILE>
3906 <VERDICT_LEAF PASS>
3907 <MODULE TTCN LargeIntSubstr LargeIntSubstr.ttcn>
3908 module LargeIntSubstr
3909 {
3910 control {
3911 var charstring cs1 := substr("example1", 11111111111111111111111111111111, 1)
3912 var charstring cs2 := substr("example2", 1, 11111111111111111111111111111111)
3913 var charstring cs3 := substr("example3", 12345678910111213141516171819202, 11111111111111111111111111111111)
3914 }
3915 }
3916 <END_MODULE>
3917 <RESULT COUNT 1>
3918 (?is)\berror: The sum of second operand `index' \(11111111111111111111111111111111\) and third operand `returncount' \(1\) is greater than the length of the first operand \(8\)
3919 <END_RESULT>
3920 <RESULT COUNT 1>
3921 (?is)\berror: The sum of second operand `index' \(1\) and third operand `returncount' \(11111111111111111111111111111111\) is greater than the length of the first operand \(8\)
3922 <END_RESULT>
3923 <RESULT COUNT 1>
3924 (?is)\berror: The sum of second operand `index' \(12345678910111213141516171819202\) and third operand `returncount' \(11111111111111111111111111111111\) is greater than the length of the first operand \(8\)
3925 <END_RESULT>
3926 <END_TC>
3927 :exmp.
3928
3929 .*---------------------------------------------------------------------*
3930 :h3.Adhoc:: large integers - enumerations
3931 .*---------------------------------------------------------------------*
3932 :xmp tab=0.
3933 <TC - large integers - enumerations>
3934 <COMPILE>
3935 <VERDICT_LEAF PASS>
3936 <MODULE TTCN LargeIntEnum LargeIntEnum.ttcn>
3937 module LargeIntEnum
3938 {
3939 type enumerated enum1 {first(1111111111111111111111111111)}
3940 control {
3941 }
3942 }
3943 <END_MODULE>
3944 <RESULT COUNT 1>
3945 (?is)\berror: The numeric value of enumeration `first' \(1111111111111111111111111111\) is too large for being represented in memory
3946 <END_RESULT>
3947 <END_TC>
3948 :exmp.
3949
3950 .*---------------------------------------------------------------------*
3951 :h3.Adhoc:: large integers - integer subtypes
3952 .*---------------------------------------------------------------------*
3953 :xmp tab=0.
3954 <TC - large integers - integer subtypes>
3955 <COMPILE>
3956 <VERDICT_LEAF PASS>
3957 <MODULE TTCN LargeIntSubtypes LargeIntSubtypes.ttcn>
3958 module LargeIntSubtypes
3959 {
3960 type integer int1 (12345678910111213141516171819..0)
3961 type integer int2 (0..12345678910111213141516171819)
3962 type integer int3 (12345678910111213141516171819..12345678910111213141516171819)
3963 type integer int4[4] (12345678910111213141516171819)
3964 control {
3965 }
3966 }
3967 <END_MODULE>
3968 <RESULT COUNT 1>
3969 (?is)\berror: lower boundary is bigger than upper boundary in integer subtype range
3970 <END_RESULT>
3971 <END_TC>
3972 :exmp.
3973
3974 .*---------------------------------------------------------------------*
3975 :h3.Adhoc:: large integers - value range templates
3976 .*---------------------------------------------------------------------*
3977 :xmp tab=0.
3978 <TC - large integers - value range templates>
3979 <COMPILE>
3980 <VERDICT_LEAF PASS>
3981 <MODULE TTCN LargeIntRange LargeIntRange.ttcn>
3982 module LargeIntRange
3983 {
3984 template integer itemp1 := (12345678910111213141516..1)
3985 template integer itemp2 := (12345678910111213141516..1234567891011121314151617)
3986 template integer itemp3 := (1..1234567891011121314151617)
3987 template integer itemp4 := (11111111111111111111111111)
3988 control {
3989 }
3990 }
3991 <END_MODULE>
3992 <RESULT COUNT 1>
3993 (?is)\berror: The lower boundary is higher than the upper boundary
3994 <END_RESULT>
3995 <END_TC>
3996 :exmp.
3997
3998 .*---------------------------------------------------------------------*
3999 :h3.Adhoc:: large integers - the replace() predefined function
4000 .*---------------------------------------------------------------------*
4001 :xmp tab=0.
4002 <TC - large integers - the replace() predefined function>
4003 <COMPILE>
4004 <VERDICT_LEAF PASS>
4005 <MODULE TTCN LargeIntReplace LargeIntReplace.ttcn>
4006 module LargeIntReplace
4007 {
4008 control {
4009 var charstring cs1 := "exampletext1"
4010 var charstring cs2 := "exampletext2"
4011 cs1 := replace("exampletext1", 11111111111111111111111111111111, 1, "hello")
4012 cs1 := replace("exampletext1", 1, 11111111111111111111111111111111, "hello")
4013 cs1 := replace("exampletext1", 11111111111111111111111111111111, 11111111111111111111111111111111, "hello")
4014 cs1 := replace("exampletext1", 11111111111111111111111111111111, 11111111111111111111111111111111, cs2)
4015 }
4016 }
4017 <END_MODULE>
4018 <RESULT COUNT 1>
4019 (?is)\berror: The sum of second operand `index' \(11111111111111111111111111111111\) and third operand `len' \(1\) is greater than the length of the first operand \(12\)
4020 <END_RESULT>
4021 <RESULT COUNT 1>
4022 (?is)\berror: The sum of second operand `index' \(1\) and third operand `len' \(11111111111111111111111111111111\) is greater than the length of the first operand \(12\)
4023 <END_RESULT>
4024 <RESULT COUNT 2>
4025 (?is)\berror: The sum of second operand `index' \(11111111111111111111111111111111\) and third operand `len' \(11111111111111111111111111111111\) is greater than the length of the first operand \(12\)
4026 <END_RESULT>
4027 <END_TC>
4028 :exmp.
4029
4030 .*---------------------------------------------------------------------*
4031 :h3.Adhoc:: large integers - other predefined functions
4032 .*---------------------------------------------------------------------*
4033 :xmp tab=0.
4034 <TC - large integers - other predefined functions>
4035 <COMPILE>
4036 <VERDICT_LEAF PASS>
4037 <MODULE TTCN LargeIntPredef LargeIntPredef.ttcn>
4038 module LargeIntPredef
4039 {
4040 control {
4041 var charstring cs1
4042 var bitstring bs1
4043 var hexstring hs1
4044 var octetstring os1
4045 var universal charstring us1
4046 var float r1
4047 bs1 := int2bit(1234567891011121314151617181920, 1)
4048 bs1 := int2bit(1, 1234567891011121314151617181920)
4049 bs1 := int2bit(1234567891011121314151617181920, 1234567891011121314151617181920)
4050 hs1 := int2hex(1234567891011121314151617181920, 1)
4051 hs1 := int2hex(1, 1234567891011121314151617181920)
4052 hs1 := int2hex(1234567891011121314151617181920, 1234567891011121314151617181920)
4053 os1 := int2oct(1234567891011121314151617181920, 1)
4054 os1 := int2oct(1, 1234567891011121314151617181920)
4055 os1 := int2oct(1234567891011121314151617181920, 1234567891011121314151617181920)
4056 cs1 := regexp("Hello, World!", "(Hello, World!)*", 1234567891011121314151617181920)
4057 cs1 := int2char(1234567891011121314151617181920)
4058 us1 := int2unichar(1234567891011121314151617181920)
4059 }
4060 }
4061 <END_MODULE>
4062 <RESULT COUNT 3>
4063 (?is)\berror: Value 1234567891011121314151617181920 does not fit in length 1
4064 <END_RESULT>
4065 <RESULT COUNT 6>
4066 (?is)\berror: The length of the resulting string is too large for being represented in memory
4067 <END_RESULT>
4068 <RESULT COUNT 1>
4069 (?is)\berror: The operand of operation `int2char\(\)' should be in range 0..127
4070 <END_RESULT>
4071 <RESULT COUNT 1>
4072 (?is)\berror: First operand of operation `int2unichar\(\)' should be in range 0..2147483647
4073 <END_RESULT>
4074 <RESULT COUNT 1>
4075 (?is)\berror: The the third operand of `regexp\(\)' is too large: The requested group index is 1234567891011121314151617181920, but the pattern contains only 1 group
4076 <END_RESULT>
4077 <END_TC>
4078 :exmp.
4079
4080 .*---------------------------------------------------------------------*
4081 :h3.Adhoc:: large integers - length restrictions
4082 .*---------------------------------------------------------------------*
4083 :xmp tab=0.
4084 <TC - large integers - length restrictions>
4085 <COMPILE>
4086 <VERDICT_LEAF PASS>
4087 <MODULE TTCN LargeIntLenRest LargeIntLenRest.ttcn>
4088 module LargeIntLenRest
4089 {
4090 type record of integer intlist
4091 type set of integer intset
4092 type integer intarr[1]
4093 template intlist ilent1 := {1, 2, 3} length(12345678910111213141516)
4094 template intlist ilent2 := {1, 12345678910111213141516} length(1..12345678910111213141516)
4095 template intlist ilent3 := {1, 2, 3} length(-2..-12345678910111213141516)
4096 template intlist ilent4 := {1, 2, 3} length(12345678910111213141516..1)
4097 template intlist ilent5 := {1, 2, 3} length(12345678910111213141516..12345678910111213141516)
4098 template intarr iat1 := {1} length(1111111111111111111111111111)
4099 template intarr iat2 := {1} length(1..1111111111111111111111111111)
4100 template intarr iat3 := {1} length(1111111111111111111111111111..1)
4101 template intarr iat4 := {1} length(1111111111111111111111111111..1111111111111111111111111111)
4102 control {
4103 }
4104 }
4105 <END_MODULE>
4106 <RESULT COUNT 1>
4107 (?is)\berror: There are fewer \(3\) elements in the template than it is allowed by the length restriction \(12345678910111213141516\)
4108 <END_RESULT>
4109 <RESULT COUNT 2>
4110 (?is)\berror: There are fewer \(3\) elements in the template than it is allowed by the length restriction \(at least 12345678910111213141516\)
4111 <END_RESULT>
4112 <RESULT COUNT 1>
4113 (?is)\berror: The upper boundary of the length restriction must be a non-negative integer value instead of -12345678910111213141516
4114 <END_RESULT>
4115 <RESULT COUNT 1>
4116 (?is)\berror: The lower boundary of the length restriction must be a non-negative integer value instead of -2
4117 <END_RESULT>
4118 <RESULT COUNT 1>
4119 (?is)\berror: The upper boundary of the length restriction \(1\) cannot be smaller than the lower boundary \(1111111111111111111111111111\)
4120 <END_RESULT>
4121 <RESULT COUNT 2>
4122 (?is)\berror: An integer value less than `2147483647' was expected as the upper boundary of the length restriction instead of `1111111111111111111111111111'
4123 <END_RESULT>
4124 <RESULT COUNT 2>
4125 (?is)\berror: An integer value less than `2147483647' was expected as the lower boundary of the length restriction instead of `1111111111111111111111111111'
4126 <END_RESULT>
4127 <RESULT COUNT 1>
4128 (?is)\berror: The number of elements allowed by the length restriction \(1111111111111111111111111111\) contradicts the array size \(1\)
4129 <END_RESULT>
4130 <END_TC>
4131 :exmp.
4132
4133 .*---------------------------------------------------------------------*
4134 :h3.Adhoc:: large integers - basic operations
4135 .*---------------------------------------------------------------------*
4136 :xmp tab=0.
4137 <TC - large integers - basic operations>
4138 <COMPILE>
4139 <VERDICT_LEAF PASS>
4140 <MODULE TTCN LargeIntBasic LargeIntBasic.ttcn>
4141 module LargeIntBasic
4142 {
4143 control {
4144 var bitstring bs1
4145 var charstring cs1
4146 bs1 := bs1 << 1234567891011121314151617181920
4147 bs1 := bs1 >> 1234567891011121314151617181920
4148 cs1 := cs1 <@ 1234567891011121314151617181920
4149 cs1 := cs1 @> 1234567891011121314151617181920
4150 }
4151 }
4152 <END_MODULE>
4153 <RESULT COUNT 1>
4154 (?is)\berror: Right operand of operation `<<' should be less than `2147483647' instead of `1234567891011121314151617181920'
4155 <END_RESULT>
4156 <RESULT COUNT 1>
4157 (?is)\berror: Right operand of operation `>>' should be less than `2147483647' instead of `1234567891011121314151617181920'
4158 <END_RESULT>
4159 <RESULT COUNT 1>
4160 (?is)\berror: Right operand of operation `<@' should be less than `2147483647' instead of `1234567891011121314151617181920'
4161 <END_RESULT>
4162 <RESULT COUNT 1>
4163 (?is)\berror: Right operand of operation `@>' should be less than `2147483647' instead of `1234567891011121314151617181920'
4164 <END_RESULT>
4165 <END_TC>
4166 :exmp.
4167
4168 .*---------------------------------------------------------------------*
4169 :h3.Adhoc:: TR 921 - indexing string type template variables
4170 .*---------------------------------------------------------------------*
4171 :xmp tab=0.
4172 <TC - TR 921 - indexing string type template variables>
4173 <COMPILE>
4174 <VERDICT_LEAF PASS>
4175 <MODULE TTCN TR921 TR921.ttcn>
4176 module TR921
4177 {
4178 control {
4179 var template octetstring ost := '11'O
4180 var template charstring cst := "11"
4181 var template bitstring bst := '11'B
4182 var template hexstring hst := '11'H
4183 var template universal charstring ust := "11"
4184 // Octetstring.
4185 ost[0] := '11'O
4186 ost := ost[1]
4187 if ('11'O == ost[0]) { }
4188 if (ost[0] == '11'O) { }
4189 log(ost[0]);
4190 // Charstring.
4191 cst[0] := "11"
4192 cst := cst[1]
4193 if ("11" == cst[0]) { }
4194 if (cst[0] == "11") { }
4195 log(cst[0]);
4196 // Bitstring.
4197 bst[0] := '11'B
4198 bst := bst[1]
4199 if ('11'B == bst[0]) { }
4200 if (bst[0] == '11'B) { }
4201 log(bst[0]);
4202 // Hexstring.
4203 hst[0] := '11'H
4204 hst := hst[1]
4205 if ('11'H == hst[0]) { }
4206 if (hst[0] == '11'H) { }
4207 log(hst[0]);
4208 // Universal charstring.
4209 ust[0] := "11"
4210 ust := ust[1]
4211 if ("11" == ust[0]) { }
4212 if (ust[0] == "11") { }
4213 log(ust[0]);
4214 }
4215 }
4216 <END_MODULE>
4217 <RESULT COUNT 2>
4218 (?is)\berror: Reference to a value was expected instead of template variable `ost'
4219 <END_RESULT>
4220 <RESULT COUNT 2>
4221 (?is)\berror: Reference to template variable `ost' can not be indexed
4222 <END_RESULT>
4223 <RESULT COUNT 2>
4224 (?is)\berror: Reference to a value was expected instead of template variable `cst'
4225 <END_RESULT>
4226 <RESULT COUNT 2>
4227 (?is)\berror: Reference to template variable `cst' can not be indexed
4228 <END_RESULT>
4229 <RESULT COUNT 2>
4230 (?is)\berror: Reference to a value was expected instead of template variable `bst'
4231 <END_RESULT>
4232 <RESULT COUNT 2>
4233 (?is)\berror: Reference to template variable `bst' can not be indexed
4234 <END_RESULT>
4235 <RESULT COUNT 2>
4236 (?is)\berror: Reference to a value was expected instead of template variable `hst'
4237 <END_RESULT>
4238 <RESULT COUNT 2>
4239 (?is)\berror: Reference to template variable `hst' can not be indexed
4240 <END_RESULT>
4241 <RESULT COUNT 2>
4242 (?is)\berror: Reference to a value was expected instead of template variable `ust'
4243 <END_RESULT>
4244 <RESULT COUNT 2>
4245 (?is)\berror: Reference to template variable `ust' can not be indexed
4246 <END_RESULT>
4247 <END_TC>
4248 :exmp.
4249
4250 .*---------------------------------------------------------------------*
4251 :h3.Adhoc:: pattern concatenation - pattern concatenation mistakes
4252 .*---------------------------------------------------------------------*
4253 :xmp tab=0.
4254 <TC - pattern concatenation - pattern concatenation mistakes>
4255 <COMPILE>
4256 <VERDICT_LEAF PASS>
4257 <MODULE TTCN PatternCat PatternCat.ttcn>
4258 module PatternCat
4259 {
4260 function myfunc(in integer i) return charstring { return "xyz" }
4261 function myfuncp(in integer i) return charstring { return "xyz" }
4262 type record srec { charstring s }
4263 type record of srec slist
4264
4265 control {
4266 var integer myvar := 123
4267 var charstring cs := "xyz"
4268 var octetstring os := '0123'O
4269 var slist mylist
4270 var srec myrec := { "xyz" }
4271 mylist[0].s := "xyz"
4272
4273 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & 12 }
4274 { var template charstring myt := pattern "valami" & cs & "megegyszer" & 12 & "utoljara" }
4275 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & refers(myfunc) }
4276 { var template charstring myt := pattern "valami" & cs & "megegyszer" & refers(myfunc) & "utoljara" }
4277 { var template charstring myt := pattern "valami" & cs & "megegyszer" & myfunc() & "utoljara" }
4278 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & myfunc() }
4279 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & myfuncp(1) }
4280 { var template charstring myt := pattern "valami" & cs & "megegyszer" & myfuncp(1) & "utoljara" }
4281 { var template charstring myt := pattern "valami" & cs & "megegyszer" & myfuncp(myvar) & "utoljara" }
4282 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & myfuncp(myvar) }
4283 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & myvar }
4284 { var template charstring myt := pattern "valami" & cs & "megegyszer" & myvar & "utoljara" }
4285 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & slist }
4286 { var template charstring myt := pattern "valami" & cs & "megegyszer" & slist & "utoljara" }
4287 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & os }
4288 { var template charstring myt := pattern "valami" & cs & "megegyszer" & os & "utoljara" }
4289 }
4290 }
4291 <END_MODULE>
4292 <RESULT COUNT 2>
4293 (?is)\berror: at or before token `12': syntax error, unexpected Number, expecting Identifier or Cstring
4294 <END_RESULT>
4295 <RESULT COUNT 2>
4296 (?is)\berror: at or before token `refers': syntax error, unexpected RefersKeyword, expecting Identifier or Cstring
4297 <END_RESULT>
4298 <RESULT COUNT 6>
4299 (?is)\berror: at or before token `\(': syntax error, unexpected '\('
4300 <END_RESULT>
4301 <END_TC>
4302 :exmp.
4303
4304 .*---------------------------------------------------------------------*
4305 :h3.Adhoc:: TR 935 - concatenation of incompatible list types
4306 .*---------------------------------------------------------------------*
4307 :xmp tab=0.
4308 <TC - TR 935 - concatenation of incompatible list types>
4309 <COMPILE>
4310 <VERDICT_LEAF PASS>
4311 <MODULE TTCN TR935 TR935.ttcn>
4312 module TR935 {
4313 type record of integer intlist1
4314 type record of integer intlist2
4315 control {
4316 var intlist1 il1 := { 1, 2, 3 }
4317 var intlist2 il2 := { 4 }
4318 il1 := il1 & il2
4319 // Merge this small test-case later.
4320 }
4321 }
4322 <END_MODULE>
4323 <RESULT LTRT COUNT 1>
4324 (?is)\berror: The operands of operation `&' should be of compatible types
4325 <END_RESULT>
4326 <END_TC>
4327 :exmp.
4328
4329 .*---------------------------------------------------------------------*
4330 :h3.Adhoc:: Type Compatibility - Sample tests for structured types
4331 .*---------------------------------------------------------------------*
4332 :xmp tab=0.
4333 <TC - Type Compatibility - Sample test for structured types>
4334 <COMPILE>
4335 <VERDICT_LEAF PASS>
4336 <MODULE TTCN Compat1 Compat1.ttcn>
4337 module Compat1 {
4338 type record myrec1 { integer a }
4339 type record myrec2 { integer a }
4340 type record length(2) of integer myrecof1
4341 type record of integer myrecof2
4342 type record length(4) of integer myrecof3
4343 template myrecof3 t_myrecof3 := { 1, 2, 3, 4 }
4344 type integer myarr1[4]
4345 type union myuni1 {
4346 myrecof1 f1,
4347 myrecof2 f2
4348 }
4349 type union myuni2 {
4350 myrecof2 f1,
4351 myrecof1 f2
4352 }
4353
4354 control {
4355 var myrec1 r1 := { 1 }
4356 var myrec2 r2
4357
4358 r2 := r1
4359 var myrecof1 ro1 := { 1, 2 }
4360 var myrecof2 ro2 := { }
4361 var myrecof3 ro3 := { 1, 2, 3, 4 }
4362 var myarr1 ar1 := { 1, 2, 3, 4 }
4363 var myuni1 uni1
4364 var myuni2 uni2
4365 ro1 := ar1 // !OK -> Incompatible dimension/subtype.
4366 if (r1 == r2) { } // OK
4367 if (ro1 == ro3) { } // !OK -> Incompatible subtypes.
4368 if (uni1 == uni2) { } // OK -> Can be compatible at run-time.
4369 ro2 := substr(myrec1 : t_myrecof3, 0, 1) // !OK
4370 }
4371 }
4372 <END_MODULE>
4373 <RESULT LTRT COUNT 1>
4374 (?is)\berror: Type mismatch: a value of type `\@Compat1.myrec2' was expected instead of `\@Compat1.myrec1'
4375 <END_RESULT>
4376 <RESULT LTRT COUNT 1>
4377 (?is)\berror: Type mismatch: a value of type `\@Compat1.myrecof1' was expected instead of `integer\[4\]'
4378 <END_RESULT>
4379 <RESULT LTRT COUNT 3>
4380 (?is)\berror: The operands of operation `==' should be of compatible types
4381 <END_RESULT>
4382 <RESULT FTRT COUNT 1>
4383 (?is)\berror: Type mismatch: `\@Compat1.myrecof1' and `integer\[4\]' are not compatible: Incompatible record of/SEQUENCE OF subtypes
4384 <END_RESULT>
4385 <RESULT FTRT COUNT 1>
4386 (?is)\berror: Type mismatch: `@Compat1.myrecof1' and `@Compat1.myrecof3' are not compatible: Incompatible record of/SEQUENCE OF subtypes
4387 <END_RESULT>
4388 <RESULT LTRT COUNT 1>
4389 (?is)\berror: Type mismatch: a value or template of type `\@Compat1.myrec1' was expected instead of `\@Compat1.myrecof3'
4390 <END_RESULT>
4391 <RESULT COUNT 1>
4392 (?is)\berror: First operand of operation `substr\(\)' should be a string, `record of' or `set of' value
4393 <END_RESULT>
4394 <END_TC>
4395 :exmp.
4396
4397 .*---------------------------------------------------------------------*
4398 :h3.Adhoc:: Type Compatibility - Simple records and others
4399 .*---------------------------------------------------------------------*
4400 :xmp tab=0.
4401 <TC - Type Compatibility - Records and others>
4402 <COMPILE>
4403 <VERDICT_LEAF PASS>
4404 <MODULE TTCN Compat2 Compat2.ttcn>
4405 module Compat2 {
4406 type port MyPort message {
4407 inout myrec1
4408 inout myrec2 // OK
4409 inout myrec1_alias // !OK
4410 }
4411 type component Empty {
4412 timer T
4413 port MyPort P
4414 }
4415 type record myrec1 { integer a }
4416 type myrec1 myrec1_alias // Only a "typedef".
4417 type record myrec2 { integer a }
4418 type record myrec3 { integer a optional }
4419 type record myrec4 { integer a, integer b }
4420 type set myset1 { integer a }
4421 type set of integer mysetof1
4422 type record of integer myrecof1
4423 type record length(1) of integer myrecof2
4424 type record length(2) of integer myrecof3
4425 type integer myarr1[1]
4426 type union myuni1 {
4427 myrec1 a,
4428 myrec2 b
4429 }
4430 type union myuni2 {
4431 myrec2 a,
4432 myrec1 b
4433 }
4434 testcase tc1_Compat2(in myrec1 p1) runs on Empty {
4435 // For template instances the compatibility check is reversed.
4436 var myrec4 rec4 := { 1, 2 }
4437 activate(as1_Compat2(myrec2 : { 1 })) // OK
4438 activate(as1_Compat2(myrec3 : { 1 })) // !OK
4439 activate(as1_Compat2(rec4)) // !OK
4440 P.send(rec4) // !OK
4441 P.receive(rec4) // !OK
4442 }
4443 function f1_Compat2(in myrec1 p1) { }
4444 function f2_Compat2() return myrec1 {
4445 var myrec2 l_rec2
4446 var myrec3 l_rec3
4447 var myrec4 l_rec4
4448 if (l_rec2.a > l_rec2.a) { return l_rec2 } // OK
4449 else if (l_rec2.a == l_rec2.a) { return l_rec3 } // !OK
4450 else if (l_rec2.a < l_rec2.a) { return l_rec4 } // !OK
4451 else { return { 1 } }
4452 }
4453 altstep as1_Compat2(in myrec1 p1) runs on Empty { [p1.a > p1.a] T.timeout { } }
4454 control {
4455 var myrec1 rec1 := { 1 }
4456 var myrec2 rec2 := rec1 // OK
4457 var myrec3 rec3 := { omit }
4458 var myrec4 rec4 := { rec1.a, rec2.a }
4459 var myset1 set1 := { 1 }
4460 var mysetof1 setof1 := { 1 }
4461 var myrecof1 recof1 := { 1 }
4462 var myrecof2 recof2 := { 1 }
4463 var myrecof3 recof3 := { 1, 2 }
4464 var myarr1 arr1 := { 1 }
4465 var myarr2 arr2 := { 1, 2 }
4466 var myuni1 uni1 := { a := { 1 } }
4467 var myuni2 uni2 := { b := { 1 } }
4468 var anytype any1 := { myrec1 := { 1 } }
4469
4470 // Records <-> records.
4471 rec2 := rec3 // OK
4472 if (rec2 == rec3 or rec2 != rec3) { } // OK
4473 execute(tc1_Compat2(rec2)) // OK
4474 execute(tc1_Compat2(rec3)) // !OK
4475 execute(tc1_Compat2(rec4)) // !OK
4476 f1_Compat2(rec2) // OK
4477 f1_Compat2(rec3) // !OK
4478 f1_Compat2(rec4) // !OK
4479
4480 // Records <-> sets.
4481 set1 := rec1 // !OK
4482 rec1 := set1 // !OK
4483 execute(tc1_Compat2(set1)) // !OK
4484 f1_Compat2(set1) // !OK
4485 if (set1 == rec1 or rec1 != set1) { } // !OK
4486
4487 // Records <-> set ofs.
4488 setof1 := rec1
4489 rec1 := setof1
4490 execute(tc1_Compat2(setof1)) // !OK
4491 f1_Compat2(setof1) // !OK
4492 if (setof1 == rec1 or rec1 != setof1) { } // !OK
4493
4494 // Records <-> record ofs.
4495 recof1 := rec1 // OK
4496 rec1 := recof1 // OK
4497 execute(tc1_Compat2(recof1)) // OK
4498 f1_Compat2(recof1) // OK
4499 if (recof1 == rec1 or rec1 != recof1) { } // OK
4500
4501 // Records <-> record ofs (good restriction).
4502 recof2 := rec1 // OK
4503 rec1 := recof2 // OK
4504 execute(tc1_Compat2(recof2)) // OK
4505 f1_Compat2(recof2) // OK
4506 if (recof2 == rec1 or rec1 != recof2) { } // OK
4507
4508 // Records <-> record ofs (bad restriction).
4509 recof3 := rec1 // !OK
4510 rec1 := recof3 // !OK
4511 execute(tc1_Compat2(recof3)) // !OK
4512 f1_Compat2(recof3) // !OK
4513 if (recof3 == rec1 or rec1 != recof3) { } // !OK
4514
4515 // Records <-> arrays (good dimension).
4516 arr1 := rec1 // OK
4517 rec1 := arr1 // OK
4518 execute(tc1_Compat2(arr1)) // OK
4519 f1_Compat2(arr1) // OK
4520 if (arr1 == rec1 or rec1 != arr1) { } // OK
4521
4522 // Records <-> arrays (bad dimension).
4523 arr1 := rec4 // !OK
4524 rec4 := arr1 // !OK
4525 if (arr1 == rec4 or rec4 != arr1) { } // !OK
4526
4527 // Records <-> unions.
4528 uni1 := rec1 // !OK
4529 rec1 := uni1 // !OK
4530 if (uni1 == rec1 or rec1 != uni1) { } // !OK
4531
4532 // Records <-> anytypes.
4533 rec1 := any1 // !OK
4534 any1 := rec1 // !OK
4535 if (any1 == rec1 or rec1 != any1) { } // !OK
4536
4537 // Unions <-> unions.
4538 uni1 := uni2 // OK
4539 uni2 := uni1 // OK
4540 if (uni1 == uni2 or uni2 == uni1) { } // OK
4541
4542 // Unions <-> anytypes.
4543 uni1 := any1 // !OK
4544 any1 := uni1 // !OK
4545 if (uni1 == any1 or any1 == uni1) { } // !OK
4546 }
4547 } with { extension "anytype myrec1, myrec2" }
4548 <END_MODULE>
4549 <RESULT FTRT COUNT 1>
4550 (?is)\berror: Duplicate incoming message type `\@Compat2.myrec1'
4551 <END_RESULT>
4552 <RESULT FTRT COUNT 1>
4553 (?is)\berror: Duplicate outgoing message type `\@Compat2.myrec1'
4554 <END_RESULT>
4555 <RESULT FTRT COUNT 2>
4556 (?is)\bnote: Type `\@Compat2.myrec1' is already listed here
4557 <END_RESULT>
4558 <RESULT FTRT COUNT 1>
4559 (?is)\berror: Message type `\@Compat2.myrec4' is not present on the outgoing list of port type `\@Compat2.MyPort'
4560 <END_RESULT>
4561 <RESULT FTRT COUNT 1>
4562 (?is)\berror: Message type `\@Compat2.myrec4' is not present on the incoming list of port of type `\@Compat2.MyPort'
4563 <END_RESULT>
4564 <RESULT FTRT COUNT 3>
4565 (?is)\berror: Type mismatch: `\@Compat2.myrec2.a' of type `integer' and `\@Compat2.myrec3.a' of type `integer' are not compatible: The optionality of fields in record/SEQUENCE types must be the same
4566 <END_RESULT>
4567 <RESULT FTRT COUNT 4>
4568 (?is)\berror: Type mismatch: `\@Compat2.myrec1.a' of type `integer' and `\@Compat2.myrec3.a' of type `integer' are not compatible: The optionality of fields in record/SEQUENCE types must be the same
4569 <END_RESULT>
4570 <RESULT FTRT COUNT 4>
4571 (?is)\berror: Type mismatch: `\@Compat2.myrec1' and `\@Compat2.myrec4' are not compatible: The number of fields in record/SEQUENCE types must be the same
4572 <END_RESULT>
4573 <RESULT FTRT COUNT 4>
4574 (?is)\berror: Type mismatch: `\@Compat2.myrec1' and `\@Compat2.myset1' are not compatible: set/SET and set of/SET OF types are compatible only with other set/SET set of/SET OF types
4575 <END_RESULT>
4576 <RESULT FTRT COUNT 2>
4577 (?is)\berror: Type mismatch: `\@Compat2.myset1' and `\@Compat2.myrec1' are not compatible: set/SET and set of/SET OF types are compatible only with other set/SET set of/SET OF types
4578 <END_RESULT>
4579 <RESULT FTRT COUNT 4>
4580 (?is)\berror: Type mismatch: `\@Compat2.myrec1' and `\@Compat2.mysetof1' are not compatible: set/SET and set of/SET OF types are compatible only with other set/SET set of/SET OF types
4581 <END_RESULT>
4582 <RESULT FTRT COUNT 2>
4583 (?is)\berror: Type mismatch: `\@Compat2.mysetof1' and `\@Compat2.myrec1' are not compatible: set/SET and set of/SET OF types are compatible only with other set/SET set of/SET OF types
4584 <END_RESULT>
4585 <RESULT FTRT COUNT 4>
4586 (?is)\berror: Type mismatch: `\@Compat2.myrec1' and `\@Compat2.myrecof3' are not compatible: Incompatible record of/SEQUENCE OF subtypes
4587 <END_RESULT>
4588 <RESULT FTRT COUNT 2>
4589 (?is)\berror: Type mismatch: `\@Compat2.myrecof3' and `\@Compat2.myrec1' are not compatible: Incompatible record of/SEQUENCE OF subtypes
4590 <END_RESULT>
4591 <RESULT FTRT COUNT 2>
4592 (?is)\berror: Type mismatch: `integer\[1\]' and `\@Compat2.myrec4' are not compatible: The dimension of the array must be >= than the number of mandatory fields in the record/SEQUENCE type
4593 <END_RESULT>
4594 <RESULT FTRT COUNT 2>
4595 (?is)\berror: Type mismatch: `\@Compat2.myrec4' and `integer\[1\]' are not compatible: The dimension of the array must be >= than the number of mandatory fields in the record/SEQUENCE type
4596 <END_RESULT>
4597 <RESULT FTRT COUNT 2>
4598 (?is)\berror: Type mismatch: `\@Compat2.myuni1' and `\@Compat2.myrec1' are not compatible: union/CHOICE/anytype types are compatible only with other union/CHOICE/anytype types
4599 <END_RESULT>
4600 <RESULT FTRT COUNT 2>
4601 (?is)\berror: Type mismatch: `\@Compat2.myrec1' and `\@Compat2.myuni1' are not compatible: union/CHOICE/anytype types are compatible only with other union/CHOICE/anytype types
4602 <END_RESULT>
4603 <RESULT FTRT COUNT 2>
4604 (?is)\berror: Type mismatch: `\@Compat2.myrec1' and `\@Compat2.anytype' are not compatible: union/CHOICE/anytype types are compatible only with other union/CHOICE/anytype types
4605 <END_RESULT>
4606 <RESULT FTRT COUNT 2>
4607 (?is)\berror: Type mismatch: `\@Compat2.anytype' and `\@Compat2.myrec1' are not compatible: Type anytype is compatible only with other anytype types
4608 <END_RESULT>
4609 <RESULT FTRT COUNT 2>
4610 (?is)\berror: Type mismatch: `\@Compat2.myuni1' and `\@Compat2.anytype' are not compatible: Type anytype is compatible only with other anytype types
4611 <END_RESULT>
4612 <RESULT FTRT COUNT 2>
4613 (?is)\berror: Type mismatch: `\@Compat2.anytype' and `\@Compat2.myuni1' are not compatible: Type anytype is compatible only with other anytype types
4614 <END_RESULT>
4615 <END_TC>
4616 :exmp.
4617
4618 .*---------------------------------------------------------------------*
4619 :h3.Adhoc:: Type Compatibility - Standard compile-time errors
4620 .*---------------------------------------------------------------------*
4621 :xmp tab=0.
4622 <TC - Type Compatibility - Standard compile-time errors>
4623 <COMPILE>
4624 <VERDICT_LEAF PASS>
4625 <MODULE TTCN Compat3 Compat3.ttcn>
4626 // Compile-time errors from the standard.
4627 module Compat3 {
4628 type record AType {
4629 integer a(0..10) optional,
4630 integer b(0..10) optional,
4631 boolean c
4632 }
4633
4634 type record BType {
4635 integer a optional,
4636 integer b(0..10) optional,
4637 boolean c
4638 }
4639
4640 type record CType {
4641 integer d optional,
4642 integer e optional,
4643 boolean f
4644 }
4645
4646 type record DType {
4647 integer a optional,
4648 integer b optional,
4649 boolean c optional
4650 }
4651
4652 type record EType {
4653 integer a optional,
4654 integer b optional,
4655 boolean c,
4656 float d optional
4657 }
4658
4659 type set FType {
4660 integer a optional,
4661 integer b optional,
4662 boolean c
4663 }
4664
4665 type union U1 { integer i }
4666 type union U2 { integer i, boolean b }
4667
4668 control {
4669 var AType MyVarA := { -, 1, true }
4670 var BType MyVarB := { omit, 2, true }
4671 var CType MyVarC := { 3, omit, true }
4672 var DType MyVarD := { 4, 4, true }
4673 var EType MyVarE := { 5, 5, true, omit }
4674 var U1 u1 := { i := 1 }
4675 var U2 u2 := u1
4676
4677 MyVarA := MyVarB // OK
4678 MyVarC := MyVarB // OK
4679 MyVarA := MyVarD // !OK
4680 MyVarA := MyVarE // !OK
4681
4682 var FType MyVarF := { a := 1, c := true }
4683 MyVarF := MyVarA // !OK
4684 u1 := u2 // OK
4685 var anytype x := u1 // !OK
4686 }
4687 } with { extension "anytype integer" }
4688 <END_MODULE>
4689 <RESULT FTRT COUNT 1>
4690 (?is)\berror: Type mismatch: `\@Compat3.AType.c' of type `boolean' and `\@Compat3.DType.c' of type `boolean' are not compatible: The optionality of fields in record/SEQUENCE types must be the same
4691 <END_RESULT>
4692 <RESULT FTRT COUNT 1>
4693 (?is)\berror: Type mismatch: `\@Compat3.AType' and `\@Compat3.EType' are not compatible: The number of fields in record/SEQUENCE types must be the same
4694 <END_RESULT>
4695 <RESULT FTRT COUNT 1>
4696 (?is)\berror: Type mismatch: `\@Compat3.FType' and `\@Compat3.AType' are not compatible: set/SET and set of/SET OF types are compatible only with other set/SET set of/SET OF types
4697 <END_RESULT>
4698 <RESULT FTRT COUNT 1>
4699 (?is)\berror: Type mismatch: `@Compat3.anytype' and `\@Compat3.U1' are not compatible: Type anytype is compatible only with other anytype types
4700 <END_RESULT>
4701 <END_TC>
4702 :exmp.
4703
4704 .*---------------------------------------------------------------------*
4705 :h3.Adhoc:: Type Compatibility - More complex types
4706 .*---------------------------------------------------------------------*
4707 :xmp tab=0.
4708 <TC - Type Compatibility - More complex types>
4709 <COMPILE>
4710 <VERDICT_LEAF PASS>
4711 <MODULE TTCN Compat4 Compat4.ttcn>
4712 module Compat4 {
4713 type record myrec1 {
4714 integer f1 optional,
4715 integer f2,
4716 boolean f3
4717 }
4718 type record myrec2 {
4719 integer f1,
4720 integer f2,
4721 boolean f3
4722 }
4723 type record of myrec1 mylist1
4724 type myrec2 myarr2[2]
4725 type mylist1 myarr1[2] // Top-level 1.
4726 type record of myarr2 mylist2 // Top-level 2.
4727 control {
4728 var myarr1 arr1 := {
4729 { { omit, 99, false }, { 1, 100, true } },
4730 { { 1, 2, false }, { 0, 1, false } }
4731 }
4732 var mylist2 ml2 := {
4733 { { 1, 2, false }, { 11, 22, false } },
4734 { { -1, -2, true }, { -11, -22, true } }
4735 }
4736 arr1 := ml2 // !OK
4737 ml2 := arr1 // !OK
4738 if (arr1 == ml2 or ml2 != arr1) { } // !OK
4739 }
4740 }
4741 <END_MODULE>
4742 <RESULT FTRT COUNT 2>
4743 (?is)\berror: Type mismatch: `\@Compat4.mylist1\[2\]\[\].f1' of type `integer' and `\@Compat4.mylist2\[\].f1' of type `integer' are not compatible: The optionality of fields in record/SEQUENCE types must be the same
4744 <END_RESULT>
4745 <RESULT FTRT COUNT 2>
4746 (?is)\berror: Type mismatch: `\@Compat4.mylist2\[\].f1' of type `integer' and `\@Compat4.mylist1\[2\]\[\].f1' of type `integer' are not compatible: The optionality of fields in record/SEQUENCE types must be the same
4747 <END_RESULT>
4748 <END_TC>
4749 :exmp.
4750
4751 .*---------------------------------------------------------------------*
4752 :h3.Adhoc:: Type Compatibility - Arrays and other list types
4753 .*---------------------------------------------------------------------*
4754 :xmp tab=0.
4755 <TC - Type Compatibility - Arrays and other list types>
4756 <COMPILE>
4757 <VERDICT_LEAF PASS>
4758 <MODULE TTCN Compat5 Compat5.ttcn>
4759 module Compat5 {
4760 const integer i1[2 .. 4] := { 1, 2, 3 }
4761 const integer i2[3] := i1
4762 const integer i3[1..3] := i1
4763 const integer i1[2][1..2] := { { 1, 2 }, { 3, 4 } };
4764 const integer i2[2][0..1] := i1;
4765 control {
4766 }
4767 }
4768 <END_MODULE>
4769 <RESULT FTRT COUNT 1>
4770 (?is)\berror: Type mismatch: `integer\[3\]' and `integer\[2..4\]' are not compatible: Array types should have the same dimension
4771 <END_RESULT>
4772 <RESULT FTRT COUNT 1>
4773 (?is)\berror: Type mismatch: `integer\[1..3\]' and `integer\[2..4\]' are not compatible: Array types should have the same dimension
4774 <END_RESULT>
4775 <RESULT FTRT COUNT 1>
4776 (?is)\berror: Type mismatch: `integer\[2\]\[0..1\]' and `integer\[2..4\]' are not compatible: Array types should have the same dimension
4777 <END_RESULT>
4778 <RESULT LTRT COUNT 1>
4779 (?is)\berror: Type mismatch: a value of type `integer\[3\]' was expected instead of `integer\[2..4\]'
4780 <END_RESULT>
4781 <RESULT LTRT COUNT 1>
4782 (?is)\berror: Type mismatch: a value of type `integer\[1..3\]' was expected instead of `integer\[2..4\]'
4783 <END_RESULT>
4784 <RESULT LTRT COUNT 1>
4785 (?is)\berror: Type mismatch: a value of type `integer\[2\]\[0..1\]' was expected instead of `integer\[2..4\]'
4786 <END_RESULT>
4787 <END_TC>
4788 :exmp.
4789
4790 .*---------------------------------------------------------------------*
4791 :h3.Adhoc:: Type Compatibility - Templates of all kind
4792 .*---------------------------------------------------------------------*
4793 :xmp tab=0.
4794 <TC - Type Compatibility - Templates of all kind>
4795 <COMPILE>
4796 <VERDICT_LEAF PASS>
4797 <MODULE TTCN Compat6 Compat6.ttcn>
4798 module Compat6 {
4799 type record rtype { integer i, boolean b }
4800 type set stype { integer i, boolean b }
4801 type record r2type { integer i1, integer i2 }
4802 type set of integer s2type
4803
4804 template rtype t := { 1, true }
4805 template stype t1 modifies t := { b := false }
4806 template r2type u := { 1, 2 };
4807 template s2type u1 modifies u := { 2, 1 };
4808
4809 // Test for the first bug (TR 955).
4810 type record of integer b1_intlist
4811 type set of integer b1_intset
4812 const b1_intlist c_b1 := { 1, 2, 3 }
4813 template b1_intset t_b1 := { 3, 2, 1 }
4814
4815 control {
4816 var template rtype tv1
4817 var template r2type tv2
4818 tv1 := tv2
4819 if (match(valueof(t), u1)) { }
4820 if (match(c_b1, t_b1)) { }
4821 }
4822 }
4823 <END_MODULE>
4824 <RESULT FTRT COUNT 1>
4825 (?is)\berror: Type mismatch: `\@Compat6.stype' and `\@Compat6.rtype' are not compatible: set/SET and set of/SET OF types are compatible only with other set/SET set of/SET OF types
4826 <END_RESULT>
4827 <RESULT FTRT COUNT 1>
4828 (?is)\berror: Type mismatch: `\@Compat6.s2type' and `\@Compat6.r2type' are not compatible: set/SET and set of/SET OF types are compatible only with other set/SET set of/SET OF types
4829 <END_RESULT>
4830 <RESULT FTRT COUNT 1>
4831 (?is)\berror: Type mismatch: `\@Compat6.rtype.b' of type `boolean' and `\@Compat6.r2type.i2' of type `integer' are not compatible
4832 <END_RESULT>
4833 <RESULT FTRT COUNT 1>
4834 (?is)\berror: Type mismatch: `\@Compat6.s2type' and `\@Compat6.rtype' are not compatible: set/SET and set of/SET OF types are compatible only with other set/SET set of/SET OF types
4835 <END_RESULT>
4836 <RESULT FTRT COUNT 1>
4837 (?is)\berror: Type mismatch: `\@Compat6.b1_intset' and `\@Compat6.b1_intlist' are not compatible: set/SET and set of/SET OF types are compatible only with other set/SET set of/SET OF types
4838 <END_RESULT>
4839 <RESULT LTRT COUNT 1>
4840 (?is)\berror: The modified template has different type than base template `\@Compat6.t': `\@Compat6.rtype' was expected instead of `\@Compat6.stype'
4841 <END_RESULT>
4842 <RESULT LTRT COUNT 1>
4843 (?is)\berror: The modified template has different type than base template `\@Compat6.u': `\@Compat6.r2type' was expected instead of `\@Compat6.s2type'
4844 <END_RESULT>
4845 <RESULT LTRT COUNT 1>
4846 (?is)\berror: Type mismatch: a value or template of type `\@Compat6.rtype' was expected instead of `\@Compat6.r2type'
4847 <END_RESULT>
4848 <RESULT LTRT COUNT 1>
4849 (?is)\berror: Type mismatch: a value or template of type `\@Compat6.s2type' was expected instead of `\@Compat6.rtype'
4850 <END_RESULT>
4851 <RESULT LTRT COUNT 1>
4852 (?is)\berror: Type mismatch: a value of type `\@Compat6.b1_intset' was expected instead of `\@Compat6.b1_intlist'
4853 <END_RESULT>
4854 <RESULT COUNT 5>
4855 (?is)\berror:
4856 <END_RESULT>
4857 <END_TC>
4858 :exmp.
4859
4860 .*---------------------------------------------------------------------*
4861 :h3.Adhoc:: Type Compatibility - Recursive types
4862 .*---------------------------------------------------------------------*
4863 :xmp tab=0.
4864 <TC - Type Compatibility - Recursive types>
4865 <COMPILE>
4866 <VERDICT_LEAF PASS>
4867 <MODULE TTCN Compat6 Compat6.ttcn>
4868 module Compat6 {
4869 type record of recR recofR
4870 type record recR { recofR rof optional }
4871 type record c1 { recR f1 }
4872 type record c11 { c1 f1 }
4873 type record c2 { recofR f1 }
4874 type record c22 { c2 f1 }
4875 // "Normal" use.
4876 type record A {
4877 integer f1,
4878 B f2 optional
4879 }
4880 type record B {
4881 A f1 optional,
4882 integer f2
4883 }
4884 control {
4885 // Make sure that we don't stuck in an infinite recursion.
4886 var recofR v_rof := { { omit } }
4887 var recR v_r := { rof := omit }
4888 var c11 cc1 := { f1 := { { omit } } }
4889 var c22 cc2 := { f1 := { { { omit } } } }
4890 cc1 := cc2
4891 if (cc1 == cc2) { }
4892 v_r := v_rof
4893 if (v_r.rof == omit) { }
4894 v_rof := v_r
4895 if (cc1 == v_r or v_rof == cc2) { } // Just to get an error...
4896 var A a := { f1 := 1, f2 := { f1 := { 1, omit }, f2 := 11 } }
4897 var B b := { f1 := a, f2 := 1 }
4898 if (a == b and not b != a) { }
4899 }
4900 }
4901 <END_MODULE>
4902 <RESULT FTRT COUNT 1>
4903 (?is)\berror: Type mismatch: `\@Compat6.c11.f1' of type `\@Compat6.c1' and `\@Compat6.recR.rof' of type `\@Compat6.recofR' are not compatible: The optionality of fields in record/SEQUENCE types must be the same
4904 <END_RESULT>
4905 <RESULT FTRT COUNT 1>
4906 (?is)\berror: Type mismatch: `\@Compat6.recofR\[\].rof' of type `\@Compat6.recofR' and `\@Compat6.c22.f1.f1' of type `\@Compat6.recofR' are not compatible: The optionality of fields in record/SEQUENCE types must be the same
4907 <END_RESULT>
4908 <RESULT FTRT COUNT 1>
4909 (?is)\berror: Type mismatch: `\@Compat6.A.f1' of type `integer' and `\@Compat6.B.f1' of type `\@Compat6.A' are not compatible: The optionality of fields in record/SEQUENCE types must be the same
4910 <END_RESULT>
4911 <RESULT FTRT COUNT 1>
4912 (?is)\berror: Type mismatch: `\@Compat6.B.f1' of type `\@Compat6.A' and `\@Compat6.A.f1' of type `integer' are not compatible: The optionality of fields in record/SEQUENCE types must be the same
4913 <END_RESULT>
4914 <RESULT LTRT COUNT 4>
4915 (?is)\berror: The operands of operation `==' should be of compatible types
4916 <END_RESULT>
4917 <RESULT LTRT COUNT 1>
4918 (?is)\berror: The operands of operation `!=' should be of compatible types
4919 <END_RESULT>
4920 <RESULT LTRT COUNT 1>
4921 (?is)\berror: Type mismatch: a value of type `\@Compat6.c11' was expected instead of `\@Compat6.c22'
4922 <END_RESULT>
4923 <RESULT LTRT COUNT 1>
4924 (?is)\berror: Type mismatch: a value of type `\@Compat6.recR' was expected instead of `\@Compat6.recofR'
4925 <END_RESULT>
4926 <RESULT LTRT COUNT 1>
4927 (?is)\berror: Type mismatch: a value of type `\@Compat6.recofR' was expected instead of `\@Compat6.recR'
4928 <END_RESULT>
4929 <END_TC>
4930 :exmp.
4931
4932 .*---------------------------------------------------------------------*
4933 :h3.Adhoc:: Default values of modified parametrized templates
4934 .*---------------------------------------------------------------------*
4935 :xmp tab=0.
4936 <TC - Default values of modified parametrized templates>
4937 <COMPILE>
4938 <VERDICT_LEAF PASS>
4939 <MODULE TTCN TDefPar TDefPar.ttcn>
4940 module TDefPar {
4941 // Negative tests for ETSI CR5091.
4942
4943 type record MyRecordType {
4944 integer field1 optional,
4945 charstring field2,
4946 boolean field3
4947 }
4948
4949 // For value parameters.
4950
4951 template MyRecordType MyTemplate1(integer p_int) := {
4952 field1 := 1,
4953 field2 := "",
4954 field3 := true
4955 }
4956
4957 template MyRecordType MyTemplate2(integer p_int := -) modifies MyTemplate1 := {
4958 field1 := -1
4959 }
4960
4961 template MyRecordType MyTemplate3(integer p_int := -) := {
4962 1, "", true
4963 }
4964
4965 template MyRecordType MyTemplate4(integer p_int := 1, charstring p_str, boolean p_bool) := {
4966 p_int, p_str, p_bool
4967 }
4968
4969 template MyRecordType MyTemplate5(integer p_int := -, charstring p_str := -, boolean p_bool := -) modifies MyTemplate4 := {
4970 p_int, p_str, p_bool
4971 }
4972
4973 template MyRecordType MyTemplate6(integer p_int := 1, charstring p_str, boolean p_bool, octetstring p_ostr := -) modifies MyTemplate4 := {
4974 p_int, p_str, p_bool
4975 }
4976
4977 // For template parameters.
4978
4979 template MyRecordType TMyTemplate1(template integer p_int) := {
4980 field1 := 1,
4981 field2 := "",
4982 field3 := true
4983 }
4984
4985 template MyRecordType TMyTemplate2(template integer p_int := -) modifies TMyTemplate1 := {
4986 field1 := -1
4987 }
4988
4989 template MyRecordType TMyTemplate3(template integer p_int := -) := {
4990 1, "", true
4991 }
4992
4993 template MyRecordType TMyTemplate4(template integer p_int := 1, template charstring p_str, template boolean p_bool) := {
4994 p_int, p_str, p_bool
4995 }
4996
4997 template MyRecordType TMyTemplate5(template integer p_int := -, template charstring p_str := -, template boolean p_bool := -) modifies TMyTemplate4 := {
4998 p_int, p_str, p_bool
4999 }
5000
5001 template MyRecordType TMyTemplate6(template integer p_int := 1, template charstring p_str, template boolean p_bool, template octetstring p_ostr := -) modifies TMyTemplate4 := {
5002 p_int, p_str, p_bool
5003 }
5004
5005 template MyRecordType TMyTemplate7(template integer p_int := 0) modifies MyRecordType := {
5006 field1 := p_int
5007 }
5008
5009 type component Empty { timer T := 1.0 }
5010
5011 testcase TC1(in integer p1 := -) runs on Empty { }
5012 testcase TC2(in template integer p1 := -) runs on Empty { }
5013
5014 function Func1(in integer p1 := -) { }
5015 function Func2(in template integer p1 := -) { }
5016
5017 altstep Alt1(in integer p1 := -) runs on Empty { [1 > 2] T.timeout { } }
5018 altstep Alt2(in template integer p1 := -) runs on Empty { [1 > 2] T.timeout { } }
5019
5020
5021 }
5022 <END_MODULE>
5023 <RESULT COUNT 8>
5024 (?is)\berror: Not used symbol \(`-'\) doesn't have the corresponding default parameter in the base template
5025 <END_RESULT>
5026 <RESULT COUNT 2>
5027 (?is)\berror: Only modified templates are allowed to use the not used symbol \(`-'\) as the default parameter
5028 <END_RESULT>
5029 <RESULT COUNT 5>
5030 (?is)\berror: integer value was expected
5031 <END_RESULT>
5032 <RESULT COUNT 1>
5033 (?is)\berror: character string value was expected
5034 <END_RESULT>
5035 <RESULT COUNT 1>
5036 (?is)\berror: boolean value was expected
5037 <END_RESULT>
5038 <RESULT COUNT 1>
5039 (?is)\berror: octetstring value was expected
5040 <END_RESULT>
5041 <RESULT COUNT 1>
5042 (?is)\berror: Reference to a template was expected in the `modifies' definition instead of type `\@TDefPar.MyRecordType'
5043 <END_RESULT>
5044 <RESULT COUNT 19>
5045 (?is)\berror:
5046 <END_RESULT>
5047 <END_TC>
5048 :exmp.
5049
5050 *---------------------------------------------------------------------*
5051 :h3.Adhoc:: __SCOPE__ macro
5052 .*---------------------------------------------------------------------*
5053 :xmp tab=0.
5054 <TC - __SCOPE__ macro>
5055 <COMPILE>
5056 <VERDICT_LEAF PASS>
5057 <MODULE TTCN TDefPar TDefPar.ttcn>
5058 module TDefPar {
5059 // Negative tests for __SCOPE__ macro.
5060
5061 type enumerated Dummy { Dummy1, Dummy2 };
5062
5063 type record MyRecord {
5064 charstring field1,
5065 charstring field2 (__SCOPE__) optional
5066 };
5067
5068 type record MyRecord2 {
5069 MyRecord field1,
5070 charstring field2 (__SCOPE__)
5071 };
5072
5073
5074 template MyRecord t_MyTemplate := {
5075 field1 := __SCOPE__,
5076 //field2 := __SCOPE__ //NOK MyRecord not equal with t_MyTemplate
5077 field2 := "MyRecord"
5078 }
5079
5080 template MyRecord2 t_MyTemplate2 := {
5081 field1 := {
5082 field1 := __SCOPE__,
5083 field2 := __SCOPE__
5084 },
5085 field2 := __SCOPE__
5086 }
5087
5088 }
5089 <END_MODULE>
5090 <RESULT COUNT 1>
5091 (?is)\berror: "t_MyTemplate2" is not a valid value for type `charstring' which has subtype \("MyRecord"\)
5092 <END_RESULT>
5093 <RESULT COUNT 1>
5094 (?is)\berror: "t_MyTemplate2" is not a valid value for type `charstring' which has subtype \("MyRecord2"\)
5095 <END_RESULT>
5096 <END_TC>
5097 :exmp.
5098
5099 *---------------------------------------------------------------------*
5100 :h3.Adhoc:: public/private/friend
5101 .*---------------------------------------------------------------------*
5102 :xmp tab=0.
5103 <TC - public/private/friend>
5104 <COMPILE>
5105 <VERDICT_LEAF PASS>
5106 <MODULE TTCN module1 module1.ttcn>
5107 module module1
5108 {
5109
5110 public modulepar charstring ts_m1:="public";
5111 private modulepar charstring ts_m2:="private";
5112 friend modulepar charstring ts_m3:="friend";
5113
5114 friend module module2;
5115
5116 private import from module2 all;//OK
5117 private import from module3 all;//OK
5118 private import from module4 all;//OK
5119
5120 const module2Type akarmi1 := 1; //OK, type is implicitly public
5121 const module2TypePublic akarmi2 := 2; //OK, type is explicitly public
5122 const module2TypeFriend akarmi3 := 3; //OK, module1 is friend of module2
5123 const module2TypePrivate akarmi4 := 4; //NOK, module2TypePrivate is private to module2
5124
5125 group g_MyGroup{
5126 const module3Type akarmi5 := 5; //OK, type is implicitly public
5127 const module3TypePublic akarmi6 := 6; //OK, type is explicitly public
5128 const module3TypeFriend akarmi7 := 7; //NOK, module1 is NOT a friend of module3
5129 const module3TypePrivate akarmi8 := 8; //NOK, module2TypePrivate is private to module2
5130 }
5131
5132 function MyFunc1() runs on Lib4_CT {} //OK
5133 function MyFunc2() runs on Lib4Friend_CT {} //OK, module1 is friend for module4
5134 function MyFunc3() runs on Lib4Private_CT {} //NOK, the *name* Lib4Private_CT is not visible for module1, thus fails at checking the runs on clause, whatever is the content!
5135
5136
5137 function f_set2_Lib4_1() runs on Lib4_CT { v_Lib4_1 := 0 } //OK
5138 function f_set2_Lib4_2() runs on Lib4_CT { v_Lib4_2 := 0 } //OK
5139 function f_set2_Lib4_3() runs on Lib4_CT { v_Lib4_3 := 0 } //OK
5140 function f_set2_Lib4Friend_1() runs on Lib4Friend_CT { v_Lib4Friend_1 := 0 } //OK
5141 function f_set2_Lib4Friend_2() runs on Lib4Friend_CT { v_Lib4Friend_2 := 0 } //OK
5142 function f_set2_Lib4Friend_3() runs on Lib4Friend_CT { v_Lib4Friend_3 := 0 } //OK
5143
5144
5145 type component User_CT extends Lib4_CT {};
5146 function f_set3_Lib4_1() runs on User_CT { v_Lib4_1 := 0 } //OK
5147 function f_set3_Lib4_2() runs on User_CT { v_Lib4_2 := 0 } //OK
5148 function f_set3_Lib4_3() runs on User_CT { v_Lib4_3 := 0 } //NOK, v_Lib4_3 is private, can be used in functions with "Lib4_CT" in their runs on (but not in children)
5149
5150 //in short: visibility of the component type definition (name) and allowed use of the component
5151 //type definitions are two different things. Component type visibility is checked when checking
5152 //the runs on clause. Component definition visibility is checked (after a successful runs on
5153 //check), when the definition is used within the body of the function
5154
5155
5156 //All setter functions of module4 are public, hence can be called from any function
5157 //with a compatible runs on clause
5158 function f_MyFunc_1() runs on User_CT { f_set_Lib4_1() } //OK
5159 function f_MyFunc_2() runs on User_CT { f_set_Lib4_2() } //OK
5160 function f_MyFunc_3() runs on User_CT { f_set_Lib4_3() } //OK
5161
5162 type component UserFriend_CT extends Lib4Friend_CT {}; //OK
5163 function f_MyFuncFriend_1() runs on UserFriend_CT { f_set_Lib4Friend_1() } //OK
5164 function f_MyFuncFriend_2() runs on UserFriend_CT { f_set_Lib4Friend_2() } //OK
5165 function f_MyFuncFriend_3() runs on UserFriend_CT { f_set_Lib4Friend_3() } //OK
5166
5167
5168 type component UserPrivate_CT extends Lib4Private_CT {}; //NOK, the name Lib4Private_CT is not visible in module1
5169 function f_MyFuncPrivate_1() runs on UserPrivate_CT { f_set_Lib4Private_1() } //NOK, UserPrivate_CT has an error
5170 function f_MyFuncPrivate_2() runs on UserPrivate_CT { f_set_Lib4Private_2() } //NOK, UserPrivate_CT has an error
5171 function f_MyFuncPrivate_3() runs on UserPrivate_CT { f_set_Lib4Private_3() } //NOK, UserPrivate_CT has an error
5172
5173 control {
5174 var Lib4Private_CT v_Lib4Private := Lib4Private_CT.create; // NOK, the name Lib4Privae_CT is not visible in module1
5175 }
5176
5177 } // end of module1
5178
5179 <END_MODULE>
5180 <MODULE TTCN module2 module2.ttcn>
5181 module module2
5182 {
5183 friend module module1;
5184 public group g_Group1{
5185 type integer module2Type;
5186 public type integer module2TypePublic;
5187 friend type integer module2TypeFriend;
5188 private type integer module2TypePrivate;
5189 }
5190
5191 /*private*/ group g_Group2{
5192 type integer module2Type2;
5193 public type integer module2TypePublic2;
5194 friend type integer module2TypeFriend2;
5195 private type integer module2TypePrivate2;
5196 }
5197
5198 /*friend*/ group g_Group3{
5199 type integer module2Type3;
5200 public type integer module2TypePublic3;
5201 friend type integer module2TypeFriend3;
5202 private type integer module2TypePrivate3;
5203 }
5204
5205 } // end of module2
5206
5207 <END_MODULE>
5208 <MODULE TTCN module3 module3.ttcn>
5209 module module3
5210 {
5211 type integer module3Type;
5212 public type integer module3TypePublic;
5213 friend type integer module3TypeFriend;
5214 private type integer module3TypePrivate;
5215
5216 public type port pPublic message { inout charstring; } with {extension "internal"}
5217 private type port pPrivate message { inout charstring; } with {extension "internal"}
5218 friend type port pFriend message { inout charstring; } with {extension "internal"}
5219 } // end of module3
5220
5221 <END_MODULE>
5222 <MODULE TTCN module4 module4.ttcn>
5223 module module4
5224 {
5225 friend module module1;
5226
5227 type component Lib4_CT {
5228 var integer v_Lib4_1;
5229 public var integer v_Lib4_2;
5230 private var integer v_Lib4_3;
5231 }
5232 friend type component Lib4Friend_CT {
5233 var integer v_Lib4Friend_1;
5234 public var integer v_Lib4Friend_2;
5235 private var integer v_Lib4Friend_3;
5236 }
5237 private type component Lib4Private_CT {
5238 var integer v_Lib4Private_1;
5239 public var integer v_Lib4Private_2;
5240 private var integer v_Lib4Private_3;
5241 }
5242
5243 function f_set_Lib4_1() runs on Lib4_CT { v_Lib4_1 := 0 } //OK
5244 function f_set_Lib4_2() runs on Lib4_CT { v_Lib4_2 := 0 } //OK
5245 function f_set_Lib4_3() runs on Lib4_CT { v_Lib4_3 := 0 } //OK
5246 function f_set_Lib4Friend_1() runs on Lib4Friend_CT { v_Lib4Friend_1 := 0 } //OK
5247 function f_set_Lib4Friend_2() runs on Lib4Friend_CT { v_Lib4Friend_2 := 0 } //OK
5248 function f_set_Lib4Friend_3() runs on Lib4Friend_CT { v_Lib4Friend_3 := 0 } //OK
5249
5250 //These functions cannot be called or started outside module4, though they are public!
5251 //See module1
5252 function f_set_Lib4Private_1() runs on Lib4Private_CT { v_Lib4Private_1 := 0 } //OK
5253 function f_set_Lib4Private_2() runs on Lib4Private_CT { v_Lib4Private_2 := 0 } //OK
5254 function f_set_Lib4Private_3() runs on Lib4Private_CT { v_Lib4Private_3 := 0 } //OK
5255 } // end of module4
5256
5257 <END_MODULE>
5258 <MODULE TTCN module5 module5.ttcn>
5259 module module5
5260 {
5261 /*public*/ import from module2 all;//NOK no public import
5262 }
5263 <END_MODULE>
5264 <MODULE TTCN module6 module6.ttcn>
5265 module module6
5266 {
5267 /*friend*/ import from module2 all;//NOK no friend import
5268 }
5269 <END_MODULE>
5270
5271 <RESULT COUNT 1>
5272 (?is)\berror: There is no local or imported definition with name `module2TypePrivate'
5273 <END_RESULT>
5274 <RESULT COUNT 1>
5275 (?is)\berror: There is no local or imported definition with name `module3TypeFriend'
5276 <END_RESULT>
5277 <RESULT COUNT 1>
5278 (?is)\berror: There is no local or imported definition with name `module3TypePrivate'
5279 <END_RESULT>
5280 <RESULT COUNT 4>
5281 (?is)\berror: There is no local or imported definition with name `Lib4Private_CT'
5282 <END_RESULT>
5283 <RESULT COUNT 1>
5284 (?is)\berror: The member definition `v_Lib4_3' in component type `User_CT' is not visible in this scope
5285 <END_RESULT>
5286 <RESULT COUNT 1>
5287 (?is)\berror: Runs on clause mismatch: A definition that runs on component type `@module1.UserPrivate_CT' cannot call function `@module4.f_set_Lib4Private_1', which runs on `@module4.Lib4Private_CT'
5288 <END_RESULT>
5289 <RESULT COUNT 1>
5290 (?is)\berror: Runs on clause mismatch: A definition that runs on component type `@module1.UserPrivate_CT' cannot call function `@module4.f_set_Lib4Private_2', which runs on `@module4.Lib4Private_CT'
5291 <END_RESULT>
5292 <RESULT COUNT 1>
5293 (?is)\berror: Runs on clause mismatch: A definition that runs on component type `@module1.UserPrivate_CT' cannot call function `@module4.f_set_Lib4Private_3', which runs on `@module4.Lib4Private_CT'
5294 <END_RESULT>
5295 <RESULT COUNT 1>
5296 (?is)\berror: Operation `create()' is not allowed in control part
5297 <ENd RESULT>
5298 <END_TC>
5299 :exmp.
5300
5301 *---------------------------------------------------------------------*
5302 :h3.Adhoc:: Subtyping - Verdicts
5303 .*---------------------------------------------------------------------*
5304 :xmp tab=0.
5305 <TC - Subtyping - Verdicts>
5306 <COMPILE>
5307 <VERDICT_LEAF PASS>
5308 <MODULE TTCN module1 module1.ttcn>
5309 module module1
5310 {
5311 type verdicttype myv1 (pass, fail, none)
5312 type myv1 myv2 (inconc)
5313 // No error for disjunct types.
5314 type verdicttype myv3 (myv1, myv2)
5315 type myv3 myv4 (myv3, myv3, myv3)
5316 const myv1 c_myv1 := inconc
5317 const myv2 c_myv2 := c_myv1
5318 template myv1 t_myv1 := inconc
5319 template myv2 t_myv2 := t_myv1
5320 template myv1 t_myv3 := (inconc)
5321
5322 modulepar myv1 mp1 := inconc
5323
5324 function fv1() return myv1 { return inconc }
5325 function fv2(in myv1 p1 := inconc) { }
5326
5327 control {
5328 var template myv1 vt_myv1 := inconc
5329 var template myv1 vt_myv2 := t_myv2
5330 var template myv2 vt_myv3 := fv1() // No error.
5331 var myv1 v_myv1 := inconc
5332 var myv1 v_myv2 := valueof(t_myv2)
5333 var myv2 v_myv3 := fv1()
5334 }
5335 }
5336 <END_MODULE>
5337 <RESULT COUNT 8>
5338 (?is)\berror: inconc is not a valid value for type `verdicttype' which has subtype \(none,pass,fail\)
5339 <END_RESULT>
5340 <RESULT COUNT 1>
5341 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(inconc\) is not subset of subtype \(none,pass,fail\)
5342 <END_RESULT>
5343 <RESULT COUNT 9>
5344 (?is)\berror:
5345 <END_RESULT>
5346 <END_TC>
5347 :exmp.
5348
5349 *---------------------------------------------------------------------*
5350 :h3.Adhoc:: Subtyping - Booleans
5351 .*---------------------------------------------------------------------*
5352 :xmp tab=0.
5353 <TC - Subtyping - Booleans>
5354 <COMPILE>
5355 <VERDICT_LEAF PASS>
5356 <MODULE TTCN module1 module1.ttcn>
5357 module module1
5358 {
5359 type boolean myb1 (true)
5360 type myb1 myb2 (false)
5361 type boolean myb3 (myb1, myb2)
5362 const myb1 c_myb1 := false
5363 const myb2 c_myb2 := c_myb1
5364 template myb1 t_myb1 := false
5365 template myb2 t_myb2 := t_myb1
5366 template myb1 t_myb3 := (false)
5367
5368 modulepar myb1 mp1 := false
5369
5370 function fb1() return myb1 { return false }
5371 function fb2(in myb1 p1 := false) { }
5372
5373 control {
5374 var template myb1 vt_myb1 := false
5375 var template myb1 vt_myb2 := t_myb2
5376 var template myb2 vt_myb3 := fb1()
5377 var myb1 v_myb1 := false
5378 var myb1 v_myb2 := valueof(t_myb2)
5379 var myb2 v_myb3 := fb1()
5380 }
5381 }
5382 <END_MODULE>
5383 <RESULT COUNT 8>
5384 (?is)\berror: false is not a valid value for type `boolean' which has subtype \(true\)
5385 <END_RESULT>
5386 <RESULT COUNT 1>
5387 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(false\) is not subset of subtype \(true\)
5388 <END_RESULT>
5389 <RESULT COUNT 9>
5390 (?is)\berror:
5391 <END_RESULT>
5392 <END_TC>
5393 :exmp.
5394
5395 *---------------------------------------------------------------------*
5396 :h3.Adhoc:: Subtyping - Integers
5397 .*---------------------------------------------------------------------*
5398 :xmp tab=0.
5399 <TC - Subtyping - Integers>
5400 <COMPILE>
5401 <VERDICT_LEAF PASS>
5402 <MODULE TTCN module1 module1.ttcn>
5403 module module1
5404 {
5405 type integer myi1 (1, 2, 3)
5406 type myi1 myi2 (4)
5407 type myi1 myi3 (4..8)
5408 type myi1 myi4 (4..8, 16)
5409 type integer myi5 (myi1, myi2)
5410 type integer myi6 (1, 2, myi7)
5411 type integer myi7 (myi6, 1, 2)
5412 type integer myi8 (myi1, 99, 101)
5413
5414 const myi1 c_myi1 := 4
5415 const myi2 c_myi2 := c_myi1
5416 const myi8 c_myi3 := 100
5417
5418 template myi1 t_myi1 := 4
5419 template myi2 t_myi2 := t_myi1
5420 template myi1 t_myi3 := (4)
5421 template myi8 t_myi4 := c_myi3
5422
5423 modulepar myi1 mp1 := 4
5424 modulepar myi5 mp2 := 32 // No error.
5425
5426 function fi1() return myi1 { return 4 }
5427 function fi2(in myi1 p1 := 4) { }
5428
5429 control {
5430 var template myi1 vt_myi1 := 4
5431 var template myi1 vt_myi2 := t_myi2
5432 var template myi2 vt_myi3 := fi1()
5433 var template myi8 vt_myi4 := 100
5434 var myi1 v_myi1 := 4
5435 // It seems, that no additional error is reported here.
5436 var myi1 v_myi2 := valueof(t_myi2)
5437 var myi2 v_myi3 := fi1()
5438 var myi8 v_myi4 := 100
5439 }
5440 }
5441 <END_MODULE>
5442 <RESULT COUNT 4>
5443 (?is)\berror: 100 is not a valid value for type `integer' which has subtype \(1..3,99,101\)
5444 <END_RESULT>
5445 <RESULT COUNT 8>
5446 (?is)\berror: 4 is not a valid value for type `integer' which has subtype \(1..3\)
5447 <END_RESULT>
5448 <RESULT COUNT 1>
5449 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(4\) is not subset of subtype \(1..3\)
5450 <END_RESULT>
5451 <RESULT COUNT 1>
5452 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(4..8\) is not subset of subtype \(1..3\)
5453 <END_RESULT>
5454 <RESULT COUNT 1>
5455 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(4..8,16\) is not subset of subtype \(1..3\)
5456 <END_RESULT>
5457 <RESULT COUNT 1>
5458 (?is)\berror: While checking circular type references in subtype definitions: Circular reference: `\@module1.myi6' -> `\@module1.myi7' -> `\@module1.myi6'
5459 <END_RESULT>
5460 <RESULT COUNT 16>
5461 (?is)\berror:
5462 <END_RESULT>
5463 <END_TC>
5464 :exmp.
5465
5466 *---------------------------------------------------------------------*
5467 :h3.Adhoc:: Subtyping - Floats
5468 .*---------------------------------------------------------------------*
5469 :xmp tab=0.
5470 <TC - Subtyping - Floats>
5471 <COMPILE>
5472 <VERDICT_LEAF PASS>
5473 <MODULE TTCN module1 module1.ttcn>
5474 module module1
5475 {
5476 type float myf1 (1.0, 2.0, 3.0)
5477 type myf1 myf2 (4.0)
5478 type myf1 myf3 (4.0..8.0)
5479 type myf1 myf4 (4.0..8.0, 16.0)
5480 type float myf5 (myf1, myf2)
5481
5482 const myf1 c_myf1 := 4.0
5483 const myf2 c_myf2 := c_myf1
5484
5485 template myf1 t_myf1 := 4.0
5486 template myf2 t_myf2 := t_myf1
5487 template myf1 t_myf3 := (4.0)
5488
5489 modulepar myf1 mp1 := 4.0
5490 modulepar myf5 mp2 := 32.0 // No error.
5491
5492 function ff1() return myf1 { return 4.0 }
5493 function ff2(in myf1 p1 := 4.0) { }
5494
5495 control {
5496 var template myf1 vt_myf1 := 4.0
5497 var template myf1 vt_myf2 := t_myf2
5498 var template myf2 vt_myf3 := ff1()
5499 var myf1 v_myf1 := 4.0
5500 var myf1 v_myf2 := valueof(t_myf2)
5501 var myf2 v_myf3 := ff1()
5502 }
5503 }
5504 <END_MODULE>
5505 <RESULT COUNT 8>
5506 (?is)\berror: 4.0e0 is not a valid value for type `float' which has subtype \(1.0e0,2.0e0,3.0e0\)
5507 <END_RESULT>
5508 <RESULT COUNT 1>
5509 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(4.0e0\) is not subset of subtype \(1.0e0,2.0e0,3.0e0\)
5510 <END_RESULT>
5511 <RESULT COUNT 1>
5512 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(4.0e0..8.0e0\) is not subset of subtype \(1.0e0,2.0e0,3.0e0\)
5513 <END_RESULT>
5514 <RESULT COUNT 1>
5515 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(4.0e0..8.0e0,1.6e1\) is not subset of subtype \(1.0e0,2.0e0,3.0e0\)
5516 <END_RESULT>
5517 <RESULT COUNT 11>
5518 (?is)\berror:
5519 <END_RESULT>
5520 <END_TC>
5521 :exmp.
5522
5523 *---------------------------------------------------------------------*
5524 :h3.Adhoc:: Subtyping - Charstrings
5525 .*---------------------------------------------------------------------*
5526 :xmp tab=0.
5527 <TC - Subtyping - Charstrings>
5528 <COMPILE>
5529 <VERDICT_LEAF PASS>
5530 <MODULE TTCN module1 module1.ttcn>
5531 module module1
5532 {
5533 type charstring myc1 ("ich", "du", "er")
5534 type charstring myc2 length(1)
5535 type myc1 myc3 length(1)
5536 type myc1 myc4 ("a".."z") // No error message.
5537 type myc1 myc5 ("a".."z", "sie")
5538 type charstring myc6 (myc1, myc2)
5539 type myc1 myc7 (pattern "itstoolong")
5540 type myc1 myc8 (pattern "i*h")
5541
5542 const myc1 c_myc1 := "sie"
5543 const myc2 c_myc2 := "sie"
5544 const myc8 c_myc3 := "ich"
5545
5546 template myc1 t_myc1 := "sie"
5547 template myc2 t_myc2 := "sie"
5548 template myc2 t_myc3 := t_myc1
5549 template myc1 t_myc4 := ("sie")
5550
5551 function fc1() return myc1 { return "sie" }
5552 function fc2(in myc1 p1 := "sie") { }
5553
5554 control {
5555 var template myc1 vt_myc1 := "sie"
5556 var template myc2 vt_myc2 := "sie"
5557 var template myc2 vt_myc3 := fc1()
5558 var myc1 v_myc1 := "sie"
5559 // Additional `(' characters in the error message.
5560 var myc2 v_myc2 := "sie"
5561 var myc2 v_myc3 := fc1()
5562 }
5563 }
5564 <END_MODULE>
5565 <RESULT COUNT 1>
5566 (?is)\berror: Mixing of value list and range subtyping is not allowed for type `charstring'
5567 <END_RESULT>
5568 <RESULT COUNT 7>
5569 (?is)\berror: "sie" is not a valid value for type `charstring' which has subtype \("du","er","ich"\)
5570 <END_RESULT>
5571 <RESULT COUNT 4>
5572 (?is)\berror: "sie" is not a valid value for type `charstring' which has subtype length\(1\)
5573 <END_RESULT>
5574 <RESULT COUNT 2>
5575 (?is)\berror: The subtype is an empty set
5576 <END_RESULT>
5577 <RESULT COUNT 3>
5578 (?is)\berror: Subtype mismatch: subtype length\(1\) has no common value with subtype \("du","er","ich"\)
5579 <END_RESULT>
5580 <RESULT COUNT 17>
5581 (?is)\berror:
5582 <END_RESULT>
5583 <END_TC>
5584 :exmp.
5585
5586 *---------------------------------------------------------------------*
5587 :h3.Adhoc:: Subtyping - Universal Charstrings
5588 .*---------------------------------------------------------------------*
5589 :xmp tab=0.
5590 <TC - Subtyping - Universal Charstrings>
5591 <COMPILE>
5592 <VERDICT_LEAF PASS>
5593 <MODULE TTCN module1 module1.ttcn>
5594 module module1
5595 {
5596 type universal charstring myu1 (char(0, 0, 0, 0), char(0, 0, 0, 1))
5597 type universal charstring myu2 length(1)
5598 type myu1 myu3 length(2)
5599 type universal charstring myu4 (myu1, myu2)
5600 type universal charstring myu5 (pattern "abc?\q{0, 0, 1, 113}")
5601 const myu1 c_myu1 := char(0, 0, 1, 0)
5602 const myu2 c_myu2 := char(0, 0, 1, 0) & char(0, 0, 1, 0)
5603 template myu1 t_myu1 := char(0, 0, 1, 0)
5604 template myu2 t_myu2 := char(0, 0, 1, 0) & char(0, 0, 1, 0)
5605 template myu2 t_myu3 := t_myu1
5606 template myu1 t_myu4 := (char(0, 0, 1, 0))
5607
5608 function fu1() return myu1 { return char(0, 0, 1, 0) & char(0, 0, 1, 0) }
5609 function fu2(in myu1 p1 := char(0, 0, 1, 0) & char(0, 0, 1, 0)) { }
5610
5611 control {
5612 var template myu1 vt_myu1 := char(0, 0, 1, 0)
5613 var template myu2 vt_myu2 := char(0, 0, 1, 0) & char(0, 0, 1, 0)
5614 var template myu2 vt_myu3 := fu1()
5615 var myu1 v_myu1 := char(0, 0, 1, 0)
5616 var myu2 v_myu2 := char(0, 0, 1, 0) & char(0, 0, 1, 0)
5617 var myu2 v_myu3 := fu1()
5618 }
5619 }
5620 <END_MODULE>
5621 <RESULT COUNT 5>
5622 (?is)\berror: char\(0, 0, 1, 0\) is not a valid value for type `universal charstring' which has subtype \(char\(0, 0, 0, 0\),char\(0, 0, 0, 1\)\)
5623 <END_RESULT>
5624 <RESULT COUNT 4>
5625 (?is)\berror: char\(0, 0, 1, 0\) & char\(0, 0, 1, 0\) is not a valid value for type `universal charstring' which has subtype length\(1\)
5626 <END_RESULT>
5627 <RESULT COUNT 2>
5628 (?is)\berror: char\(0, 0, 1, 0\) & char\(0, 0, 1, 0\) is not a valid value for type `universal charstring' which has subtype \(char\(0, 0, 0, 0\),char\(0, 0, 0, 1\)\)
5629 <END_RESULT>
5630 <RESULT COUNT 1>
5631 (?is)\berror: The subtype is an empty set
5632 <END_RESULT>
5633 <RESULT COUNT 12>
5634 (?is)\berror:
5635 <END_RESULT>
5636 <END_TC>
5637 :exmp.
5638
5639 *---------------------------------------------------------------------*
5640 :h3.Adhoc:: Subtyping - Bitstrings
5641 .*---------------------------------------------------------------------*
5642 :xmp tab=0.
5643 <TC - Subtyping - Bitstrings>
5644 <COMPILE>
5645 <VERDICT_LEAF PASS>
5646 <MODULE TTCN module1 module1.ttcn>
5647 module module1
5648 {
5649 type bitstring myb1 ('00'B, '01'B)
5650 type bitstring myb2 length(1)
5651 // The consistent `The subtype is an empty set' error message may be better.
5652 type myb1 myb3 length(1)
5653 type bitstring myb4 (myb1, myb2)
5654 const myb1 c_myb1 := '10'B
5655 const myb2 c_myb2 := '10'B
5656 template myb1 t_myb1 := '10'B
5657 template myb2 t_myb2 := '10'B
5658 template myb2 t_myb3 := t_myb1
5659 template myb1 t_myb4 := ('10'B)
5660
5661 function fb1() return myb1 { return '10'B }
5662 function fb2(in myb1 p1 := '00'B) { }
5663
5664 control {
5665 var template myb1 vt_myb1 := '10'B
5666 var template myb2 vt_myb2 := '10'B
5667 // It's not yet checked.
5668 var template myb2 vt_myb3 := fb1()
5669 var myb1 v_myb1 := '10'B
5670 var myb2 v_myb2 := '10'B
5671 var myb2 v_myb3 := fb1()
5672 }
5673 }
5674 <END_MODULE>
5675 <RESULT COUNT 6>
5676 (?is)\berror: '10'B is not a valid value for type `bitstring' which has subtype \('00'B,'01'B\)
5677 <END_RESULT>
5678 <RESULT COUNT 4>
5679 (?is)\berror: '10'B is not a valid value for type `bitstring' which has subtype length\(1\)
5680 <END_RESULT>
5681 <RESULT COUNT 1>
5682 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype length\(1\) is not subset of subtype \('00'B,'01'B\)
5683 <END_RESULT>
5684 <RESULT COUNT 3>
5685 (?is)\berror: Subtype mismatch: subtype length\(1\) has no common value with subtype \('00'B,'01'B\)
5686 <END_RESULT>
5687 <RESULT COUNT 14>
5688 (?is)\berror:
5689 <END_RESULT>
5690 <END_TC>
5691 :exmp.
5692
5693 *---------------------------------------------------------------------*
5694 :h3.Adhoc:: Subtyping - Hexstrings
5695 .*---------------------------------------------------------------------*
5696 :xmp tab=0.
5697 <TC - Subtyping - Hexstrings>
5698 <COMPILE>
5699 <VERDICT_LEAF PASS>
5700 <MODULE TTCN module1 module1.ttcn>
5701 module module1
5702 {
5703 type hexstring myh1 ('00'H, '01'H)
5704 type hexstring myh2 length(1)
5705 type myh1 myh3 length(1)
5706 type hexstring myh4 (myh1, myh2)
5707 const myh1 c_myh1 := '10'H
5708 const myh2 c_myh2 := '10'H
5709 template myh1 t_myh1 := '10'H
5710 template myh2 t_myh2 := '10'H
5711 template myh2 t_myh3 := t_myh1
5712 template myh1 t_myh4 := ('10'H)
5713
5714 function fh1() return myh1 { return '00'H }
5715 function fh2(in myh1 p1 := '00'H) { }
5716
5717 control {
5718 var template myh1 vt_myh1 := '10'H
5719 var template myh2 vt_myh2 := '10'H
5720 var template myh2 vt_myh3 := fh1()
5721 var myh1 v_myh1 := '10'H
5722 var myh2 v_myh2 := '10'H
5723 var myh2 v_myh3 := fh1()
5724 }
5725 }
5726 <END_MODULE>
5727 <RESULT COUNT 5>
5728 (?is)\berror: '10'H is not a valid value for type `hexstring' which has subtype \('00'H,'01'H\)
5729 <END_RESULT>
5730 <RESULT COUNT 4>
5731 (?is)\berror: '10'H is not a valid value for type `hexstring' which has subtype length\(1\)
5732 <END_RESULT>
5733 <RESULT COUNT 1>
5734 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype length\(1\) is not subset of subtype \('00'H,'01'H\)
5735 <END_RESULT>
5736 <RESULT COUNT 3>
5737 (?is)\berror: Subtype mismatch: subtype length\(1\) has no common value with subtype \('00'H,'01'H\)
5738 <END_RESULT>
5739 <RESULT COUNT 13>
5740 (?is)\berror:
5741 <END_RESULT>
5742 <END_TC>
5743 :exmp.
5744
5745 *---------------------------------------------------------------------*
5746 :h3.Adhoc:: Subtyping - Octetstrings
5747 .*---------------------------------------------------------------------*
5748 :xmp tab=0.
5749 <TC - Subtyping - Octetstrings>
5750 <COMPILE>
5751 <VERDICT_LEAF PASS>
5752 <MODULE TTCN module1 module1.ttcn>
5753 module module1
5754 {
5755 type octetstring myo1 ('00'O, '01'O)
5756 type octetstring myo2 length(1)
5757 type myo1 myo3 length(2)
5758 type octetstring myo4 (myo1, myo2)
5759 const myo1 c_myo1 := '10'O
5760 const myo2 c_myo2 := '1010'O
5761 const myo3 c_myo3 := '10'O
5762 template myo1 t_myo1 := '10'O
5763 template myo2 t_myo2 := '1010'O
5764 template myo2 t_myo3 := t_myo1
5765 template myo1 t_myo4 := ('10'O)
5766 template myo3 t_myo5 := '10'O
5767
5768 function fo1() return myo1 { return '1010'O }
5769 function fo2(in myo1 p1 := '1010'O) { }
5770
5771 control {
5772 var template myo1 vt_myo1 := '10'O
5773 var template myo2 vt_myo2 := '1010'O
5774 var template myo3 vt_myo3 := '10'O
5775 var template myo1 vt_myo4 := fo1()
5776 var myo1 v_myo1 := '10'O
5777 var myo2 v_myo2 := '1010'O
5778 var myo3 v_myo3 := '10'O
5779 var myo1 v_myo4 := fo1()
5780 }
5781 }
5782 <END_MODULE>
5783 <RESULT COUNT 5>
5784 (?is)\berror: '10'O is not a valid value for type `octetstring' which has subtype \('00'O,'01'O\)
5785 <END_RESULT>
5786 <RESULT COUNT 4>
5787 (?is)\berror: '1010'O is not a valid value for type `octetstring' which has subtype length\(1\)
5788 <END_RESULT>
5789 <RESULT COUNT 1>
5790 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype length\(2\) is not subset of subtype \('00'O,'01'O\)
5791 <END_RESULT>
5792 <RESULT COUNT 2>
5793 (?is)\berror: '1010'O is not a valid value for type `octetstring' which has subtype \('00'O,'01'O\)
5794 <END_RESULT>
5795 <RESULT COUNT 12>
5796 (?is)\berror:
5797 <END_RESULT>
5798 <END_TC>
5799 :exmp.
5800
5801 *---------------------------------------------------------------------*
5802 :h3.Adhoc:: Subtyping - Objids
5803 .*---------------------------------------------------------------------*
5804 :xmp tab=0.
5805 <TC - Subtyping - Objids>
5806 <COMPILE>
5807 <VERDICT_LEAF PASS>
5808 <MODULE TTCN module1 module1.ttcn>
5809 module module1
5810 {
5811 type objid myo1 (objid{itu_t(0) identified_organization(4) etsi(0)})
5812 const myo1 c_myo1 := objid{0 0 0}
5813 template myo1 t_myo1 := objid{0 0 0}
5814
5815 control {
5816 var template myo1 vt_myo1 := objid{0 0 0}
5817 var myo1 v_myo1 := objid{0 0 0}
5818 }
5819 }
5820 <END_MODULE>
5821 <RESULT COUNT 4>
5822 (?is)\berror: objid \{ 0 0 0 \} is not a valid value for type `objid' which has subtype \(objid \{ 0 4 0 \}\)
5823 <END_RESULT>
5824 <END_TC>
5825 :exmp.
5826
5827 *---------------------------------------------------------------------*
5828 :h3.Adhoc:: Subtyping - Anytypes
5829 .*---------------------------------------------------------------------*
5830 :xmp tab=0.
5831 <TC - Subtyping - Anytypes>
5832 <COMPILE>
5833 <VERDICT_LEAF PASS>
5834 <MODULE TTCN module1 module1.ttcn>
5835 module module1
5836 {
5837 type anytype mya1 ({integer := 0})
5838 type anytype mya2
5839 type integer myint1 (1, 2, 3)
5840 type mya2.myint1 myint2 (1..2)
5841
5842 const mya1 c_mya1 := {integer := 1}
5843 const mya2.myint1 c_mya2 := 100
5844 const myint2 c_myi1 := 3
5845
5846 template mya1 t_mya1 := {integer := 1}
5847
5848 control {
5849 var template mya1 vt_mya1 := {integer := 1}
5850 var mya1 v_mya1 := {integer := 1}
5851 }
5852 } with { extension "anytype integer, myint1" }
5853 <END_MODULE>
5854 <RESULT COUNT 1>
5855 (?is)\berror: 3 is not a valid value for type `integer' which has subtype \(1..2\)
5856 <END_RESULT>
5857 <RESULT COUNT 2>
5858 (?is)\berror: \{ integer := 1 \} is not a valid value for type `\@module1.anytype' which has subtype \(\{ integer := 0 \}\)
5859 <END_RESULT>
5860 <RESULT COUNT 1>
5861 (?is)\berror: 100 is not a valid value for type `integer' which has subtype \(1..3\)
5862 <END_RESULT>
5863 <RESULT COUNT 4>
5864 (?is)\berror:
5865 <END_RESULT>
5866 <END_TC>
5867 :exmp.
5868
5869 *---------------------------------------------------------------------*
5870 :h3.Adhoc:: Subtyping - Unions
5871 .*---------------------------------------------------------------------*
5872 :xmp tab=0.
5873 <TC - Subtyping - Unions>
5874 <COMPILE>
5875 <VERDICT_LEAF PASS>
5876 <MODULE TTCN module1 module1.ttcn>
5877 module module1
5878 {
5879 type union myu1 {
5880 integer f1,
5881 charstring f2
5882 }
5883 type myu1 myu2 ({f1 := 0}, {f2 := ""})
5884 type myu1 myu3 ({f1 := 100}, {f1 := 200})
5885 type myu1 myu4 (myu3.interestingfieldreferencenotcheckedbutpossible)
5886 type myu1 myu5 (myu3, myu4)
5887
5888 const myu2 c_myu1 := {f1 := 1}
5889 const myu5 c_myu2 := {f1 := 1}
5890
5891 // Union subtypes are not checked for templates. We should expect 4 error
5892 // messages instead of 2. It should be fixed later. This applies for
5893 // record, set and union types as well.
5894 template myu2 t_myu1 := {f1 := 1}
5895 template myu5 t_myu2 := {f1 := valueof(t_myu1.f1)}
5896
5897 control {
5898 var template myu2 vt_myu1 := {f1 := 1}
5899 var template myu5 vt_myu2 := {f1 := vt_myu1.f1}
5900 var myu2 v_myu1 := {f1 := 1}
5901 var myu5 v_myu2 := {f1 := v_myu1.f1} // Check?
5902 }
5903 }
5904 <END_MODULE>
5905 <RESULT COUNT 2>
5906 (?is)\berror: \{ f1 := 1 \} is not a valid value for type `\@module1.myu1' which has subtype \(\{ f1 := 0 \},\{ f2 := "" \}\)
5907 <END_RESULT>
5908 <RESULT COUNT 1>
5909 (?is)\berror: Reference to non-existent field `interestingfieldreferencenotcheckedbutpossible' in type `\@module1.myu1'
5910 <END_RESULT>
5911 <RESULT COUNT 3>
5912 (?is)\berror:
5913 <END_RESULT>
5914 <END_TC>
5915 :exmp.
5916
5917 *---------------------------------------------------------------------*
5918 :h3.Adhoc:: Subtyping - Records
5919 .*---------------------------------------------------------------------*
5920 :xmp tab=0.
5921 <TC - Subtyping - Records>
5922 <COMPILE>
5923 <VERDICT_LEAF PASS>
5924 <MODULE TTCN module1 module1.ttcn>
5925 module module1
5926 {
5927 type record myr1 {
5928 integer f1,
5929 charstring f2
5930 }
5931 type integer myi1 (11, 22, 33)
5932 type myr1 myr2 ({0, ""}, {0, " "})
5933 type myr1 myr3 ({0.0, ""})
5934 type myr1 myr4 (myr1, myr3)
5935 type myr2 myr5 (myr2, myr2, {0, ""}, {0, ""})
5936 type record myr6 {
5937 integer f1 (1, 2, 3),
5938 charstring f2 length(3)
5939 }
5940
5941 // Only the constants are checked regarding subtypes.
5942 const myr2 c_myr1 := {1, ""}
5943 const myr4 c_myr2 := {1, ""}
5944
5945 template myr2 t_myr1 := {1, ""}
5946 template myr4 t_myr2 := {1, ""}
5947 template myr6 t_myr3(in myi1 p1) := {p1, "abc"}
5948
5949 function fr1() return myr2 { return {0, "1"} }
5950 function fr2(in myr2 p1 := {0, "1"}) { }
5951
5952 control {
5953 var template myr2 vt_myr1 := {1, ""}
5954 var template myr5 vt_myr2 := {1, "1"} // No error. Why?
5955 var myr2 v_myr1 := {1, ""}
5956 var myr5 v_myr2 := {1, "1"} // It's an error for all non-templates.
5957 var myr6 v_myr3 := {1, "abcdefghijk"}
5958 if (valueof(vt_myr1) == valueof(vt_myr2)) { }
5959 if (v_myr1 == v_myr2) { }
5960 }
5961 }
5962 <END_MODULE>
5963 <RESULT COUNT 1>
5964 (?is)\berror: integer value was expected
5965 <END_RESULT>
5966 <RESULT COUNT 1>
5967 (?is)\berror: Type referenced by `myr1' does not have a subtype
5968 <END_RESULT>
5969 <RESULT COUNT 1>
5970 (?is)\berror: \{ f1 := 1, f2 := "1" \} is not a valid value for type `\@module1.myr1' which has subtype \(\{ f1 := 0, f2 := "" \},\{ f1 := 0, f2 := " " \}\)
5971 <END_RESULT>
5972 <RESULT COUNT 2>
5973 (?is)\berror: \{ f1 := 1, f2 := "" \} is not a valid value for type `\@module1.myr1' which has subtype \(\{ f1 := 0, f2 := "" \},\{ f1 := 0, f2 := " " \}\)
5974 <END_RESULT>
5975 <RESULT COUNT 2>
5976 (?is)\berror: \{ f1 := 0, f2 := "1" \} is not a valid value for type `\@module1.myr1' which has subtype \(\{ f1 := 0, f2 := "" \},\{ f1 := 0, f2 := " " \}\)
5977 <END_RESULT>
5978 <RESULT COUNT 1>
5979 (?is)\berror: Subtype mismatch: subtype \(1..3\) has no common value with subtype \(11,22,33\)
5980 <END_RESULT>
5981 <RESULT COUNT 1>
5982 (?is)\berror: \"abcdefghijk\" is not a valid value for type `charstring' which has subtype length\(3\)
5983 <END_RESULT>
5984 <RESULT COUNT 9>
5985 (?is)\berror:
5986 <END_RESULT>
5987 <END_TC>
5988 :exmp.
5989
5990 *---------------------------------------------------------------------*
5991 :h3.Adhoc:: Subtyping - Sets
5992 .*---------------------------------------------------------------------*
5993 :xmp tab=0.
5994 <TC - Subtyping - Sets>
5995 <COMPILE>
5996 <VERDICT_LEAF PASS>
5997 <MODULE TTCN module1 module1.ttcn>
5998 module module1
5999 {
6000 type set mys1 {
6001 integer f1,
6002 charstring f2
6003 }
6004 type integer myi1 (11, 22, 33)
6005 type mys1 mys2 ({f1 := 0, f2 := ""}, {f1 := 0, f2 := " "})
6006 type set mys3 {
6007 integer f1 (1, 2, 3),
6008 charstring f2 length(3)
6009 }
6010 type mys1 myr4 (mys2)
6011 type mys2 mys5 (mys2, mys2, {f1 := 0, f2 := ""}, {f1 := 0, f2 := ""})
6012
6013 const mys2 c_mys1 := {f1 := 1, f2 := ""}
6014 const myr4 c_mys2 := {f1 := c_mys1.f1, f2 := c_mys1.f2}
6015 const mys5 c_mys3 := {f1 := 1, f2 := ""}
6016
6017 template mys2 t_mys1 := {f1 := 1, f2 := ""}
6018 template mys3 t_mys2(in myi1 p1) := {f1 := p1, f2 := "abc"}
6019 template mys3 t_mys3(in integer p1) modifies t_mys2 := {f1 := 100}
6020
6021 control {
6022 var template mys2 vt_mys1 := {f1 := 1, f2 := ""}
6023 var mys2 v_mys1 := {f1 := 1, f2 := ""}
6024 var mys3 v_mys2 := {f1 := 1, f2 := "itstoolong"}
6025 v_mys2.f1 := 100
6026 v_mys2.f2 := "itstoolong"
6027 // `if (v_mys1 == v_mys2) { }' should be an error in both runtimes.
6028 // Currently, there is no error from the function-test runtime.
6029 }
6030 }
6031 <END_MODULE>
6032 <RESULT COUNT 4>
6033 (?is)\berror: \{ f1 := 1, f2 := "" \} is not a valid value for type `\@module1.mys1' which has subtype \(\{ f1 := 0, f2 := "" \},\{ f1 := 0, f2 := " " \}\)
6034 <END_RESULT>
6035 <RESULT COUNT 1>
6036 (?is)\berror: Subtype mismatch: subtype \(1..3\) has no common value with subtype \(11,22,33\)
6037 <END_RESULT>
6038 <RESULT COUNT 2>
6039 (?is)\berror: \"itstoolong\" is not a valid value for type `charstring' which has subtype length\(3\)
6040 <END_RESULT>
6041 <RESULT COUNT 2>
6042 (?is)\berror: 100 is not a valid value for type `integer' which has subtype \(1..3\)
6043 <END_RESULT>
6044 <RESULT COUNT 9>
6045 (?is)\berror:
6046 <END_RESULT>
6047 <END_TC>
6048 :exmp.
6049
6050 *---------------------------------------------------------------------*
6051 :h3.Adhoc:: Subtyping - Recordofs
6052 .*---------------------------------------------------------------------*
6053 :xmp tab=0.
6054 <TC - Subtyping - Recordofs>
6055 <COMPILE>
6056 <VERDICT_LEAF PASS>
6057 <MODULE TTCN module1 module1.ttcn>
6058 module module1
6059 {
6060 type record length(1) of integer myro1
6061 type record length(4..8) of integer myro2
6062 type record length(5) of record length(5) of record length(5) of record length(5) of integer myro3
6063 type myro3 myro4 ({1}, {2})
6064 type myro1 myro5 (myro1, {1, 2})
6065 type myro1 myro6 (myro1, myro1, {1}, {1}, {2}, {2})
6066 type myro5 myro7 ({1}) // No error for erroneous parent type.
6067 type myro7 myro8 (myro2)
6068
6069 const myro1 c_myro1 := {0, 1}
6070 const myro2 c_myro2 := {0, 1}
6071 const myro6 c_myro3 := {c_myro1[0]}
6072
6073 template myro1 t_myro1 := {0, 1}
6074 template myro2 t_myro2 := {0, 1}
6075 template myro6 t_myro3 := {0}
6076
6077 modulepar myro1 mp1 := {0, 1}
6078 modulepar myro2 mp2 := {0, 1}
6079 modulepar myro6 mp3 := {}
6080
6081 function fro1() return myro1 { return {0, 1} }
6082 function fro2(in myro1 p1 := {0, 1}) { }
6083
6084 control {
6085 var template myro1 vt_myro1 := {0, 1}
6086 var template myro2 vt_myro2 := {0, 1}
6087 var myro1 v_myro1 := {0, 1}
6088 var myro2 v_myro2 := {0, 1}
6089 if (valueof(vt_myro1) == valueof(vt_myro2)) { }
6090 if (v_myro1 == v_myro2) { }
6091 if (match(fro1(), t_myro2)) { }
6092 }
6093 }
6094 <END_MODULE>
6095 <RESULT COUNT 1>
6096 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(\{ 1, 2 \}\) union length\(1\) is not subset of subtype length\(1\)
6097 <END_RESULT>
6098 <RESULT COUNT 2>
6099 (?is)\berror: There must not be more than 1 elements in the list
6100 <END_RESULT>
6101 <RESULT COUNT 5>
6102 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myro1' which has subtype length\(1\)
6103 <END_RESULT>
6104 <RESULT COUNT 3>
6105 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myro2' which has subtype length\(4..8\)
6106 <END_RESULT>
6107 <RESULT COUNT 2>
6108 (?is)\berror: At least 4 elements must be present in the list
6109 <END_RESULT>
6110 <RESULT COUNT 1>
6111 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(\{ <erroneous> \},\{ <erroneous> \}\) is not subset of subtype length\(5\)
6112 <END_RESULT>
6113 <RESULT COUNT 2>
6114 (?is)\berror: record of value was expected
6115 <END_RESULT>
6116 <RESULT COUNT 1>
6117 (?is)\berror: \{ \} is not a valid value for type `\@module1.myro1' which has subtype length\(1\)
6118 <END_RESULT>
6119 <RESULT LTRT COUNT 2>
6120 (?is)\berror: The operands of operation `==' should be of compatible types
6121 <END_RESULT>
6122 <RESULT LTRT COUNT 1>
6123 (?is)\berror: Type mismatch: a value or template of type `\@module1.myro1' was expected instead of `\@module1.myro2'
6124 <END_RESULT>
6125 <RESULT FTRT COUNT 3>
6126 (?is)\berror: Type mismatch: `\@module1.myro1' and `\@module1.myro2' are not compatible: Incompatible record of/SEQUENCE OF subtypes
6127 <END_RESULT>
6128 <RESULT COUNT 1>
6129 (?is)\berror: Reference `myro2' must refer to a type which has the same root type as this type
6130 <END_RESULT>
6131 <RESULT COUNT 21>
6132 (?is)\berror:
6133 <END_RESULT>
6134 <END_TC>
6135 :exmp.
6136
6137 *---------------------------------------------------------------------*
6138 :h3.Adhoc:: Subtyping - Setofs
6139 .*---------------------------------------------------------------------*
6140 :xmp tab=0.
6141 <TC - Subtyping - Setofs>
6142 <COMPILE>
6143 <VERDICT_LEAF PASS>
6144 <MODULE TTCN module1 module1.ttcn>
6145 module module1
6146 {
6147 type set length(1) of integer myso1
6148 type set length(4..8) of integer myso2
6149 type set of integer myso3 (myso1, myso2)
6150 type myso1 myso4 (myso1, {1, 2})
6151 type myso1 myso5 (myso1, myso1, {1}, {1}, {2}, {2})
6152 type myso4 myso6 ({1}) // No error for erroneous parent type.
6153 type myso6 myso7 (myso2)
6154
6155 template myso1 t_myso1 := {0, 1}
6156 template myso2 t_myso2 := {0, 1}
6157 template myso5 t_myso3 := {0}
6158
6159 const myso1 c_myso1 := {0, 1}
6160 const myso2 c_myso2 := {0, 1}
6161 const myso5 c_myso3 := {c_myso1[0]}
6162
6163 modulepar myso1 mp1 := {0, 1}
6164 modulepar myso2 mp2 := {0, 1}
6165 modulepar myso5 mp3 := {}
6166
6167 function fso1() return myso1 { return {0, 1} }
6168 function fso2(in myso1 p1 := {0, 1}) { }
6169
6170 control {
6171 var template myso1 vt_myso1 := {0, 1}
6172 var template myso2 vt_myso2 := {0, 1}
6173 var myso1 v_myso1 := {0, 1}
6174 var myso2 v_myso2 := {0, 1}
6175 if (valueof(vt_myso1) == valueof(vt_myso2)) { }
6176 if (v_myso1 == v_myso2) { }
6177 if (match(fso1(), t_myso2)) { }
6178 }
6179 }
6180 <END_MODULE>
6181 <RESULT COUNT 1>
6182 (?is)\berror: Reference `myso1' must refer to a type which has the same root type as this type
6183 <END_RESULT>
6184 <RESULT COUNT 2>
6185 (?is)\berror: Reference `myso2' must refer to a type which has the same root type as this type
6186 <END_RESULT>
6187 <RESULT COUNT 1>
6188 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(\{ 1, 2 \}\) union length\(1\) is not subset of subtype length\(1\)
6189 <END_RESULT>
6190 <RESULT COUNT 2>
6191 (?is)\berror: There must not be more than 1 elements in the list
6192 <END_RESULT>
6193 <RESULT COUNT 5>
6194 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myso1' which has subtype length\(1\)
6195 <END_RESULT>
6196 <RESULT COUNT 2>
6197 (?is)\berror: At least 4 elements must be present in the list
6198 <END_RESULT>
6199 <RESULT COUNT 3>
6200 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myso2' which has subtype length\(4..8\)
6201 <END_RESULT>
6202 <RESULT COUNT 1>
6203 (?is)\berror: \{ \} is not a valid value for type `\@module1.myso1' which has subtype length\(1\)
6204 <END_RESULT>
6205 <RESULT LTRT COUNT 2>
6206 (?is)\berror: The operands of operation `==' should be of compatible types
6207 <END_RESULT>
6208 <RESULT LTRT COUNT 1>
6209 (?is)\berror: Type mismatch: a value or template of type `\@module1.myso1' was expected instead of `\@module1.myso2'
6210 <END_RESULT>
6211 <RESULT FTRT COUNT 3>
6212 (?is)\berror: Type mismatch: `\@module1.myso1' and `\@module1.myso2' are not compatible: Incompatible set of/SET OF subtypes
6213 <END_RESULT>
6214 <RESULT COUNT 20>
6215 (?is)\berror:
6216 <END_RESULT>
6217 <END_TC>
6218 :exmp.
6219
6220 *---------------------------------------------------------------------*
6221 :h3.Adhoc:: Subtyping - Arrays
6222 .*---------------------------------------------------------------------*
6223 :xmp tab=0.
6224 <TC - Subtyping - Arrays>
6225 <COMPILE>
6226 <VERDICT_LEAF PASS>
6227 <MODULE TTCN module1 module1.ttcn>
6228 module module1
6229 {
6230 // The length subtyping is not for `integer', it's an `integer[1]' array.
6231 type integer mya1[1] length(2)
6232 type mya1 mya2 (0, 1)
6233 type mya1 mya3 ({0, 1}, {2, 3})
6234 type mya3 mya4 (mya1, mya2, mya3)
6235
6236 template mya1 t_mya1 := {2}
6237 template mya3 t_mya2 := {2, 3}
6238
6239 const mya1 c_mya1 := {2}
6240 const mya3 c_mya2 := {c_mya1[0], 3}
6241 const mya1 c_mya3[1] := {c_mya1} // Shouldn't be allowed.
6242
6243 control {
6244 var template mya1 vt_mya1 := {2}
6245 var template mya3 vt_mya2 := {vt_mya1[0], 3}
6246 var template mya1 vt_mya3[1] := {vt_mya1} // Shouldn't be allowed.
6247 var mya1 v_mya1 := {2}
6248 var mya3 v_mya2 := {2, 3}
6249 var mya1 v_mya3[1] := {v_mya1} // Shouldn't be allowed.
6250 if (valueof(vt_mya1) == valueof(vt_mya2)) { }
6251 if (v_mya1 == v_mya2) { }
6252 }
6253 }
6254 <END_MODULE>
6255 <RESULT COUNT 1>
6256 (?is)\berror: Length subtyping is not allowed for type `integer'
6257 <END_RESULT>
6258 <RESULT COUNT 3>
6259 (?is)\berror: Subtype constraints are not applicable to type `integer\[1\]'
6260 <END_RESULT>
6261 <RESULT COUNT 2>
6262 (?is)\berror: Too many elements in the array value: 1 was expected instead of 2
6263 <END_RESULT>
6264 <RESULT COUNT 8>
6265 (?is)\berror:
6266 <END_RESULT>
6267 <END_TC>
6268 :exmp.
6269
6270
6271 *---------------------------------------------------------------------*
6272 :h3.Adhoc:: Special float values
6273 .*---------------------------------------------------------------------*
6274 :xmp tab=0.
6275 <TC - Special float values>
6276 <COMPILE>
6277 <VERDICT_LEAF PASS>
6278 <MODULE TTCN module1 module1.ttcn>
6279 module module1
6280 {
6281 const float cf_pinf := infinity;
6282 const float cf_minf := -infinity;
6283 const float cf_nan := not_a_number;
6284
6285 type float MyFlt (-infinity..infinity);
6286 type float MyFlt2 (not_a_number);
6287
6288 control {
6289 var MyFlt vf1;
6290 var MyFlt2 vf2;
6291 vf1 := not_a_number;
6292 vf2 := 1.0;
6293 vf2 := vf1;
6294 }
6295 }
6296 <END_MODULE>
6297 <RESULT COUNT 1>
6298 (?is)\berror: NaN is not a valid value for type `float' which has subtype \(-INF..INF\)
6299 <END_RESULT>
6300 <RESULT COUNT 1>
6301 (?is)\berror: 1.0e0 is not a valid value for type `float' which has subtype \(NaN\)
6302 <END_RESULT>
6303 <RESULT COUNT 1>
6304 (?is)\berror: Subtype mismatch: subtype \(NaN\) has no common value with subtype \(-INF..INF\)
6305 <END_RESULT>
6306 <RESULT COUNT 3>
6307 (?is)\berror:
6308 <END_RESULT>
6309 <END_TC>
6310 :exmp.
6311
6312
6313 *---------------------------------------------------------------------*
6314 :h3.Adhoc:: Exclusive ranges - integer type
6315 .*---------------------------------------------------------------------*
6316 :xmp tab=0.
6317 <TC - Exclusive ranges - integer type>
6318 <COMPILE>
6319 <VERDICT_LEAF PASS>
6320 <MODULE TTCN module1 module1.ttcn>
6321 module module1
6322 {
6323 type integer MyInt1 (!-infinity..!10);
6324 type integer MyInt2 (!-10..!infinity);
6325 type integer MyInt3 (!1..!2);
6326 type integer MyInt4 (!1..!10,!10..!20);
6327 const MyInt4 c_myint4 := 10;
6328 type MyInt4 MyInt5 (2..19);
6329 type integer MyInt6 (MyInt4,10);
6330 const MyInt6 c_myint6a := 10;
6331 const MyInt6 c_myint6b := 20;
6332 }
6333 <END_MODULE>
6334 <RESULT COUNT 1>
6335 (?is)\berror: invalid lower boundary, -infinity cannot be excluded from an integer subtype range
6336 <END_RESULT>
6337 <RESULT COUNT 1>
6338 (?is)\berror: invalid upper boundary, infinity cannot be excluded from an integer subtype range
6339 <END_RESULT>
6340 <RESULT COUNT 1>
6341 (?is)\berror: lower boundary is bigger than upper boundary in integer subtype range
6342 <END_RESULT>
6343 <RESULT COUNT 1>
6344 (?is)\berror: 10 is not a valid value for type `integer' which has subtype \(2..9,11..19\)
6345 <END_RESULT>
6346 <RESULT COUNT 1>
6347 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(2..19\) is not subset of subtype \(2..9,11..19\)
6348 <END_RESULT>
6349 <RESULT COUNT 1>
6350 (?is)\berror: 20 is not a valid value for type `integer' which has subtype \(2..19\)
6351 <END_RESULT>
6352 <RESULT COUNT 6>
6353 (?is)\berror:
6354 <END_RESULT>
6355 <END_TC>
6356 :exmp.
6357
6358
6359 *---------------------------------------------------------------------*
6360 :h3.Adhoc:: Exclusive ranges - float type
6361 .*---------------------------------------------------------------------*
6362 :xmp tab=0.
6363 <TC - Exclusive ranges - float type>
6364 <COMPILE>
6365 <VERDICT_LEAF PASS>
6366 <MODULE TTCN module1 module1.ttcn>
6367 module module1
6368 {
6369 type float MyFlt1 (!-infinity..!-infinity);
6370 type float MyFlt2 (!infinity..!infinity);
6371 type float MyFlt3 (not_a_number..!infinity);
6372 type float MyFlt4 (!-infinity..!infinity);
6373 const MyFlt4 c_myflt4a := -infinity;
6374 const MyFlt4 c_myflt4b := infinity;
6375 const MyFlt4 c_myflt4c := not_a_number;
6376 type float MyFlt5 (MyFlt4, -infinity, infinity, not_a_number);
6377 type float MyFlt6 (-infinity..!0.0,!0.0..infinity);
6378 const MyFlt6 c_myflt6 := 0.0;
6379 }
6380 <END_MODULE>
6381 <RESULT COUNT 1>
6382 (?is)\berror: !-infinity is not a valid upper boundary
6383 <END_RESULT>
6384 <RESULT COUNT 1>
6385 (?is)\berror: !infinity is not a valid lower boundary
6386 <END_RESULT>
6387 <RESULT COUNT 1>
6388 (?is)\berror: lower boundary cannot be not_a_number in float subtype range
6389 <END_RESULT>
6390 <RESULT COUNT 1>
6391 (?is)\berror: -INF is not a valid value for type `float' which has subtype \(!-INF..!INF\)
6392 <END_RESULT>
6393 <RESULT COUNT 1>
6394 (?is)\berror: INF is not a valid value for type `float' which has subtype \(!-INF..!INF\)
6395 <END_RESULT>
6396 <RESULT COUNT 1>
6397 (?is)\berror: NaN is not a valid value for type `float' which has subtype \(!-INF..!INF\)
6398 <END_RESULT>
6399 <RESULT COUNT 1>
6400 (?is)\bwarning: The subtype of type `float' is a full set, it does not constrain the root type.
6401 <END_RESULT>
6402 <RESULT COUNT 1>
6403 (?is)\berror: 0.0e0 is not a valid value for type `float' which has subtype \(-INF..!0.0e0,!0.0e0..INF\)
6404 <END_RESULT>
6405 <RESULT COUNT 7>
6406 (?is)\berror:
6407 <END_RESULT>
6408 <END_TC>
6409 :exmp.
6410
6411
6412 *---------------------------------------------------------------------*
6413 :h3.Adhoc:: Exclusive ranges - charstring type
6414 .*---------------------------------------------------------------------*
6415 :xmp tab=0.
6416 <TC - Exclusive ranges - charstring type>
6417 <COMPILE>
6418 <VERDICT_LEAF PASS>
6419 <MODULE TTCN module1 module1.ttcn>
6420 module module1
6421 {
6422 type charstring MyStr1 (!"a".."a");
6423 type charstring MyStr2 (!"a"..!"b");
6424 type charstring MyStr3 (!"a"..!"c",!"c"..!"z");
6425 const MyStr3 c_mystr3 := "c";
6426 type charstring MyStr4 ("c".."c",!"0".."9");
6427 type charstring MyStr5 (MyStr3, MyStr4);
6428 const MyStr5 c_mystr5a := "c";
6429 const MyStr5 c_mystr5b := "0";
6430 }
6431 <END_MODULE>
6432 <RESULT COUNT 2>
6433 (?is)\berror: lower boundary is bigger than upper boundary in charstring subtype range
6434 <END_RESULT>
6435 <RESULT COUNT 1>
6436 (?is)\berror: "c" is not a valid value for type `charstring' which has subtype from\("b","d".."y"\)
6437 <END_RESULT>
6438 <RESULT COUNT 1>
6439 (?is)\berror: "0" is not a valid value for type `charstring' which has subtype \(from\("b","d".."y"\) union from\("1".."9","c"\)\)
6440 <END_RESULT>
6441 <RESULT COUNT 4>
6442 (?is)\berror:
6443 <END_RESULT>
6444 <END_TC>
6445 :exmp.
6446
6447 *---------------------------------------------------------------------*
6448 :h3.Adhoc:: invalid syntax - equality followed by negation
6449 .*---------------------------------------------------------------------*
6450 :xmp tab=0.
6451 <TC - invalid syntax - equality followed by negation>
6452 <COMPILE>
6453 <VERDICT_LEAF PASS>
6454 <MODULE TTCN module1 module1.ttcn>
6455 module module1
6456 {
6457 function X() {
6458 var boolean x,y;
6459 if (x != not y) {}
6460 }
6461 }
6462 <END_MODULE>
6463 <RESULT COUNT 1>
6464 (?is)\berror: The operation `not' is not allowed to be the second operand of operation `!='
6465 <END_RESULT>
6466 <END_TC>
6467 :exmp.
6468
6469 .*---------------------------------------------------------------------*
6470 :h3.Adhoc:: special float values
6471 .*---------------------------------------------------------------------*
6472 :xmp tab=0.
6473 <TC - special float values>
6474 <COMPILE>
6475 <VERDICT_LEAF PASS>
6476 <MODULE TTCN x x.ttcn>
6477 module x {
6478 const float a := infinity;
6479 const float b := not_a_number;
6480 const float c := 0.0 / b;
6481 control {
6482 var float d := rnd( a );
6483 var float e := rnd( b );
6484 timer t1 := a;
6485 timer t2 := b;
6486 }
6487 }
6488 <END_MODULE>
6489 <RESULT IF_PASS COUNT 1>
6490 (?im)error: Second operand of operation `/' cannot be NaN, it must be a numeric value
6491 <END_RESULT>
6492 <RESULT IF_PASS COUNT 1>
6493 (?im)error: The operand of operation `rnd \(seed\)' cannot be INF, it must be a numeric value
6494 <END_RESULT>
6495 <RESULT IF_PASS COUNT 1>
6496 (?im)error: The operand of operation `rnd \(seed\)' cannot be NaN, it must be a numeric value
6497 <END_RESULT>
6498 <RESULT IF_PASS COUNT 1>
6499 (?im)error: A non-negative float value was expected as timer duration instead of `INF'
6500 <END_RESULT>
6501 <RESULT IF_PASS COUNT 1>
6502 (?im)error: A non-negative float value was expected as timer duration instead of `NaN'
6503 <END_RESULT>
6504 <RESULT IF_PASS COUNT 5>
6505 (?is)\berror:
6506 <END_RESULT>
6507 <END_TC>
6508 :exmp.
6509
6510
6511 .*---------------------------------------------------------------------*
6512 :h3.Adhoc:: template restrictions (TR: HL77646)
6513 .*---------------------------------------------------------------------*
6514 :xmp tab=0.
6515 <TC - template restrictions (TR: HL77646)>
6516 <EXECUTE>
6517 <VERDICT_LEAF PASS>
6518 <MODULE TTCN Temp Temp.ttcn>
6519 module Temp {
6520 type record of integer MyRecOfInt;
6521 template(value) integer t_MyInt := 1
6522 template(value) MyRecOfInt t_MyRecOfInt := {[2]:= t_MyInt }
6523 type record R
6524 {
6525 integer i,
6526 integer o optional,
6527 ROF rof
6528 }
6529 type record of C ROF;
6530 type union C
6531 {
6532 integer i,
6533 boolean b
6534 }
6535 control
6536 {
6537 var template(value) R tr1;
6538 var template R tr2 := { 1, omit, { {b:=true}, {i:=1}, {b:=(true,false)} } }
6539 tr1 := tr2;
6540 }
6541 }
6542 <END_MODULE>
6543 <MODULE CFG Temp Temp.cfg>
6544 [MODULE_PARAMETERS]
6545 [LOGGING]
6546 LogSourceInfo := Yes
6547 Logfile := "Temp%i.log"
6548 LogFileSize := 10
6549 LogFileNumber := 10
6550 DiskFullAction := error
6551 FileMask := LOG_ALL
6552 ConsoleMask := WARNING | ERROR | TESTCASE | STATISTICS
6553 [EXECUTE]
6554 Temp
6555 <END_MODULE>
6556 <RESULT IF_PASS>
6557 (?im)warning: Inadequate restriction on the referenced template variable `tr2', this may cause a dynamic test case error at runtime
6558 <END_RESULT>
6559 <RESULT IF_PASS COUNT 1>
6560 (?im)Dynamic test case error: Restriction `value' on template of type @Temp.R violated.
6561 <END_RESULT>
6562
6563 <END_TC>
6564 :exmp.
6565
6566
6567 .*---------------------------------------------------------------------*
6568 :h3.Adhoc:: template restrictions (TR: HL77646) 2
6569 .*---------------------------------------------------------------------*
6570 :xmp tab=0.
6571 <TC - template restrictions (TR: HL77646) 2>
6572 <EXECUTE>
6573 <VERDICT_LEAF PASS>
6574 <MODULE TTCN Temp Temp.ttcn>
6575 module Temp {
6576 type record R {}
6577 type record of R ROF;
6578 type record of R ROF2;
6579 type union C
6580 {
6581 integer i,
6582 ROF r
6583 }
6584 control
6585 {
6586 var template(value) C t1;
6587 var template(present) C t2 := { r := { [2] := {} } }
6588 t1 := t2;
6589 var template(value) ROF2 t11;
6590 var template(present) ROF2 t21 := { {}, ({},{}) }
6591 t11 := t21;
6592 }
6593 }
6594 <END_MODULE>
6595 <MODULE CFG Temp Temp.cfg>
6596 [MODULE_PARAMETERS]
6597 [LOGGING]
6598 LogSourceInfo := Yes
6599 Logfile := "Temp%i.log"
6600 LogFileSize := 10
6601 LogFileNumber := 10
6602 DiskFullAction := error
6603 FileMask := LOG_ALL
6604 ConsoleMask := WARNING | ERROR | TESTCASE | STATISTICS
6605 [EXECUTE]
6606 Temp
6607 <END_MODULE>
6608 <RESULT IF_PASS>
6609 (?im)warning: Inadequate restriction on the referenced template variable `.+', this may cause a dynamic test case error at runtime
6610 <END_RESULT>
6611 <RESULT IF_PASS COUNT 1>
6612 (?im)Dynamic test case error: Restriction `value' on template of type @Temp.ROF2 violated.
6613 <END_RESULT>
6614
6615 <END_TC>
6616 :exmp.
6617
6618 .*---------------------------------------------------------------------*
6619 :h3.Adhoc:: constant parameter in decvalue function
6620 .*---------------------------------------------------------------------*
6621 :xmp tab=0.
6622 <TC - constant parameter in decvalue function>
6623 <COMPILE>
6624 <VERDICT_LEAF PASS>
6625 <MODULE TTCN x x.ttcn>
6626 module x {
6627 type integer myint with {encode "RAW"}
6628 type record R {
6629 myint i
6630 } with {encode "XML"};
6631
6632 const bitstring c_bs0 := ''B;
6633
6634 control {
6635 var R v_r;
6636 var integer ret := decvalue(c_bs0, v_r);
6637 }
6638
6639 }
6640 <END_MODULE>
6641 <RESULT IF_PASS COUNT 1>
6642 (?im)error: Reference to 'constant' cannot be used as the first operand of the 'decvalue' operation
6643 <END_RESULT>
6644 <RESULT IF_PASS COUNT 1>
6645 (?is)\berror:
6646 <END_RESULT>
6647 <END_TC>
6648 :exmp.
6649
6650 .*---------------------------------------------------------------------*
6651 :h3.Adhoc:: extra checks for decvalue (HM59355)
6652 .*---------------------------------------------------------------------*
6653 :xmp tab=0.
6654 <TC - extra checks for decvalue (HM59355)>
6655 <COMPILE>
6656 <VERDICT_LEAF PASS>
6657 <MODULE TTCN x x.ttcn>
6658 module x {
6659 type record MyEmptyRecord { } with { encode "XML" }
6660 control {
6661 var bitstring s
6662 var integer i
6663 var template MyEmptyRecord t
6664 i := decvalue(s, MyEmptyRecord)
6665 // Original error: expected unqualified-id before '.' token
6666 i := decvalue(s, t)
6667 // Original error: 'class x::MyEmptyRecord_template' has no member named 'decode'
6668 }
6669 }
6670 <END_MODULE>
6671 <RESULT IF_PASS COUNT 1>
6672 (?im)error: Reference to 'type' cannot be used.
6673 <END_RESULT>
6674 <RESULT IF_PASS COUNT 1>
6675 (?im)error: Reference to 'template variable' cannot be used.
6676 <END_RESULT>
6677 <RESULT IF_PASS COUNT 2>
6678 (?is)\berror:
6679 <END_RESULT>
6680 <END_TC>
6681 :exmp.
6682
6683 .*---------------------------------------------------------------------*
6684 :h3.Adhoc:: SIGSEGV on missing modules (HM62166)
6685 .*---------------------------------------------------------------------*
6686 :xmp tab=0.
6687 <TC - SIGSEGV on missing modules (HM62166)>
6688 <COMPILE>
6689 <VERDICT_LEAF PASS>
6690 <MODULE TTCN x x.asn>
6691 Example DEFINITIONS ::= BEGIN
6692 IMPORTS
6693 X FROM Y
6694 MyType FROM Z {itu-t(0)};
6695 EXTENSION ::= CLASS {&id Code}
6696 myExtension EXTENSION ::= {IDENTIFIED BY global : {itu-t(0)}}
6697 END
6698 <END_MODULE>
6699 <RESULT IF_PASS COUNT 1>
6700 (?im)error: There is no module with identifier \`Y\'
6701 <END_RESULT>
6702 <RESULT IF_PASS COUNT 1>
6703 (?im)error: There is no module with identifier \`Z\'
6704 <END_RESULT>
6705 <RESULT IF_PASS COUNT 1>
6706 (?im)error: There is no assignment or imported symbol with name \`Code\' in module \`Example\'
6707 <END_RESULT>
6708 <RESULT IF_PASS COUNT 1>
6709 (?im)error: Cannot recognize fieldspec
6710 <END_RESULT>
6711 <RESULT IF_PASS COUNT 1>
6712 (?im)error: Unexpected \`\<upperidentifier\>\'
6713 <END_RESULT>
6714 <RESULT IF_PASS COUNT 1>
6715 (?im)error: Superfluous part detected
6716 <END_RESULT>
6717 <RESULT IF_PASS COUNT 1>
6718 (?im)error: Check the syntax of objectclass \(consider using debug messages\)
6719 <END_RESULT>
6720 <RESULT IF_PASS COUNT 7>
6721 (?is)\berror:
6722 <END_RESULT>
6723 <END_TC>
6724 :exmp.
6725
6726 *---------------------------------------------------------------------*
6727 :h3.Adhoc:: Subtyping - Octetstring TR (TR:?)
6728 .*---------------------------------------------------------------------*
6729 :xmp tab=0.
6730 <TC - Subtyping - Octetstring TR (TR:?)>
6731 <COMPILE>
6732 <VERDICT_LEAF PASS>
6733 <MODULE TTCN module1 module1.ttcn>
6734 module module1
6735 {
6736 const octetstring c_PcapMagic_LittleEndian := 'd4c3b2a1'O;
6737 const octetstring c_PcapMagic_BigEndian := 'a1b2c3d4'O;
6738 type octetstring PcapMagic1 ('d4c3b2a1'O, 'a1b2c3d4'O);
6739 type octetstring PcapMagic2 (c_PcapMagic_BigEndian, c_PcapMagic_LittleEndian);
6740
6741 control {}
6742 }
6743 <END_MODULE>
6744 <RESULT COUNT 0>
6745 (?is)\berror:
6746 <END_RESULT>
6747 <END_TC>
6748 :exmp.
6749
6750 *---------------------------------------------------------------------*
6751 :h3.Adhoc:: Subtyping - String indexing (TR:?)
6752 .*---------------------------------------------------------------------*
6753 :xmp tab=0.
6754 <TC - Subtyping - String indexing (TR:?)>
6755 <COMPILE>
6756 <VERDICT_LEAF PASS>
6757 <MODULE TTCN module1 module1.ttcn>
6758 module module1
6759 {
6760 type octetstring OCT1 length(1);
6761 type octetstring OCT2 length(2);
6762
6763 const OCT2 long_octet := '0102'O;
6764 const OCT1 short_octet := long_octet[0];
6765
6766 type port myport message { inout OCT1; } with { extension "internal" };
6767 type port myport2 message { inout OCT2; } with { extension "internal" };
6768 type component mycomp {
6769 port myport p;
6770 port myport2 p2;
6771 };
6772
6773 function myfunc() runs on mycomp
6774 {
6775 var OCT1 o1;
6776 var OCT2 o2;
6777 p.receive(OCT1:?) -> value o2[0];
6778 p2.receive(OCT2:?) -> value o1;
6779 p2.receive(OCT2:?) -> value o2[0];
6780
6781 o1 := o2;
6782 o2 := o1;
6783
6784 o1 := o2[1];
6785 o2[0] := o1;
6786
6787 o2 := o2[2];
6788 o2[0] := o2;
6789
6790 o2 := myfunc12(o1,o2);
6791
6792 o2[0] := myfunc12(o1,o2);
6793
6794 o2[0] := o1[0];
6795
6796 o1[0] := myfunc12(o1,o2);
6797
6798 o1 := myfunc12(o2,o1);
6799 o1 := myfunc12in(o2,o1);
6800 o1 := myfunc12out(o2,o1);
6801 o2 := myfunc12(o1,o2);
6802 }
6803
6804 function myfunc12(inout OCT1 p_o1, inout OCT2 p_o2) return OCT1
6805 {
6806 return p_o2[0];
6807 }
6808
6809 function myfunc12in(in OCT1 p_o1, in OCT2 p_o2) return OCT1
6810 {
6811 return p_o2[0];
6812 }
6813
6814 function myfunc12out(out OCT1 p_o1, out OCT2 p_o2) return OCT1
6815 {
6816 return p_o2[0];
6817 }
6818
6819 function myfunc12err(inout OCT1 p_o1, inout OCT2 p_o2) return OCT2
6820 {
6821 return p_o2[0];
6822 }
6823
6824 control {
6825 var OCT2 o2 := 'BABE'O;
6826 var integer i := oct2int(o2[0]); // HQ38022
6827 }
6828 }
6829 <END_MODULE>
6830 <RESULT IF_PASS COUNT 3>
6831 (?im)error: Subtype mismatch: subtype length\(2\) has no common value with a string element
6832 <END_RESULT>
6833 <RESULT IF_PASS COUNT 7>
6834 (?im)error: Subtype mismatch: subtype length\(2\) has no common value with subtype length\(1\)
6835 <END_RESULT>
6836 <RESULT IF_PASS COUNT 4>
6837 (?im)error: Subtype mismatch: subtype length\(1\) has no common value with subtype length\(2\)
6838 <END_RESULT>
6839 <RESULT IF_PASS COUNT 1>
6840 (?im)error: Subtype mismatch: string element has no common value with subtype length\(2\)
6841 <END_RESULT>
6842 <RESULT IF_PASS COUNT 2>
6843 (?im)error: Reference to a string element of type `octetstring' cannot be used in this context
6844 <END_RESULT>
6845 <RESULT COUNT 17>
6846 (?is)\berror:
6847 <END_RESULT>
6848 <END_TC>
6849 :exmp.
6850
6851 *---------------------------------------------------------------------*
6852 :h3.Adhoc:: Subtyping - function references
6853 .*---------------------------------------------------------------------*
6854 :xmp tab=0.
6855 <TC - Subtyping - function references>
6856 <COMPILE>
6857 <VERDICT_LEAF PASS>
6858 <MODULE TTCN module1 module1.ttcn>
6859 module module1
6860 {
6861 type octetstring OCT1 length(1);
6862 type octetstring OCT2 length(2);
6863
6864 const OCT2 long_octet := '0102'O;
6865 const OCT1 short_octet := long_octet[0];
6866
6867 type function myfunctype(inout OCT2 p_o1, inout OCT1 p_o2) return OCT2
6868
6869 function myfunc(inout OCT1 p_o1, inout OCT2 p_o2) return OCT1
6870 {
6871 return p_o2[0];
6872 }
6873
6874 control {
6875 var myfunctype f := refers(myfunc);
6876 }
6877 }
6878 <END_MODULE>
6879 <RESULT IF_PASS COUNT 1>
6880 (?im)error: Subtype mismatch: subtype length\(2\) has no common value with subtype length\(1\)
6881 <END_RESULT>
6882 <RESULT IF_PASS COUNT 1>
6883 (?im)error: Subtype mismatch: subtype length\(1\) has no common value with subtype length\(2\)
6884 <END_RESULT>
6885 <RESULT IF_PASS COUNT 1>
6886 (?im)error: Return type subtype mismatch: subtype length\(2\) has no common value with subtype length\(1\)
6887 <END_RESULT>
6888 <RESULT COUNT 3>
6889 (?is)\berror:
6890 <END_RESULT>
6891 <END_TC>
6892 :exmp.
6893
6894 *---------------------------------------------------------------------*
6895 :h3.Adhoc:: Values - Valueof TR (TR:HM93087)
6896 .*---------------------------------------------------------------------*
6897 :xmp tab=0.
6898 <TC - Values - Valueof TR (TR:HM93087)>
6899 <COMPILE>
6900 <VERDICT_LEAF PASS>
6901 <MODULE TTCN module1 module1.ttcn>
6902 module module1
6903 {
6904 type record rec {
6905 integer f
6906 }
6907 control {
6908 if (valueof(rec:{1}) == {1}) { }
6909 }
6910 }
6911 <END_MODULE>
6912 <RESULT COUNT 0>
6913 (?is)\berror:
6914 <END_RESULT>
6915 <END_TC>
6916 :exmp.
6917
6918 *---------------------------------------------------------------------*
6919 :h3.Adhoc:: Recursion - recursion TR (TR:HM93170)
6920 .*---------------------------------------------------------------------*
6921 :xmp tab=0.
6922 <TC - Recursion - recursion TR (TR:HM93170)>
6923 <COMPILE>
6924 <VERDICT_LEAF PASS>
6925 <MODULE TTCN module1 module1.ttcn>
6926 module module1
6927 {
6928 type record recT {
6929 integer f1,
6930 float f2,
6931 charstring f3,
6932 integer f4,
6933 integer f5
6934 }
6935
6936 template recT temp1:= { f1:= temp2.f1, f2:= 1.1, f3:= "ERIXON", f4:= 1, f5:= temp1.f1 };
6937 template recT temp2:= { f1:= temp2.f4, f2:= 1.1, f3:= "ERIXON", f4:= temp1.f5, f5:= 2 };
6938
6939 }
6940 <END_MODULE>
6941 <RESULT IF_PASS COUNT 1>
6942 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.temp2.f4' -> `\@module1.temp1.f5' -> `\@module1.temp1.f1' -> `\@module1.temp2.f1' -> `\@module1.temp2.f4'
6943 <END_RESULT>
6944 <RESULT IF_PASS COUNT 1>
6945 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.temp1.f1' -> `\@module1.temp2.f1' -> `\@module1.temp2.f4' -> `\@module1.temp1.f5' -> `\@module1.temp1.f1'
6946 <END_RESULT>
6947 <RESULT IF_PASS COUNT 1>
6948 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.temp1.f5' -> `\@module1.temp1.f1' -> `\@module1.temp2.f1' -> `\@module1.temp2.f4' -> `\@module1.temp1.f5'
6949 <END_RESULT>
6950 <RESULT COUNT 3>
6951 (?is)\berror:
6952 <END_RESULT>
6953 <END_TC>
6954 :exmp.
6955
6956 *---------------------------------------------------------------------*
6957 :h3.Adhoc:: Recursion - union TR (TR:HM93077)
6958 .*---------------------------------------------------------------------*
6959 :xmp tab=0.
6960 <TC - Recursion - union TR (TR:HM93077)>
6961 <COMPILE>
6962 <VERDICT_LEAF PASS>
6963 <MODULE TTCN module1 module1.ttcn>
6964 module module1 {
6965 type union ValidUnion0 {
6966 integer i
6967 }
6968
6969 type union ValidUnion1 {
6970 ValidUnion1 u1,
6971 integer i,
6972 ValidUnion0 u2
6973 }
6974
6975 type union InvalidUnion0 {
6976 InvalidUnion0 u1
6977 }
6978
6979 type union InvalidUnion1 {
6980 InvalidUnion2 u1
6981 }
6982
6983 type union InvalidUnion2 {
6984 InvalidUnion1 u1
6985 }
6986
6987 type union InvalidUnion3 {
6988 InvalidUnion3 u1,
6989 InvalidUnion3 u2,
6990 InvalidUnion3 u3
6991 }
6992
6993 type union InvalidUnion4 {
6994 InvalidRecord0 r1
6995 }
6996
6997 type record InvalidRecord0 {
6998 InvalidRecord0 r1
6999 }
7000 }
7001 <END_MODULE>
7002 <RESULT IF_PASS COUNT 1>
7003 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion0' -> `\@module1.InvalidUnion0.u1' -> `\@module1.InvalidUnion0'
7004 <END_RESULT>
7005 <RESULT IF_PASS COUNT 1>
7006 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion2' -> `\@module1.InvalidUnion2.u1' -> `@\module1.InvalidUnion1' -> `\@module1.InvalidUnion1.u1' -> `\@module1.InvalidUnion2'
7007 <END_RESULT>
7008 <RESULT IF_PASS COUNT 1>
7009 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion3' -> `\@module1.InvalidUnion3.u1' -> `\@module1.InvalidUnion3'
7010 <END_RESULT>
7011 <RESULT IF_PASS COUNT 1>
7012 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion3' -> `\@module1.InvalidUnion3.u2' -> `\@module1.InvalidUnion3'
7013 <END_RESULT>
7014 <RESULT IF_PASS COUNT 1>
7015 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion3' -> `\@module1.InvalidUnion3.u3' -> `\@module1.InvalidUnion3'
7016 <END_RESULT>
7017 <RESULT IF_PASS COUNT 1>
7018 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidRecord0' -> `\@module1.InvalidRecord0.r1' -> `\@module1.InvalidRecord0'
7019 <END_RESULT>
7020 <RESULT IF_PASS COUNT 1>
7021 (?im)\bnotify: Errors found in the input module. Code will not be generated.
7022 <END_RESULT>
7023 <END_TC>
7024 :exmp.
7025
7026 .*---------------------------------------------------------------------*
7027 :h3.Adhoc:: Negative testing semantic check error messages
7028 .*---------------------------------------------------------------------*
7029 :xmp tab=0.
7030 <TC - Negative testing semantic check error messages>
7031 <COMPILE>
7032 <VERDICT_LEAF PASS>
7033 <MODULE ASN Virag Virag.asn>
7034 Virag DEFINITIONS ::=
7035 BEGIN
7036 IMPORTS ;
7037 MySeqOf ::= SEQUENCE OF INTEGER
7038 MySeq ::= SEQUENCE {
7039 i INTEGER,
7040 b BOOLEAN
7041 }
7042 MyUnion ::= CHOICE {
7043 i INTEGER,
7044 b BOOLEAN,
7045 s MySeq
7046 }
7047 MyCharstring1 ::= VisibleString
7048 MyCharstring2 ::= IA5String
7049 END
7050 <END_MODULE>
7051
7052 <MODULE TTCN virag virag.ttcn>
7053 module virag
7054 {
7055 import from Virag all;
7056 group text_grp {
7057 type record MYREC
7058 {
7059 integer i,
7060 boolean b,
7061 MYREC r optional
7062 }
7063 type record of integer MYROFI;
7064 type union MYU {
7065 integer i,
7066 boolean b,
7067 MYREC r
7068 }
7069 }
7070 with { encode "TEXT" variant "" }
7071 type record MYREC2 { integer i }
7072 const MYREC c_myrec1 := {i:=1}
7073 with {
7074 erroneous "value := 2"
7075 erroneous (x) "value := 2"
7076 erroneous (i, r.i, r.r.i) "value := 2"
7077 }
7078 const MYREC c_myrec2 := {i:=1} with { erroneous (b) "after := omit" }
7079 const MYREC c_myrec3 := {i:=1} with { erroneous (b) "before := omit" }
7080 const MYREC c_myrec4 := {i:=1} with { erroneous (b) "value := omit all" }
7081 const MYREC c_myrec5 := {i:=1} with { erroneous (b) "value := 123 all" }
7082 const MYREC c_myrec6 := {i:=1} with { erroneous (b) "value := {1,2,3}" }
7083 const MYREC c_myrec7 := {i:=1} with { erroneous (b) "value := nonexi" }
7084 const MYREC c_myrec8 := {i:=1} with { erroneous (b) "value(raw) := 123" }
7085 const MYREC c_myrec9 := {i:=1} with { erroneous (b) "value := MYROFI:'A'H" }
7086 const MYREC c_myrec10 := {i:=1} with { erroneous (b) "value := MYROFI:{1,2,*}" }
7087 const MYREC c_myrec11 := {i:=1} with {
7088 erroneous (b) "after := omit all"
7089 erroneous (r) "value := 0"
7090 }
7091 const MYREC c_myrec12 := {i:=1} with {
7092 erroneous (r) "before := omit all"
7093 erroneous (b) "value := 0"
7094 }
7095 const MYU c_myu13 := {i:=1} with { erroneous (b) "after := omit all" erroneous (r) "value:=12" }
7096 const MYU c_myu14 := {i:=1} with { erroneous (b) "value := omit" }
7097 const MYREC c_myrec15 := {i:=1} with {
7098 erroneous (r) "after := omit all"
7099 erroneous (i) "before := omit all"
7100 }
7101 const MYREC c_myrec16 := {i:=1} with {
7102 erroneous (b,b) "value := 1"
7103 erroneous (b,b) "after := 1"
7104 erroneous (b,b) "before := 1"
7105 }
7106 const MYREC c_myrec17 := {i:=1} with {
7107 erroneous (r.b) "value := 1"
7108 erroneous (r) "value := 1"
7109 }
7110 const MYREC c_myrec18 := {i:=1} with {
7111 erroneous (b) "before := omit all"
7112 erroneous (r) "before := omit all"
7113 }
7114 const MYREC c_myrec19 := {i:=1} with {
7115 erroneous (b) "value := 1"
7116 erroneous (r) "before := omit all"
7117 }
7118 const MYREC c_myrec20 := {i:=1} with {
7119 erroneous (b) "after := omit all"
7120 erroneous (i) "after := omit all"
7121 }
7122 const MYREC c_myrec21 := {i:=1} with {
7123 erroneous (r) "value := 1"
7124 erroneous (b) "after := omit all"
7125 }
7126 const MYREC c_myrec22 := {i:=1} with {
7127 erroneous (r) "value := omit"
7128 erroneous (r.i) "value := 1"
7129 }
7130 const MySeq c_myrec23 := {i:=1} with { erroneous (b) "value(raw) := ""proba""" }
7131 const MySeq c_myrec24 := {i:=1} with { erroneous (b) "value(raw) := universal charstring:""proba""" }
7132 const MYREC2 c_myrec25 := {i:=1} with { erroneous (i) "value(raw) := '1010'B" }
7133 const MYREC c_myrec26 := {i:=1} with { erroneous (b) "value := MyCharstring1:""haha""" }
7134 const MYREC c_myrec27 := {i:=1} with { erroneous (b) "value := MYREC2:{i:=1}" }
7135 function fv() {} with{erroneous ""}
7136 control {} with{erroneous ""}
7137 } with{erroneous ""}
7138 <END_MODULE>
7139
7140 <RESULT FTRT COUNT 1>
7141 (?im)\berror: At least one qualifier must be specified for the `erroneous' attribute
7142 <END_RESULT>
7143
7144 <RESULT FTRT COUNT 1>
7145 (?im)\berror: Reference to non-existent field `x' in type `@virag.MYREC'
7146 <END_RESULT>
7147
7148 <RESULT FTRT COUNT 1>
7149 (?im)\berror: Keyword `all' is expected after `omit' when omitting all fields after the specified field
7150 <END_RESULT>
7151
7152 <RESULT FTRT COUNT 1>
7153 (?im)\berror: Keyword `all' is expected after `omit' when omitting all fields before the specified field
7154 <END_RESULT>
7155
7156 <RESULT FTRT COUNT 1>
7157 (?im)\berror: Unexpected `all' keyword after `omit' when omitting one field
7158 <END_RESULT>
7159
7160 <RESULT FTRT COUNT 1>
7161 (?im)\berror: Unexpected `all' keyword after the in-line template
7162 <END_RESULT>
7163
7164 <RESULT FTRT COUNT 1>
7165 (?im)\berror: Cannot determine the type of the in-line template
7166 <END_RESULT>
7167
7168 <RESULT FTRT COUNT 1>
7169 (?im)\berror: There is no local or imported definition with name `nonexi'
7170 <END_RESULT>
7171
7172 <RESULT FTRT COUNT 1>
7173 (?im)\berror: An in-line template of type `integer' cannot be used as a `raw' erroneous value
7174 <END_RESULT>
7175
7176 <RESULT FTRT COUNT 1>
7177 (?im)\berror: record of value was expected
7178 <END_RESULT>
7179
7180 <RESULT FTRT COUNT 1>
7181 (?im)\berror: A specific value without matching symbols was expected
7182 <END_RESULT>
7183
7184 <RESULT FTRT COUNT 1>
7185 (?im)\berror: Field `r' cannot be referenced because all fields after field `b' have been omitted
7186 <END_RESULT>
7187
7188 <RESULT FTRT COUNT 1>
7189 (?im)\berror: Field `b' cannot be referenced because all fields before field `r' have been omitted
7190 <END_RESULT>
7191
7192 <RESULT FTRT COUNT 1>
7193 (?im)\berror: Indicator `after' cannot be used with reference `b' which points to a field of a union type
7194 <END_RESULT>
7195
7196 <RESULT FTRT COUNT 1>
7197 (?im)\berror: There is nothing to omit after the last field \(r\) of a record/set type
7198 <END_RESULT>
7199
7200 <RESULT FTRT COUNT 1>
7201 (?im)\berror: Reference to field `r' with indicator `value' would invalidate previously specified erroneous data
7202 <END_RESULT>
7203
7204 <RESULT FTRT COUNT 1>
7205 (?im)\berror: There is nothing to omit before the first field \(i\)
7206 <END_RESULT>
7207
7208 <RESULT FTRT COUNT 1>
7209 (?im)\berror: Duplicate reference to field `b' with indicator `value'
7210 <END_RESULT>
7211
7212 <RESULT FTRT COUNT 1>
7213 (?im)\berror: Duplicate reference to field `b' with indicator `after'
7214 <END_RESULT>
7215
7216 <RESULT FTRT COUNT 1>
7217 (?im)\berror: Duplicate reference to field `b' with indicator `before'
7218 <END_RESULT>
7219
7220 <RESULT FTRT COUNT 1>
7221 (?im)\berror: Duplicate rule for omitting all fields before the specified field. Used on field `r' but previously already used on field `b'
7222 <END_RESULT>
7223
7224 <RESULT FTRT COUNT 1>
7225 (?im)\berror: Omitting fields before field `r' would invalidate previously specified erroneous data
7226 <END_RESULT>
7227
7228 <RESULT FTRT COUNT 1>
7229 (?im)\berror: Duplicate rule for omitting all fields after the specified field. Used on field `i' but previously already used on field `b'
7230 <END_RESULT>
7231
7232 <RESULT FTRT COUNT 1>
7233 (?im)\berror: Omitting fields after field `b' would invalidate previously specified erroneous data
7234 <END_RESULT>
7235
7236 <RESULT FTRT COUNT 1>
7237 (?im)\berror: Field `r.i' is embedded into a field which was previously overwritten or omitted
7238 <END_RESULT>
7239
7240 <RESULT FTRT COUNT 1>
7241 (?im)\berror: A `raw' charstring value was used for erroneous type `@Virag.MySeq' which has no TEXT or XER encodings.
7242 <END_RESULT>
7243
7244 <RESULT FTRT COUNT 1>
7245 (?im)\berror: A `raw' universal charstring value was used for erroneous type `@Virag.MySeq' which has no XER encoding.
7246 <END_RESULT>
7247
7248 <RESULT FTRT COUNT 1>
7249 (?im)\berror: A `raw' bitstring value was used for erroneous type `@virag.MYREC2' which has no RAW or PER encodings.
7250 <END_RESULT>
7251
7252 <RESULT FTRT COUNT 1>
7253 (?im)\berror: Type `VisibleString' and type `@virag.MYREC' have no common encoding
7254 <END_RESULT>
7255
7256 <RESULT FTRT COUNT 1>
7257 (?im)\berror: Type `@virag.MYREC2' and type `@virag.MYREC' have no common encoding
7258 <END_RESULT>
7259
7260 <RESULT COUNT 3>
7261 (?im)\berror: The `erroneous' attribute can be used only on template and constant definitions
7262 <END_RESULT>
7263
7264 <RESULT FTRT COUNT 33>
7265 (?is)\berror:
7266 <END_RESULT>
7267
7268
7269 <RESULT LTRT COUNT 27>
7270 (?im)\berror: `erroneous' attributes can be used only with the Function Test Runtime
7271 <END_RESULT>
7272
7273 <RESULT LTRT COUNT 27>
7274 (?im)\bnote: If you need negative testing use the -R flag when generating the makefile
7275 <END_RESULT>
7276
7277 <RESULT LTRT COUNT 30>
7278 (?is)\berror:
7279 <END_RESULT>
7280 <RESULT LTRT COUNT 27>
7281 (?is)\bnote:
7282 <END_RESULT>
7283
7284 <END_TC>
7285 :exmp.
7286
7287 .*---------------------------------------------------------------------*
7288 :h3.Adhoc:: Syntax errors in logfiles (TR HN52781)
7289 .*---------------------------------------------------------------------*
7290 :xmp tab=0.
7291 <TC - Syntax errors in logfiles (TR HN52781)>
7292 <EXECUTE>
7293 <VERDICT_LEAF PASS>
7294 <MODULE TTCN Temp Temp.ttcn>
7295 module Temp {
7296 control { }
7297 }
7298 <END_MODULE>
7299 <MODULE CFG Temp Temp.cfg>
7300 [MODULE_PARAMETERS]
7301 very_unknown_module_parameter := "should be logged normally"
7302 [LOGGING]
7303 LogSourceInfo := Yes
7304 Logfile := "Temp%i.log"
7305 FileMask := LOG_ALL
7306 ConsoleMask := LOG_ALL
7307 [EXECUTE]
7308 Temp
7309 <END_MODULE>
7310 <RESULT IF_PASS COUNT 2>
7311 (?im)Error while setting parameter field 'very_unknown_module_parameter' to '"should be logged normally"': Module parameter cannot be set, because module `very_unknown_module_parameter' does not exist, and no parameter with name `very_unknown_module_parameter' exists in any module.
7312 <END_RESULT>
7313 <END_TC>
7314 :exmp.
7315
7316 .*---------------------------------------------------------------------*
7317 :h3.Adhoc:: testcase.stop
7318 .*---------------------------------------------------------------------*
7319 :xmp tab=0.
7320 <TC - testcase.stop>
7321 <EXECUTE>
7322 <VERDICT_LEAF PASS>
7323 <MODULE TTCN Temp Temp.ttcn>
7324 module Temp {
7325 type component MyComp {}
7326 testcase TC() runs on MyComp {
7327 testcase.stop("Is it a Bird?! Is it a Plane?! No!! It's a dynamic test case error!!!");
7328 }
7329 control
7330 {
7331 execute(TC());
7332 }
7333 }
7334 <END_MODULE>
7335 <MODULE CFG Temp Temp.cfg>
7336 [MODULE_PARAMETERS]
7337 [LOGGING]
7338 LogSourceInfo := Yes
7339 Logfile := "Temp%i.log"
7340 FileMask := LOG_ALL
7341 ConsoleMask := LOG_ALL
7342 [EXECUTE]
7343 Temp
7344 <END_MODULE>
7345 <RESULT IF_PASS COUNT 1>
7346 (?im)Dynamic test case error: testcase.stop
7347 <END_RESULT>
7348 <RESULT IF_PASS COUNT 1>
7349 (?im)Is it a Bird\?! Is it a Plane\?! No!! It's a dynamic test case error!!!
7350 <END_RESULT>
7351 <END_TC>
7352 :exmp.
7353
7354 .*---------------------------------------------------------------------*
7355 :h3.Adhoc:: Indexing of string template variables (CR_TR00018474)
7356 .*---------------------------------------------------------------------*
7357 :xmp tab=0.
7358 <TC - Indexing of string template variables (CR_TR00018474)>
7359 <COMPILE>
7360 <VERDICT_LEAF PASS>
7361 <MODULE TTCN Temp Temp.ttcn>
7362 module Temp {
7363 type component MyComp {}
7364 template charstring tcs := "doggee"
7365 template bitstring tbs := '11001100'B
7366 template hexstring ths := 'AABBCCDDEEFF'H
7367 template octetstring tos := 'AABBCCDD'O
7368 template universal charstring tus := char(0, 0, 0, 75) & char(0, 0, 0, 65)
7369
7370 function fsi_charstrings(in template charstring vtc) {}
7371 function fsi_bitstrings(in template bitstring vtb) {}
7372 function fsi_hexstrings(in template hexstring vth) {}
7373 function fsi_octetstrings(in template octetstring vto) {}
7374 function fsi_universal_charstrings(in template universal charstring vtu) {}
7375
7376 testcase TC_charstrings() runs on MyComp {
7377 var template charstring vtc := "fisherman"
7378 vtc[0] := vtc[1] // Compile error, string template variables cannot be indexed on the right hand side.
7379 vtc[0] := tcs[1] // Compile error, string templates cannot be indexed at all.
7380 tcs[0] := "D" // Compile error, string templates cannot be indexed at all.
7381 vtc[0] := * // Compile error, ANY_OR_OMIT can never be assigned to an element of a string template variable.
7382 vtc[0] := ? // Compile error, ANY_VALUE can never be assigned to an element of a string template variable, it would "become" a pattern otherwise.
7383 fsi_charstrings(vtc[0]) // Compile error, string template variables cannot be indexed on the right hand side.
7384 }
7385
7386 testcase TC_bitstrings() runs on MyComp {
7387 var template bitstring vtb := '0011110000'B
7388 vtb[0] := vtb[1]
7389 vtb[0] := tbs[1]
7390 tbs[0] := '1'B
7391 vtb[0] := *
7392 vtb[0] := ?
7393 vtb[0] := '*'B
7394 vtb[1] := '?'B
7395 fsi_bitstrings(vtb[0])
7396 }
7397
7398 testcase TC_hexstrings() runs on MyComp {
7399 var template hexstring vth := 'AABBCCDDEE'H
7400 vth[0] := vth[1]
7401 vth[0] := ths[1]
7402 ths[0] := 'B'H
7403 vth[0] := *
7404 vth[0] := ?
7405 vth[0] := '*'H
7406 vth[1] := '?'H
7407 fsi_hexstrings(vth[0])
7408 }
7409
7410 testcase TC_octetstrings() runs on MyComp {
7411 var template octetstring vto := 'ABBAABBA'O
7412 vto[0] := vto[1]
7413 vto[0] := tos[1]
7414 tos[0] := 'BB'O
7415 vto[0] := *
7416 vto[0] := ?
7417 vto[0] := '*'O
7418 vto[1] := '?'O
7419 fsi_octetstrings(vto[0])
7420 }
7421
7422 testcase TC_universal_charstrings() runs on MyComp {
7423 var template universal charstring vtu := "fisherman"
7424 vtu[0] := vtu[1]
7425 vtu[0] := tus[1]
7426 tus[0] := "F"
7427 vtu[0] := *
7428 vtu[0] := ?
7429 fsi_universal_charstrings(vtu[0])
7430 }
7431
7432 }
7433 <END_MODULE>
7434 <RESULT IF_PASS COUNT 2>
7435 (?im)error: Reference to template variable `vtc' can not be indexed
7436 <END_RESULT>
7437 <RESULT IF_PASS COUNT 1>
7438 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tcs'
7439 <END_RESULT>
7440 <RESULT IF_PASS COUNT 16>
7441 (?im)error: A template body with matching symbols cannot be assigned to an element of a template variable
7442 <END_RESULT>
7443 <RESULT IF_PASS COUNT 2>
7444 (?im)error: Reference to template variable `vtb' can not be indexed
7445 <END_RESULT>
7446 <RESULT IF_PASS COUNT 1>
7447 (?im)error: Invalid array element reference: type `bitstring' cannot be indexed
7448 <END_RESULT>
7449 <RESULT IF_PASS COUNT 1>
7450 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tbs'
7451 <END_RESULT>
7452 <RESULT IF_PASS COUNT 2>
7453 (?im)error: Reference to template variable `vth' can not be indexed
7454 <END_RESULT>
7455 <RESULT IF_PASS COUNT 2>
7456 (?im)error: Reference to template variable `vto' can not be indexed
7457 <END_RESULT>
7458 <RESULT IF_PASS COUNT 2>
7459 (?im)error: Reference to template variable `vtu' can not be indexed
7460 <END_RESULT>
7461 <RESULT IF_PASS COUNT 1>
7462 (?im)error: Invalid array element reference: type `hexstring' cannot be indexed
7463 <END_RESULT>
7464 <RESULT IF_PASS COUNT 1>
7465 (?im)error: Invalid array element reference: type `octetstring' cannot be indexed
7466 <END_RESULT>
7467 <RESULT IF_PASS COUNT 1>
7468 (?im)error: Invalid array element reference: type `universal charstring' cannot be indexed
7469 <END_RESULT>
7470 <RESULT IF_PASS COUNT 1>
7471 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.ths'
7472 <END_RESULT>
7473 <RESULT IF_PASS COUNT 1>
7474 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tos'
7475 <END_RESULT>
7476 <RESULT IF_PASS COUNT 1>
7477 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tus'
7478 <END_RESULT>
7479 <END_TC>
7480 :exmp.
7481
7482 .*---------------------------------------------------------------------*
7483 :h3.Adhoc:: Indexing of string template variables DTEs (CR_TR00018474)
7484 .*---------------------------------------------------------------------*
7485 :xmp tab=0.
7486 <TC - Indexing of string template variables DTEs (CR_TR00018474)>
7487 <EXECUTE>
7488 <VERDICT_LEAF PASS>
7489 <MODULE TTCN Temp Temp.ttcn>
7490 module Temp {
7491 type component MyComp {}
7492
7493 testcase TC_bitstrings() runs on MyComp {
7494 var template bitstring vtb := '0*?1'B // It's a pattern, cannot be indexed, runtime error.
7495 vtb[0] := '1'B
7496 setverdict(pass)
7497 }
7498
7499 testcase TC_hexstrings() runs on MyComp {
7500 var template hexstring vth := 'AABB?CC'H // It's a pattern, cannot be indexed, runtime error.
7501 vth[0] := 'B'H
7502 setverdict(pass)
7503 }
7504
7505 testcase TC_octetstrings() runs on MyComp {
7506 var template octetstring vto := 'AABB??*'O // It's a pattern, cannot be indexed, runtime error.
7507 vto[0] := 'BB'O
7508 setverdict(pass)
7509 }
7510
7511 control
7512 {
7513 execute(TC_bitstrings());
7514 execute(TC_hexstrings());
7515 execute(TC_octetstrings());
7516 }
7517 }
7518 <END_MODULE>
7519 <MODULE CFG Temp Temp.cfg>
7520 [MODULE_PARAMETERS]
7521 [LOGGING]
7522 LogSourceInfo := Yes
7523 Logfile := "Temp%i.log"
7524 FileMask := LOG_ALL
7525 ConsoleMask := LOG_ALL
7526 [EXECUTE]
7527 Temp
7528 <END_MODULE>
7529 <RESULT IF_PASS COUNT 1>
7530 (?im)Dynamic test case error: Accessing a bitstring element of a non-specific bitstring template.
7531 <END_RESULT>
7532 <RESULT IF_PASS COUNT 1>
7533 (?im)Dynamic test case error: Accessing a hexstring element of a non-specific hexstring template.
7534 <END_RESULT>
7535 <RESULT IF_PASS COUNT 1>
7536 (?im)Dynamic test case error: Accessing an octetstring element of a non-specific octetstring template.
7537 <END_RESULT>
7538 <END_TC>
7539 :exmp.
7540
7541 .*--------------------------------------------------------------------------*
7542 :h3.Adhoc - TR HO69261 Incorrect code generated for create with optional parameters
7543 .*--------------------------------------------------------------------------*
7544 :xmp tab=0.
7545
7546 <TC - Adhoc - TR HO69261 Incorrect code generated for create with optional parameters>
7547
7548 <COMPILEGCC>
7549 <VERDICT_LEAF PASS>
7550 <MODULE TTCN Temp Temp.ttcn>
7551 module Temp {
7552 type record Rec {
7553 charstring cs optional
7554 }
7555 type component CT {}
7556
7557 testcase tc() runs on CT
7558 {
7559 var Rec r := {cs := "12.0.0.1"};
7560 var CT c1 := CT.create(r.cs);
7561 var CT c2 := CT.create(-, r.cs);
7562 var CT c3 := CT.create(r.cs, r.cs);
7563 }
7564 }
7565 <END_MODULE>
7566 <RESULT IF_PASS NEGATIVE>
7567 (?is)\berror:
7568 <END_RESULT>
7569 <END_TC>
7570 :exmp.
7571
7572 .*--------------------------------------------------------------------------*
7573 :h3.Adhoc - sizeof()/lengthof() DTEs
7574 .*--------------------------------------------------------------------------*
7575 :xmp tab=0.
7576
7577 <TC - Adhoc - sizeof()/lengthof() DTEs>
7578
7579 <EXECUTE>
7580 <VERDICT_LEAF PASS>
7581 <MODULE TTCN Temp Temp.ttcn>
7582 module Temp {
7583 type component CT {}
7584 type record of integer ROI;
7585 testcase tc_sizeof_lengthof_standard1() runs on CT {
7586 var template ROI tr_roI1 := { 1, permutation(2, 3), ? }
7587 if(lengthof(tr_roI1)==4) { setverdict(pass)}else { setverdict(fail) };
7588 template ROI tr_roI2 := {1, *, (2, 3) }
7589 if(lengthof(tr_roI2)==3){ setverdict(pass)}else { setverdict(fail) }; //DTE!!!!
7590 }
7591
7592 testcase tc_sizeof_lengthof_standard2() runs on CT {
7593 if(lengthof('1*F'H) ==3){ setverdict(pass)}else { setverdict(fail) }; //DTE???
7594 }
7595
7596 control {
7597 execute(tc_sizeof_lengthof_standard1())
7598 execute(tc_sizeof_lengthof_standard2())
7599 }
7600 }
7601 <END_MODULE>
7602 <MODULE CFG Temp Temp.cfg>
7603 [MODULE_PARAMETERS]
7604 [LOGGING]
7605 LogSourceInfo := Yes
7606 Logfile := "Temp%i.log"
7607 FileMask := LOG_ALL
7608 ConsoleMask := LOG_ALL
7609 [EXECUTE]
7610 Temp
7611 <END_MODULE>
7612 <RESULT IF_PASS NEGATIVE>
7613 (?is)\berror: Performing lengthof() operation on a template of type \@Temp.ROI with no exact length.
7614 <END_RESULT>
7615 <RESULT IF_PASS NEGATIVE>
7616 (?is)\berror: Performing lengthof() operation on a hexstring template with no exact length.
7617 <END_RESULT>
7618 <END_TC>
7619 :exmp.
7620
7621 .*--------------------------------------------------------------------------*
7622 :h3.Adhoc - sizeof()/lengthof() compilation errors
7623 .*--------------------------------------------------------------------------*
7624 :xmp tab=0.
7625
7626 <TC - Adhoc - sizeof()/lengthof() compilation errors>
7627
7628 <COMPILE>
7629 <VERDICT_LEAF PASS>
7630 <MODULE TTCN Temp Temp.ttcn>
7631 module Temp {
7632 type record of integer ROI;
7633 type component CT {}
7634 testcase tc_sizeof_lengthof_standard1() runs on CT {
7635 template ROI tr_roI4 := { 1, 2, 3, * } length(1..2) ; //compilation error
7636 if(lengthof(tr_roI4)==3) { setverdict(fail) };
7637 }
7638 }
7639 <END_MODULE>
7640 <RESULT IF_PASS NEGATIVE>
7641 (?is)\berror: There are more (at least 3) elements in the template than it is allowed by the length restriction (at most 2)
7642 <END_RESULT>
7643 <END_TC>
7644 :exmp.
7645
7646 .*--------------------------------------------------------------------------*
7647 :h3.Adhoc - Additional RAW attribute checks for LENGTHTO
7648 .*--------------------------------------------------------------------------*
7649 :xmp tab=0.
7650
7651 <TC - Additional RAW attribute checks for LENGTHTO>
7652
7653 <COMPILE>
7654 <VERDICT_LEAF PASS>
7655 <MODULE TTCN Temp Temp.ttcn>
7656 module Temp {
7657 type union myu_ok { integer a, integer b }
7658 type union myu_nok { integer a, charstring b }
7659 type record of integer mylist
7660 type record myr1 {
7661 boolean f1,
7662 integer f2,
7663 charstring f3
7664 } with {
7665 variant (f2) "LENGTHTO (f3)"
7666 }
7667 type record myr2 {
7668 integer f1,
7669 myu_ok f2,
7670 charstring f3
7671 } with {
7672 variant (f2) "LENGTHTO (f3)"
7673 }
7674 type record myr3 {
7675 integer f1,
7676 myu_nok f2,
7677 charstring f3
7678 } with {
7679 variant (f2) "LENGTHTO (f3)"
7680 }
7681 type record myr4 {
7682 integer f1,
7683 mylist f2,
7684 charstring f3
7685 } with {
7686 variant (f2) "LENGTHTO (f3)"
7687 }
7688 type record myr5 {
7689 charstring f1,
7690 charstring f2
7691 } with {
7692 variant (f1) "LENGTHTO (f2)"
7693 }
7694 } with { encode "RAW" }
7695 <END_MODULE>
7696 <RESULT IF_PASS COUNT 1>
7697 (?is)\berror: The union type LENGTHTO field must contain only integer fields
7698 <END_RESULT>
7699 <RESULT IF_PASS COUNT 1>
7700 (?is)\berror: The LENGTHTO field must be an integer or union type instead of `\@Temp.mylist'
7701 <END_RESULT>
7702 <RESULT IF_PASS COUNT 1>
7703 (?is)\berror: The LENGTHTO field must be an integer or union type instead of `charstring'
7704 <END_RESULT>
7705 <RESULT IF_PASS COUNT 3>
7706 (?is)\berror:
7707 <END_RESULT>
7708 <END_TC>
7709 :exmp.
7710
7711 .*--------------------------------------------------------------------------*
7712 :h3.Adhoc - HQ43433 decode parameter check
7713 .*--------------------------------------------------------------------------*
7714 :xmp tab=0.
7715
7716 <TC - HQ43433 decode parameter check>
7717
7718 <EXECUTE>
7719 <VERDICT_LEAF PASS>
7720 <MODULE TTCN Temp Temp.ttcn>
7721 module Temp
7722 {
7723
7724 // type definition incl. RAW attribute
7725 type set S
7726 {
7727 integer i
7728 } with {
7729 variant (i) "BYTEORDER(last)";
7730 }
7731
7732 // wrapper functions for encoding/decoding
7733 function enc(S s) return bitstring {
7734 var bitstring bs;
7735 bs := encvalue(s);
7736 return bs;
7737 }
7738
7739 // BUG: TITAN SA does NOT report error when @m.dec.bs is not declared inout
7740 // Instead, the compiler generates erronous C++ code which brakes C++
7741 // compilation at function invocation (line marked below)
7742 function dec(/*inout*/ bitstring bs) return S {
7743 var S s;
7744 var integer i;
7745 // decvalue 1st par should be inout by standard?
7746 i := decvalue(bs, s);
7747 return s;
7748 }
7749
7750 function dec2(in bitstring bs) return S {
7751 var S s;
7752 var integer i;
7753 // decvalue 1st par should be inout by standard?
7754 i := decvalue(bs, s);
7755 return s;
7756 }
7757
7758 function dec3(out bitstring bs) return S {
7759 var S s;
7760 var integer i;
7761 var bitstring vl_bs:=bs;
7762 // decvalue 1st par should be inout by standard?
7763 i := decvalue(bs, s);
7764 return s;
7765 }
7766
7767 // inout
7768 function dec_inout(inout bitstring bs) return S {
7769 var S s;
7770 var integer i;
7771 // decvalue 1st par should be inout by standard?
7772 i := decvalue(bs, s);
7773 return s;
7774 }
7775
7776 type component MyComp {}
7777
7778 testcase tc_default() runs on MyComp {
7779 var S s := { i := 2 };
7780 var S s_mod;
7781 var bitstring bs;
7782 log("original:",s);
7783 bs := enc(s);
7784 log("encoded:",bs);
7785 s_mod := dec(bs);
7786 log("decoded:",s_mod);
7787 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7788 bs[1] := '1'B;
7789 log(bs);
7790 }
7791 testcase tc_in() runs on MyComp {
7792 var S s := { i := 2 };
7793 var S s_mod;
7794 var bitstring bs;
7795 log("original:",s);
7796 bs := enc(s);
7797 log("encoded:",bs);
7798 s_mod := dec2(bs);
7799 log("decoded:",s_mod);
7800 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7801
7802 }
7803 /* debate: out fv can use out param!! TR???
7804 testcase tc_out() runs on MyComp {
7805 var S s := { i := 2 };
7806 var S s_mod;
7807 var bitstring bs;
7808 log("original:",s);
7809 bs := enc(s);
7810 log("encoded:",bs);
7811 s_mod := dec3(bs);
7812 log("decoded:",s_mod);
7813 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7814 }
7815 */
7816
7817 testcase tc_inout() runs on MyComp {
7818 var S s := { i := 2 };
7819 var S s_mod;
7820 var bitstring bs;
7821 log("original:",s);
7822 bs := enc(s);
7823 log("encoded:",bs);
7824 s_mod := dec_inout(bs);
7825 log("decoded:",s_mod);
7826 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7827 }
7828
7829
7830 //======Another example=====
7831 type integer MyType
7832
7833 const MyType c_MyType := 42;
7834 const bitstring c_encoded := '00110011'B;
7835
7836 function f_decvalue_inpar( bitstring p_bit) {
7837 var MyType v_MyType;
7838 var bitstring vl_original:=p_bit;
7839 log( "Original input:",p_bit);
7840 log ("errCode: ",decvalue (p_bit,v_MyType)," ", vl_original, " is decodedTo: ",v_MyType, " remained:",
7841 p_bit)
7842 if(v_MyType==51 and p_bit==''B) { setverdict(pass)} else {setverdict(fail)}
7843 }
7844
7845
7846 function f_decvalue_inoutpar( inout bitstring p_bit) {
7847 var MyType v_MyType;
7848 var bitstring vl_original:=p_bit;
7849 log( "Original input:",p_bit);
7850 log ("errCode: ",decvalue (p_bit,v_MyType)," ", vl_original, " is decodedTo: ",v_MyType, " remained:",
7851 p_bit)
7852 if(v_MyType==51 and p_bit==''B) { setverdict(pass)} else {setverdict(fail)}
7853 }
7854
7855 testcase tc_2() runs on MyComp {
7856 var bitstring v_bit := c_encoded;
7857 f_decvalue_inoutpar(v_bit);
7858 f_decvalue_inpar(c_encoded);
7859 }
7860
7861 control
7862 {
7863 execute(tc_default());
7864 execute(tc_in());
7865 //execute(tc_out());
7866 execute(tc_inout());
7867 execute(tc_2());
7868 }
7869
7870 } with {
7871 encode "RAW"
7872 }
7873
7874
7875 <END_MODULE>
7876
7877 <MODULE CFG Temp Temp.cfg>
7878
7879 [MODULE_PARAMETERS]
7880 [LOGGING]
7881 LogSourceInfo := Yes
7882 Logfile := "Temp%i.log"
7883 FileMask := LOG_ALL
7884 ConsoleMask := LOG_ALL
7885 [EXECUTE]
7886 Temp
7887 <END_MODULE>
7888
7889 <RESULT>
7890 Overall verdict: pass
7891 <END_RESULT>
7892
7893
7894 <END_TC>
7895 :exmp.
7896
7897 .*--------------------------------------------------------------------------*
7898 :h3.Adhoc - @try @catch blocks no errors
7899 .*--------------------------------------------------------------------------*
7900 :xmp tab=0.
7901
7902 <TC - @try @catch blocks no errors>
7903
7904 <COMPILE>
7905 <VERDICT_LEAF PASS>
7906 <MODULE TTCN Temp Temp.ttcn>
7907 module Temp {
7908 type component MyComp {}
7909 function fv1() {
7910 @try {}
7911 @catch(e) {}
7912 }
7913 function fv2() return integer {
7914 @try {
7915 log(1);
7916 return 1;
7917 }
7918 @catch(e) {
7919 @try {
7920 log(e);
7921 return 2;
7922 }
7923 @catch(e2) {
7924 log(e2);
7925 return 3;
7926 }
7927 }
7928 }
7929 testcase tc() runs on MyComp {
7930 @try {
7931 @try {}
7932 @catch(e) {}
7933 }
7934 @catch(e) {}
7935 @try {}
7936 @catch(e) {}
7937 }
7938 control {
7939 @try {}
7940 @catch(e) {}
7941 }
7942 }
7943 <END_MODULE>
7944 <RESULT IF_PASS COUNT 0>
7945 (?is)\berror:
7946 <END_RESULT>
7947 <END_TC>
7948 :exmp.
7949
7950 .*--------------------------------------------------------------------------*
7951 :h3.Adhoc - @try @catch blocks semantic errors
7952 .*--------------------------------------------------------------------------*
7953 :xmp tab=0.
7954
7955 <TC - @try @catch blocks semantic errors>
7956
7957 <COMPILE>
7958 <VERDICT_LEAF PASS>
7959 <MODULE TTCN Temp Temp.ttcn>
7960 module Temp {
7961 type component MyComp {}
7962 function fv1() {
7963 var integer e;
7964 @try {}
7965 @catch(e) {}
7966 }
7967 function fv2() return integer {
7968 @try {
7969 log(1);
7970 return 1;
7971 }
7972 log(0);
7973 @catch(e) {
7974 @try {
7975 log(2);
7976 return 2;
7977 }
7978 @catch(e) {
7979 log(3);
7980 return 3;
7981 }
7982 }
7983 }
7984 testcase tc() runs on MyComp {
7985 @catch(e) {}
7986 @try {
7987 @try {}
7988 }
7989 @catch(e) {
7990 var integer i := e;
7991 }
7992 }
7993 control {
7994 @try {}
7995 @catch(dte_str) {
7996 const charstring dte_str := "";
7997 }
7998 }
7999 }
8000 <END_MODULE>
8001 <RESULT IF_PASS COUNT 2>
8002 (?is)\berror: Definition with identifier `e' is not unique in the scope hierarchy
8003 <END_RESULT>
8004 <RESULT IF_PASS COUNT 2>
8005 (?is)\berror: `try' statement block must be followed by a `catch' block
8006 <END_RESULT>
8007 <RESULT IF_PASS COUNT 2>
8008 (?is)\berror: `catch' statement block must be preceded by a `try' block
8009 <END_RESULT>
8010 <RESULT IF_PASS COUNT 1>
8011 (?is)\berror: The function has return type, but control might leave it without reaching a return statement
8012 <END_RESULT>
8013 <RESULT IF_PASS COUNT 1>
8014 (?is)\berror: Duplicate definition with identifier `dte_str'
8015 <END_RESULT>
8016 <RESULT IF_PASS COUNT 1>
8017 (?is)\berror: Type mismatch: a value of type `integer' was expected instead of `charstring'
8018 <END_RESULT>
8019 <RESULT IF_PASS COUNT 9>
8020 (?is)\berror:
8021 <END_RESULT>
8022 <END_TC>
8023 :exmp.
8024
8025 .*---------------------------------------------------------------------*
8026 :h3.Adhoc:: @try @catch blocks catching DTEs
8027 .*---------------------------------------------------------------------*
8028 :xmp tab=0.
8029 <TC - @try @catch blocks catching DTEs>
8030 <EXECUTE>
8031 <VERDICT_LEAF PASS>
8032 <MODULE TTCN Temp Temp.ttcn>
8033 module Temp {
8034 type component MyComp {}
8035 function safe_str2int(in charstring int_str, in integer defval) return integer {
8036 @try {
8037 return str2int(int_str);
8038 }
8039 @catch(err) {
8040 return defval;
8041 }
8042 }
8043 testcase TC1() runs on MyComp {
8044 if (safe_str2int("bread", -1)==-1) { setverdict(pass); }
8045 else { setverdict(fail); }
8046 }
8047 testcase TC2() runs on MyComp {
8048 var integer myEvilUnboundVariable;
8049 @try {
8050 myEvilUnboundVariable := myEvilUnboundVariable + 1;
8051 setverdict(fail);
8052 }
8053 @catch(e) {
8054 setverdict(pass);
8055 }
8056 }
8057 testcase TC3() runs on MyComp {
8058 @try {
8059 var integer i := 0;
8060 i := 10 / i;
8061 setverdict(fail);
8062 }
8063 @catch(e) {
8064 if (match(e, pattern "*division by zero*")) { setverdict(pass); }
8065 else { setverdict(fail); }
8066 }
8067 }
8068 control
8069 {
8070 execute(TC1());
8071 execute(TC2());
8072 execute(TC3());
8073 }
8074 }
8075 <END_MODULE>
8076 <MODULE CFG Temp Temp.cfg>
8077 [MODULE_PARAMETERS]
8078 [LOGGING]
8079 LogSourceInfo := Yes
8080 Logfile := "Temp%i.log"
8081 FileMask := LOG_ALL
8082 ConsoleMask := LOG_ALL
8083 [EXECUTE]
8084 Temp
8085 <END_MODULE>
8086 <RESULT IF_PASS COUNT 0>
8087 (?im)Dynamic test case error:
8088 <END_RESULT>
8089 <RESULT IF_PASS COUNT 1>
8090 (?im)Overall verdict: pass
8091 <END_RESULT>
8092 <END_TC>
8093 :exmp.
8094
8095 .*---------------------------------------------------------------------*
8096 :h3.Adhoc:: @lazy parameters - no errors
8097 .*---------------------------------------------------------------------*
8098 :xmp tab=0.
8099 <TC - @lazy parameters - no errors>
8100 <COMPILEGCC>
8101 <VERDICT_LEAF PASS>
8102 <MODULE TTCN Temp Temp.ttcn>
8103 module Temp
8104 {
8105 type component MyComp {}
8106 const charstring c := "c";
8107 testcase TC() runs on MyComp {
8108 var charstring a := "a";
8109 var charstring b := "b";
8110 var integer i1 := 100;
8111 var integer i2 := 20;
8112 var integer i3 := 3;
8113 MyFunc2(a&b&c&log2str(i1+i2+i3));
8114 setverdict(pass);
8115 }
8116 function MyFunc(in @lazy charstring str) {
8117 log(str);
8118 str := "huhuhu";
8119 log(str&str);
8120 }
8121 function MyFunc2(in @lazy charstring sz) {
8122 MyFunc(sz);
8123 }
8124 function MyFn1(in @lazy charstring str) return charstring {
8125 return str;
8126 }
8127 function MyFn2(in @lazy charstring s) return charstring {
8128 return MyFn2(s&MyFn1(s));
8129 }
8130 function MyFuncNormalEval(in charstring str, boolean b) {
8131 if (b) {
8132 var charstring s := str;
8133 if (s=="") { log(s); }
8134 }
8135 }
8136 function MyFuncLazyEval(in @lazy charstring str, boolean b) {
8137 if (b) {
8138 var charstring s := str;
8139 if (s=="") { log(s); }
8140 }
8141 }
8142 function Fdefaultpar( @lazy integer pi := 123 ) { log(pi); }
8143 function FuncTemplate(in template @lazy charstring tp) {
8144 tp := "huhu";
8145 log(tp);
8146 }
8147 function FuncTempl(in template @lazy charstring tp) {
8148 tp := ?;
8149 FuncTemplate(tp);
8150 }
8151 type record REC {
8152 REC rec optional,
8153 integer i
8154 }
8155 template REC trec(template @lazy integer pi) := {
8156 rec := *,
8157 i := pi
8158 }
8159 function usingRECfield(@lazy integer pi) {
8160 log(pi);
8161 }
8162 type record of integer RECOFINT;
8163 type record RECINT {
8164 RECOFINT ints optional,
8165 RECINT next optional
8166 }
8167 function usingRECINTfield(@lazy integer pi) {
8168 var integer ii := pi + 100;
8169 log(ii);
8170 }
8171 control {
8172 var template REC vrec := trec(?);
8173 var REC r := { rec:={ rec:={ rec:=omit, i:=3 }, i:=2 }, i:=1 }
8174 usingRECfield(r.rec.rec.i);
8175 var integer idx1 := 2;
8176 var integer idx2 := 4;
8177 var RECINT vrecint := { ints:=omit, next:={ ints:={1,2,3,4,5}, next:=omit} }
8178 usingRECINTfield(vrecint.next.ints[idx1+idx2-3]);
8179 FuncTemplate(?);
8180 FuncTempl(*);
8181 Fdefaultpar();
8182 execute(TC());
8183 }
8184 }
8185 <END_MODULE>
8186 <RESULT IF_PASS COUNT 0>
8187 (?im)error
8188 <END_RESULT>
8189 <END_TC>
8190 :exmp.
8191
8192 .*---------------------------------------------------------------------*
8193 :h3.Adhoc:: @lazy parameters - no runtime error
8194 .*---------------------------------------------------------------------*
8195 :xmp tab=0.
8196 <TC - @lazy parameters - no runtime error>
8197 <EXECUTE>
8198 <VERDICT_LEAF PASS>
8199 <MODULE TTCN Temp Temp.ttcn>
8200 module Temp {
8201 type component MyComp {}
8202 function DTEfunc(in charstring s) return charstring {
8203 testcase.stop;
8204 return s;
8205 }
8206 function LazyFunc(in boolean b, in @lazy charstring s) return charstring {
8207 if (b) {
8208 return "lazy";
8209 } else {
8210 return s;
8211 }
8212 }
8213 testcase LazyTC() runs on MyComp {
8214 log(LazyFunc(true, DTEfunc("x")));
8215 setverdict(pass);
8216 }
8217 control {
8218 execute(LazyTC());
8219 }
8220 }
8221 <END_MODULE>
8222 <MODULE CFG Temp Temp.cfg>
8223 [MODULE_PARAMETERS]
8224 [LOGGING]
8225 LogSourceInfo := Yes
8226 Logfile := "Temp%i.log"
8227 FileMask := LOG_ALL
8228 ConsoleMask := LOG_ALL
8229 [EXECUTE]
8230 Temp
8231 <END_MODULE>
8232 <RESULT IF_PASS COUNT 0>
8233 (?im)Dynamic test case error:
8234 <END_RESULT>
8235 <RESULT IF_PASS COUNT 1>
8236 (?im)Overall verdict: pass
8237 <END_RESULT>
8238 <END_TC>
8239 :exmp.
8240
8241 .*--------------------------------------------------------------------------*
8242 :h3.Adhoc - @lazy parameters - semantic errors
8243 .*--------------------------------------------------------------------------*
8244 :xmp tab=0.
8245
8246 <TC - @lazy parameters - semantic errors>
8247
8248 <COMPILE>
8249 <VERDICT_LEAF PASS>
8250 <MODULE TTCN Temp Temp.ttcn>
8251 module Temp {
8252 type function FT(in charstring str);
8253 function FTinst(in @lazy charstring str) {}
8254 type function FT2(in @lazy charstring str);
8255 control {
8256 var FT ft1 := refers(FTinst);
8257 ft1.apply("hehe");
8258 }
8259 }
8260 <END_MODULE>
8261 <RESULT IF_PASS COUNT 1>
8262 (?is)\berror: Formal parameter `str' cannot be \@lazy, not supported in this case.
8263 <END_RESULT>
8264 <RESULT IF_PASS COUNT 1>
8265 (?is)\berror: Parameter \@lazy-ness mismatch
8266 <END_RESULT>
8267 <RESULT IF_PASS COUNT 2>
8268 (?is)\berror:
8269 <END_RESULT>
8270 <END_TC>
8271 :exmp.
8272
8273 .*---------------------------------------------------------------------*
8274 :h3.Adhoc:: @lazy parameters - correct lazy evaluation
8275 .*---------------------------------------------------------------------*
8276 :xmp tab=0.
8277 <TC - @lazy parameters - correct lazy evaluation>
8278 <EXECUTE>
8279 <VERDICT_LEAF PASS>
8280 <MODULE TTCN Temp Temp.ttcn>
8281 module Temp {
8282 type component MyComp2 {
8283 var integer ci := 0;
8284 }
8285 function FN2() runs on MyComp2 return integer {
8286 if (ci==0) { testcase.stop("ci==0 error!"); }
8287 return ci;
8288 }
8289 function Lazy2(in @lazy integer pi) runs on MyComp2 {
8290 ci := 11;
8291 var integer vi := pi; // evaluated: 3*11 = 33
8292 if (vi!=33) { setverdict(fail); }
8293 ci := 0;
8294 vi := pi; // not evaled -> 33
8295 if (vi!=33) { setverdict(fail); }
8296 }
8297 testcase TC2() runs on MyComp2 {
8298 Lazy2(3*FN2());
8299 setverdict(pass);
8300 }
8301 control {
8302 execute(TC2());
8303 }
8304 }
8305 <END_MODULE>
8306 <MODULE CFG Temp Temp.cfg>
8307 [MODULE_PARAMETERS]
8308 [LOGGING]
8309 LogSourceInfo := Yes
8310 Logfile := "Temp%i.log"
8311 FileMask := LOG_ALL
8312 ConsoleMask := LOG_ALL
8313 [EXECUTE]
8314 Temp
8315 <END_MODULE>
8316 <RESULT IF_PASS COUNT 0>
8317 (?im)Dynamic test case error:
8318 <END_RESULT>
8319 <RESULT IF_PASS COUNT 1>
8320 (?im)Overall verdict: pass
8321 <END_RESULT>
8322 <END_TC>
8323 :exmp.
8324
8325 .*---------------------------------------------------------------------*
8326 :h3.Adhoc:: modulepar invalid simple type: component, port, default
8327 .*---------------------------------------------------------------------*
8328 :xmp tab=0.
8329 <TC - Adhoc::modulepar invalid type - component, port, default>
8330 <COMPILE>
8331 <VERDICT_LEAF FAIL>
8332 <MODULE TTCN Temp Temp.ttcn>
8333 module Temp {
8334 modulepar comp_CT tsp_Comp;
8335 modulepar port_PT tsp_Port;
8336 modulepar default_DT tsp_Def;
8337 type component comp_CT {
8338 var integer v_int := 0;
8339 }
8340 type port port_PT message {
8341 inout charstring
8342 }
8343 type default default_DT;
8344 }
8345 <END_MODULE>
8346 <RESULT IF_FAIL COUNT 3>
8347 (?is)\berror:
8348 <END_RESULT>
8349 <RESULT IF_FAIL POSITIVE>
8350 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
8351 <END_RESULT><END_TC>
8352 :exmp.
8353
8354 .*------------------------------------------------------------------------------------*
8355 :h3.Adhoc:: modulepar invalid compound type: record, set with component, default
8356 .*------------------------------------------------------------------------------------*
8357 :xmp tab=0.
8358 <TC - Adhoc::modulepar invalid type - compound type>
8359 <COMPILE>
8360 <VERDICT_LEAF FAIL>
8361 <MODULE TTCN Temp Temp.ttcn>
8362 module Temp {
8363 modulepar invalidRec tsp_Rec;
8364 modulepar invalidSet tsp_Set;
8365 modulepar invalidUnion tsp_Union;
8366 type record invalidRec {
8367 integer varI1,
8368 default_DT varDT,
8369 charstring varStr
8370 }
8371 type set invalidSet {
8372 integer varI2,
8373 comp_CT varCT1,
8374 charstring varStr
8375 }
8376 type union invalidUnion {
8377 integer varI3,
8378 comp_CT varCT2
8379 }
8380 type default default_DT;
8381 type component comp_CT {
8382 var integer v_int := 0;
8383 }
8384 }
8385 <END_MODULE>
8386 <RESULT IF_FAIL COUNT 3>
8387 (?is)\berror:
8388 <END_RESULT>
8389 <RESULT IF_FAIL POSITIVE>
8390 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
8391 <END_RESULT><END_TC>
8392 :exmp.
8393
8394 .*------------------------------------------------------------------------------------*
8395 :h3.Adhoc:: modulepar invalid list: record of, set of and array with component, default
8396 .*------------------------------------------------------------------------------------*
8397 :xmp tab=0.
8398 <TC - Adhoc::modulepar invalid list - record of, set of and array with component, default>
8399 <COMPILE>
8400 <VERDICT_LEAF FAIL>
8401 <MODULE TTCN Temp Temp.ttcn>
8402 module Temp {
8403 modulepar ListRec tsp_ListRec;
8404 modulepar ListSet tsp_listSet;
8405 modulepar compArrayType tsp_compArray;
8406 type record of comp_CT ListRec;
8407 type set of default_DT ListSet;
8408 type comp_CT compArrayType[3];
8409 type default default_DT;
8410 type component comp_CT {
8411 var integer v_int := 0;
8412 }
8413 }
8414 <END_MODULE>
8415 <RESULT IF_FAIL COUNT 3>
8416 (?is)\berror:
8417 <END_RESULT>
8418 <RESULT IF_FAIL POSITIVE>
8419 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
8420 <END_RESULT><END_TC>
8421 :exmp.
8422
8423 .*-----------------------------------------------------------*
8424 :h3.Adhoc:: modulepar invalid type: circular type definition
8425 .*-----------------------------------------------------------*
8426 :xmp tab=0.
8427 <TC - Adhoc::modulepar invalid type - circular type definition>
8428 <COMPILE>
8429 <VERDICT_LEAF FAIL>
8430 <MODULE TTCN Temp Temp.ttcn>
8431 module Temp {
8432 modulepar invalidRec tsp_Rec;
8433 type record invalidRec {
8434 integer varI,
8435 invalidSet varSet,
8436 charstring varStr
8437 }
8438 type set invalidSet {
8439 invalidRec varRec,
8440 comp_CT varCT,
8441 charstring varStr
8442 }
8443 type component comp_CT {
8444 var integer v_int := 0;
8445 }
8446 }
8447 <END_MODULE>
8448 <RESULT IF_FAIL COUNT 1>
8449 (?im)\bcircular\b.+?\breference\b
8450 <END_RESULT>
8451 <RESULT IF_FAIL COUNT 2>
8452 (?is)\berror:
8453 <END_RESULT>
8454 <RESULT IF_FAIL POSITIVE>
8455 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
8456 <END_RESULT><END_TC>
8457 :exmp.
8458
8459 .*-----------------------------------------------------------*
8460 :h3.Adhoc:: record of [-] in type reference
8461 .*-----------------------------------------------------------*
8462 :xmp tab=0.
8463 <TC - record of [-] in type reference>
8464 <EXECUTE>
8465 <VERDICT_LEAF PASS>
8466 <MODULE TTCN Temp Temp.ttcn>
8467 module Temp {
8468 type record GetResponseX {
8469 record of record {
8470 charstring pcB,
8471 charstring pcB_1
8472 } pcB_list
8473 }
8474 type record MyRecord {
8475 GetResponseX.pcB_list[-] field1
8476 }
8477 type record of GetResponseX.pcB_list[-] MyPcB_list;
8478 type GetResponseX.pcB_list[-].pcB MyCharType;
8479 type port PCOType message {
8480 inout charstring;
8481 } with {extension "internal"}
8482 type component MTCType {
8483 const GetResponseX.pcB_list[-] cl_myRecord := cg_RecofElem;
8484 const GetResponseX.pcB_list[-].pcB cl_myChar := "O";
8485 var GetResponseX.pcB_list[-] vl_myRecValue;
8486 var GetResponseX.pcB_list[-].pcB vl_myCharValue1;
8487 var template GetResponseX.pcB_list[-] vl_myRecTempl1;
8488 var template GetResponseX.pcB_list[-].pcB vl_myCharTempl;
8489 port PCOType MyPCO_PT;
8490 }
8491 const GetResponseX.pcB_list[-] cg_RecofElem := {
8492 pcB := "0",
8493 pcB_1 := "1"
8494 }
8495 modulepar GetResponseX.pcB_list[-] tsp_RecofElem := {
8496 pcB := "0",
8497 pcB_1 := "1"
8498 }
8499 template GetResponseX.pcB_list[-] t_RecofElem := {
8500 pcB := "0",
8501 pcB_1 := "1"
8502 }
8503 function x (GetResponseX.pcB_list[-] pl_elem, template GetResponseX.pcB_list[-] plt_elem) {
8504 const GetResponseX.pcB_list[-] cl_myRecord1 := cg_RecofElem;
8505 const GetResponseX.pcB_list[-].pcB cl_myChar1 := "O";
8506 var GetResponseX.pcB_list[-] vl_myRecValue1;
8507 var GetResponseX.pcB_list[-].pcB vl_myCharValue2;
8508 var template GetResponseX.pcB_list[-] vl_myRecTempl2;
8509 var template GetResponseX.pcB_list[-].pcB vl_myCharTempl;
8510 }
8511 testcase tc(GetResponseX.pcB_list[-] pl_elem) runs on MTCType {
8512 const GetResponseX.pcB_list[-] cl_myRecord2 := cg_RecofElem;
8513 const GetResponseX.pcB_list[-].pcB cl_myChar2 := "O";
8514 var GetResponseX.pcB_list[-] vl_myRecValue2;
8515 var GetResponseX.pcB_list[-].pcB vl_myCharValue;
8516 var template GetResponseX.pcB_list[-] vl_myRecTempl3;
8517 var template GetResponseX.pcB_list[-].pcB vl_myCharTempl3;
8518 if (pl_elem.pcB == "0") { setverdict(pass)}
8519 else { setverdict (fail);}
8520 }
8521 altstep as_x (GetResponseX.pcB_list[-] pl_elem, template GetResponseX.pcB_list[-] plt_elem) runs on MTCType {
8522 const GetResponseX.pcB_list[-] cl_myRecord3 := cg_RecofElem;
8523 const GetResponseX.pcB_list[-].pcB cl_myChar3 := "O";
8524 var GetResponseX.pcB_list[-] vl_myRecValue3;
8525 var GetResponseX.pcB_list[-].pcB vl_myCharValue;
8526 var template GetResponseX.pcB_list[-] vl_myRecTempl4;
8527 var template GetResponseX.pcB_list[-].pcB vl_myCharTempl4;
8528 [] MyPCO_PT.receive { }
8529 }
8530 control
8531 {
8532 const GetResponseX.pcB_list[-] cl_myRecord4 := cg_RecofElem;
8533 const GetResponseX.pcB_list[-].pcB cl_myChar4 := "O";
8534 var GetResponseX.pcB_list[-] vl_myRecValue2;
8535 var GetResponseX.pcB_list[-].pcB vl_myCharValue;
8536 var template GetResponseX.pcB_list[-] vl_myRecTempl2;
8537 var template GetResponseX.pcB_list[-].pcB vl_myCharTempl2;
8538 var GetResponseX.pcB_list[-] v_RecofElem := {
8539 pcB := "0",
8540 pcB_1 := "1"
8541 }
8542 execute (tc(v_RecofElem));
8543 }
8544 }
8545 <END_MODULE>
8546 <MODULE CFG Temp Temp.cfg>
8547 [MODULE_PARAMETERS]
8548 [LOGGING]
8549 LogSourceInfo := Yes
8550 Logfile := "Temp%i.log"
8551 FileMask := LOG_ALL
8552 ConsoleMask := LOG_ALL
8553 [EXECUTE]
8554 Temp
8555 <END_MODULE>
8556 <RESULT IF_PASS COUNT 0>
8557 (?im)Dynamic test case error:
8558 <END_RESULT>
8559 <RESULT IF_PASS COUNT 1>
8560 (?im)Overall verdict: pass
8561 <END_RESULT>
8562 <END_TC>
8563 :exmp.
8564
8565 .*-----------------------------------------------------------*
8566 :h3.Adhoc:: HP36129: Check for component name correctness
8567 .*-----------------------------------------------------------*
8568 :xmp tab=0.
8569 <TC - HP36129: Check for component name correctness>
8570 <EXECUTE_PARALLEL>
8571 <VERDICT_LEAF PASS>
8572 <MODULE TTCN Temp Temp.ttcn>
8573 module Temp {
8574 type port PT message {
8575 inout charstring;
8576 } with { extension "internal" }
8577 type component C {
8578 port PT PCO;
8579 }
8580 function f1() runs on C{
8581 log("Halo");
8582 }
8583 testcase tc() runs on C {
8584 var C comp := C.create("Alma-a.!ta");
8585 comp.start(f1());
8586 all component.done;
8587 setverdict(pass);
8588 }
8589 control {
8590 execute(tc());
8591 }
8592 }
8593 <END_MODULE>
8594 <MODULE CFG Temp Temp.cfg>
8595 [MODULE_PARAMETERS]
8596 [LOGGING]
8597 LogSourceInfo := Yes
8598 "Alma-a.!ta".FileMask := WARNING
8599 ConsoleMask := LOG_ALL
8600 [EXECUTE]
8601 Temp.control
8602 <END_MODULE>
8603 <RESULT IF_PASS COUNT 0>
8604 (?im)Dynamic test case error:
8605 <END_RESULT>
8606 <RESULT IF_PASS COUNT 1>
8607 (?im)Overall verdict: pass
8608 <END_RESULT>
8609 <END_TC>
8610 :exmp.
8611
8612 *-----------------------------------------------------------*
8613 :h3.Adhoc:: HT23335: Type Infinity is not a valid value for type `integer' which as subtype (-1..65535)
8614 .*-----------------------------------------------------------*
8615 :xmp tab=0.
8616 <TC - HT23335: Type Infinity is not a valid value for type `integer' which as subtype (-1..65535)>
8617
8618 <COMPILE>
8619 <VERDICT_LEAF FAIL>
8620 <MODULE TTCN Temp Temp.ttcn>
8621 module Temp {
8622 const integer limes_i := 65535;
8623 const float limes_f2 := 65535.0;
8624 const float limes_f1 := -1.0;
8625 type record MyRecI {
8626 integer inum (-1..limes_i)
8627 };
8628 type record MyRecF {
8629 float fnum (limes_f1..limes_f2)
8630 };
8631
8632 template MyRecI t1 := { inum := (0..infinity) };
8633 template MyRecF t2 := { fnum := (-infinity..0.0) };
8634
8635 }
8636 <END_MODULE>
8637 <RESULT IF_FAIL COUNT 2>
8638 (?im)\Infinity is not a valid value for type\b
8639 <END_RESULT>
8640 <END_TC>
8641 :exmp.
8642
8643 :etext.
This page took 0.346117 seconds and 5 git commands to generate.