1 .******************************************************************************
2 .* Copyright (c) 2000-2014 Ericsson Telecom AB
3 .* All rights reserved. This program and the accompanying materials
4 .* are made available under the terms of the Eclipse Public License v1.0
5 .* which accompanies this distribution, and is available at
6 .* http://www.eclipse.org/legal/epl-v10.html
7 .******************************************************************************/
11 .* 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
15 .* Document header information
16 :docname.Test Description
17 :docno.20/152 91-CRL 113 200/3 Uen
21 :prep.ETH/XZR Krisztian Pandi
22 :appr.ETH/XZ (Gyula Koos)
25 :title.Test description of the TTCN-3 Semantic Analyzer: Adhoc tests
27 .*---------------------------------------------------------------------*
29 .*---------------------------------------------------------------------*
30 .*---------------------------------------------------------------------*
32 .*---------------------------------------------------------------------*
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
51 .*---------------------------------------------------------------------*
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
57 .*---------------------------------------------------------------------*
59 .*---------------------------------------------------------------------*
60 .*---------------------------------------------------------------------*
61 :h3.Adhoc - Duplicate definition
62 .*---------------------------------------------------------------------*
65 <TC - Adhoc - Duplicate definition>
69 <MODULE TTCN Temp Temp.ttcn>
79 (?im)duplicate.+?definition
82 (?im)previous.+?definition
88 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
94 .*---------------------------------------------------------------------*
95 :h3.Adhoc - Duplicated label
96 .*---------------------------------------------------------------------*
99 <TC - Adhoc - Duplicated label>
103 <MODULE TTCN Temp Temp.ttcn>
115 (?im)duplicate.+?label
118 (?im)previous.+?definition
124 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
130 .*---------------------------------------------------------------------*
131 :h3.Adhoc - goto label
132 .*---------------------------------------------------------------------*
135 <TC - Adhoc - goto label>
139 <MODULE TTCN Temp Temp.ttcn>
143 goto L1; // same scope
146 goto L2; // different scope 1 (to higher scope)
150 goto L3; // different scope 2 (to lower scope)
151 goto L4; // nonexistent label
157 (?im)label.+?\bnot\b.+?defined
163 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
169 .*---------------------------------------------------------------------*
170 :h3.Adhoc - loop alt guards
171 .*---------------------------------------------------------------------*
174 <TC - Adhoc - loop alt guards>
178 <MODULE TTCN Temp Temp.ttcn>
183 var boolean b := true;
187 // Statement::set_my_ags() -> case S_WHILE
188 [b==true] T1.timeout { while(true) { } }
189 [b] T2.timeout { while(true) { b:=0; } }
196 (?im)boolean.+?value.+?expected
202 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
208 .*---------------------------------------------------------------------*
209 :h3.Adhoc - Embedded statement block
210 .*---------------------------------------------------------------------*
211 Note: Statement blocks can be created.
214 <TC - Adhoc - Embedded statement block>
218 <MODULE TTCN Temp Temp.ttcn>
229 <RESULT IF_PASS NEGATIVE>
236 .*---------------------------------------------------------------------*
237 :h3.Adhoc - function instance
238 .*---------------------------------------------------------------------*
241 <TC - Adhoc - function instance>
245 <MODULE TTCN Temp Temp.ttcn>
248 type port MyPortType message { inout integer }
249 type component MyComponent { port MyPortType MyPort; }
250 function F() runs on MyComponent { }
252 testcase TC() runs on MyComponent {
260 (?im)\btoo\b.+?many.+?parameters
266 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
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.
280 <TC - Adhoc - action statement>
284 <MODULE TTCN Temp Temp.ttcn>
294 (?im)\bnotify\b.+?\bfiles\b.+?\bupdated\b
300 .*---------------------------------------------------------------------*
301 :h3.Adhoc - start/stop non-port/timer/component
302 .*---------------------------------------------------------------------*
305 <TC - Adhoc - start/stop non-port/timer/component>
309 <MODULE TTCN Temp Temp.ttcn>
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) {
319 testcase TC() runs on MyComponent {
335 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
341 .*---------------------------------------------------------------------*
342 :h3.Adhoc - start port operation with argument
343 .*---------------------------------------------------------------------*
346 <TC - Adhoc - start port operation with argument>
350 <MODULE TTCN Temp Temp.ttcn>
353 type port MyPortType message { inout integer }
354 type component MyComponent { port MyPortType MyPort; }
355 function F() runs on MyComponent { }
357 testcase TC() runs on MyComponent {
365 (?im)start.+?port.+?operation.+?cannot.+?have.+?argument
371 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
377 .*---------------------------------------------------------------------*
378 :h3.Adhoc - return type of signature
379 .*---------------------------------------------------------------------*
382 <TC - Adhoc - return type of signature>
386 <MODULE TTCN Temp Temp.ttcn>
389 signature Sig1() return integer;
391 signature Sig3() return integer;
393 type port MyPortType procedure { inout Sig1, Sig2 }
394 type component MyComponent { port MyPortType MyPort }
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);
406 (?im)missing.+?return.+?value
409 (?im)unexpected.+?return.+?value
412 (?im)signature.+?not.+?\bon\b.+?incoming.+?list
418 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
424 .*---------------------------------------------------------------------*
425 :h3.Adhoc - raising port, signature and default type
426 .*---------------------------------------------------------------------*
429 <TC - Adhoc - raising port, signature and default type>
433 <MODULE TTCN Temp Temp.ttcn>
436 signature Sig1(); // no exception!
437 type port MyPortType procedure { inout Sig1 }
438 type component MyComponent { port MyPortType MyPort }
440 testcase TC() runs on MyComponent {
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);
452 (?im)variable.+?cannot.+?\bbe\b.+?defined.+?\bfor\b.+?port
455 (?im)raise.+?parameter.+?port.+?cannot.+?\bbe\b.+?exception.+?type
458 (?im)signature.+?does.+?\bnot\b.+?have.+?exceptions
461 (?im)raise.+?parameter.+?default.+?cannot.+?\bbe\b.+?exception.+?type
464 (?im)raise.+?parameter.+?signature.+?cannot.+?\bbe\b.+?exception.+?type
470 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
476 .*---------------------------------------------------------------------*
477 :h3.Adhoc - any port operation with parameter
478 .*---------------------------------------------------------------------*
481 <TC - Adhoc - any port operation with parameter>
485 <MODULE TTCN Temp Temp.ttcn>
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;
496 testcase TC() runs on MyComponent {
498 []any port.receive(integer:?) { }
499 []any port.check(receive(integer:?)) { }
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:?)) { }
513 (?im)operation.+?\bany\b.+?port.+?cannot.+?have.+?parameter
519 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
525 .*---------------------------------------------------------------------*
526 :h3.Adhoc - any port operation with redirect
527 .*---------------------------------------------------------------------*
530 <TC - Adhoc - any port operation with redirect>
534 <MODULE TTCN Temp Temp.ttcn>
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;
545 testcase TC() runs on MyComponent {
549 []any port.receive(integer:?) -> value I { }
550 []any port.check(receive(integer:*) -> value I) { }
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) { }
564 (?im)operation.+?\bany\b.+?port.+?cannot.+?have.+?parameter\s*$
567 (?im)operation.+?\bany\b.+?port.+?cannot.+?have.+?value.+?redirect
570 (?im)operation.+?\bany\b.+?port.+?cannot.+?have.+?parameter.+?redirect
576 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
582 .*---------------------------------------------------------------------*
583 :h3.Adhoc - message based port operation with procedure based ports
584 .*---------------------------------------------------------------------*
587 <TC - Adhoc - message based port operation with procedure based ports>
591 <MODULE TTCN Temp Temp.ttcn>
595 type port MyPortType procedure { inout Sig }
596 type component MyComponent { port MyPortType MyPort; }
598 testcase TC() runs on MyComponent {
601 // TR-682: message based operation on procedure based port and vice versa
604 []MyPort.check(receive) { }
611 (?im)message.+?based.+?operation.+?procedure.+?based.+?port
617 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
623 .*---------------------------------------------------------------------*
624 :h3.Adhoc - procedure based port operation with message based ports
625 .*---------------------------------------------------------------------*
628 <TC - Adhoc - procedure based port operation with message based ports>
632 <MODULE TTCN Temp Temp.ttcn>
635 signature Sig() exception(integer);
636 type port MyPortType message { inout integer }
637 type component MyComponent { port MyPortType MyPort; }
639 testcase TC() runs on MyComponent {
640 MyPort.call(Sig:{ }, nowait);
641 MyPort.reply(Sig:{ });
642 MyPort.raise(Sig, 10);
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: ?)) { }
650 []MyPort.getcall(Sig:{ }) { }
651 []MyPort.getreply(Sig:{ }) { }
652 []MyPort.catch(Sig, integer: ?) { }
654 MyPort.call(Sig:{ }, 10.0) {
655 []MyPort.getreply(Sig:{ }) { }
656 []MyPort.catch(timeout) { }
663 (?im)procedure.+?based.+?operation.+?message.+?based.+?port
666 (?im)timeout.+?exception.+?message.+?based.+?port
672 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
678 .*---------------------------------------------------------------------*
679 :h3.Adhoc - blocking call: getreply refers to different port
680 .*---------------------------------------------------------------------*
683 <TC - Adhoc - blocking call: getreply refers to different port>
687 <MODULE TTCN Temp Temp.ttcn>
690 signature Sig() exception(integer);
692 type port MyPortType1 procedure { inout Sig }
693 type port MyPortType2 procedure { inout Sig }
695 type component MyComponent {
696 port MyPortType1 MyPort1;
697 port MyPortType2 MyPort2
700 testcase TC() runs on MyComponent {
701 MyPort1.call(Sig:{ }, 10.0) {
702 []MyPort2.getreply(Sig:{ }) { }
703 []MyPort2.getreply { }
704 []MyPort2.catch(Sig, integer: ?) { }
706 []MyPort2.catch(timeout) { }
713 (?im)operation.+?refers.+?\bto\b.+?different.+?port
719 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
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.
732 <TC - Adhoc - message type not present on outgoing list of port>
736 <MODULE TTCN Temp Temp.ttcn>
739 type port MyPortType message { out integer, float, charstring }
740 type component MyComponent { port MyPortType MyPort; }
742 testcase TC() runs on MyComponent {
743 MyPort.send('0111'B);
749 (?im)message.+?type.+?\bnot\b.+?\bon\b.+?outgoing.+?list
755 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
761 .*---------------------------------------------------------------------*
762 :h3.Adhoc - inconsistent port connections
763 .*---------------------------------------------------------------------*
766 <TC - Adhoc - inconsistent port connections>
770 <MODULE TTCN Temp Temp.ttcn>
773 type port MyPortType1 message {
774 out integer, float, boolean;
777 type port MyPortType2 message {
778 out bitstring, charstring, octetstring;
781 type component MyComponent {
782 port MyPortType1 MyPort1;
783 port MyPortType2 MyPort2;
786 testcase TC() runs on MyComponent {
787 connect(self:MyPort1, self:MyPort2);
793 (?im)connection.+?between.+?port.+?types.+?\bnot\b.+?consistent
796 (?im)outgoing.+?message.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
802 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
808 .*---------------------------------------------------------------------*
809 :h3.Adhoc - connecting message based port to procedure based port
810 .*---------------------------------------------------------------------*
813 <TC - Adhoc - connecting message based port to procedure based port>
817 <MODULE TTCN Temp Temp.ttcn>
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;
828 testcase TC() runs on MyComponent {
829 connect(self:MyPort1, self:MyPort2);
835 (?im)connection.+?between.+?port.+?types.+?\bnot\b.+?consistent
838 (?im)outgoing.+?message.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
841 (?im)outgoing.+?signature.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
847 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
853 .*---------------------------------------------------------------------*
854 :h3.Adhoc - inconsistent port connections (with two components)
855 .*---------------------------------------------------------------------*
858 <TC - Adhoc - inconsistent port connections (with two components)>
862 <MODULE TTCN Temp Temp.ttcn>
865 type port MyPortType1 message {
866 out integer, float, boolean;
869 type port MyPortType2 message {
870 out bitstring, charstring, octetstring;
873 type component MyComponent1 { port MyPortType1 MyPort1 }
874 type component MyComponent2 { port MyPortType2 MyPort2 }
876 testcase TC() runs on MyComponent1 {
877 var MyComponent2 comp2;
878 connect(self:MyPort1, comp2:MyPort2);
884 (?im)connection.+?between.+?port.+?types.+?\bnot\b.+?consistent
887 (?im)outgoing.+?message.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
893 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
899 .*---------------------------------------------------------------------*
900 :h3.Adhoc - connecting message based port to procedure based port (with two components)
901 .*---------------------------------------------------------------------*
904 <TC - Adhoc - connecting message based port to procedure based port (with two components)>
908 <MODULE TTCN Temp Temp.ttcn>
912 type port MyPortType1 message { inout integer }
913 type port MyPortType2 procedure { inout Sig }
915 type component MyComponent1 { port MyPortType1 MyPort1 }
916 type component MyComponent2 { port MyPortType2 MyPort2 }
918 testcase TC() runs on MyComponent1 {
919 var MyComponent2 comp2;
920 connect(self:MyPort1, comp2:MyPort2);
926 (?im)connection.+?between.+?port.+?types.+?\bnot\b.+?consistent
929 (?im)outgoing.+?message.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
932 (?im)outgoing.+?signature.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
938 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
944 .*---------------------------------------------------------------------*
945 :h3.Adhoc - mapping internal ports
946 .*---------------------------------------------------------------------*
949 <TC - Adhoc - mapping internal ports>
953 <MODULE TTCN Temp Temp.ttcn>
957 type port MyPortType1 message { inout integer } with { extension "internal" }
958 type port MyPortType2 procedure { inout Sig } with { extension "internal" }
960 type component MyComponent {
961 port MyPortType1 MyPort1;
962 port MyPortType2 MyPort2;
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);
974 (?im)port.+?type.+?marked.+?\bas\b.+?internal
980 .*---------------------------------------------------------------------*
981 :h3.Adhoc - inconsistent port mappings
982 .*---------------------------------------------------------------------*
985 <TC - Adhoc - inconsistent port mappings>
989 <MODULE TTCN Temp Temp.ttcn>
992 type port MyPortType1 message {
993 out integer, float, boolean;
996 type port MyPortType2 message {
997 out bitstring, charstring, octetstring;
1000 type component MyComponent {
1001 port MyPortType1 MyPort1;
1002 port MyPortType2 MyPort2;
1005 testcase TC() runs on MyComponent system MyComponent {
1006 map(self:MyPort1, system:MyPort2);
1012 (?im)mapping.+?between.+?port.+?type.+?\bnot\b.+?consistent
1015 (?im)outgoing.+?message.+?type.+?\bnot\b.+?present.+?\bon\b.+?outgoing.+?list
1018 (?im)incoming.+?message.+?type.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
1024 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1030 .*---------------------------------------------------------------------*
1031 :h3.Adhoc - mapping message based port to procedure based port
1032 .*---------------------------------------------------------------------*
1035 <TC - Adhoc - mapping message based port to procedure based port>
1039 <MODULE TTCN Temp Temp.ttcn>
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;
1050 testcase TC() runs on MyComponent system MyComponent {
1051 map(self:MyPort1, system:MyPort2);
1057 (?im)mapping.+?between.+?port.+?type.+?\bnot\b.+?consistent
1060 (?im)outgoing.+?message.+?\bnot\b.+?present.+?\bon\b.+?outgoing.+?list
1063 (?im)incoming.+?signature.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
1069 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1075 .*---------------------------------------------------------------------*
1076 :h3.Adhoc - mapping procedure based port to message based port
1077 .*---------------------------------------------------------------------*
1080 <TC - Adhoc - mapping procedure based port to message based port>
1084 <MODULE TTCN Temp Temp.ttcn>
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;
1095 testcase TC() runs on MyComponent system MyComponent {
1096 map(self:MyPort2, system:MyPort1);
1102 (?im)mapping.+?between.+?port.+?type.+?\bnot\b.+?consistent
1105 (?im)outgoing.+?signature.+?\bnot\b.+?present.+?\bon\b.+?outgoing.+?list
1108 (?im)incoming.+?message.+?\bnot\b.+?present.+?\bon\b.+?incoming.+?list
1114 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1120 .*---------------------------------------------------------------------*
1121 :h3.Adhoc - executing non-testcase
1122 .*---------------------------------------------------------------------*
1125 <TC - Adhoc - executing non-testcase>
1129 <MODULE TTCN Temp Temp.ttcn>
1133 external function extF();
1152 (?im)reference.+?\bto\b.+?testcase.+?expected
1155 (?im)referenced.+?cannot.+?have.+?actual.+?parameters
1161 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1167 .*---------------------------------------------------------------------*
1168 :h3.Adhoc - return statement in control part
1169 .*---------------------------------------------------------------------*
1172 <TC - Adhoc - return statement in control part>
1176 <MODULE TTCN Temp Temp.ttcn>
1182 []T.timeout { return 0; }
1189 (?im)\bparse\b.+?\berror\b
1195 .*---------------------------------------------------------------------*
1196 :h3.Adhoc - port operation in control part
1197 .*---------------------------------------------------------------------*
1200 <TC - Adhoc - port operation in control part>
1204 <MODULE TTCN Temp Temp.ttcn>
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 { }
1214 []any port.check(receive) { }
1215 []any port.check(getcall) { }
1216 []any port.check(getreply) { }
1217 []any port.check(catch) { }
1224 (?im)port.+?operation.+?\bnot\b.+?allowed.+?\bin\b.+?control.+?part
1230 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1236 .*---------------------------------------------------------------------*
1237 :h3.Adhoc - port operation: redirect to constant
1238 .*---------------------------------------------------------------------*
1241 <TC - Adhoc - port operation: redirect to constant>
1245 <MODULE TTCN Temp Temp.ttcn>
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; }
1254 const integer cI:=0;
1255 const bitstring cBS:=''B;
1256 const charstring cCS:="";
1258 testcase TC() runs on MyComponent {
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) { }
1270 (?im)reference.+?\bto\b.+?variable.+?\bor\b.+?value.+?parameter.+?expected
1276 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1282 .*---------------------------------------------------------------------*
1283 :h3.Adhoc - port operation: redirect to type
1284 .*---------------------------------------------------------------------*
1287 <TC - Adhoc - port operation: redirect to type>
1291 <MODULE TTCN Temp Temp.ttcn>
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; }
1302 type charstring tCS;
1304 testcase TC() runs on MyComponent {
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) { }
1316 (?im)reference.+?\bto\b.+?variable.+?\bor\b.+?value.+?parameter.+?expected
1322 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1328 .*---------------------------------------------------------------------*
1329 :h3.Adhoc - check port operation: sender redirect
1330 .*---------------------------------------------------------------------*
1333 <TC - Adhoc - check port operation: sender redirect>
1337 <MODULE TTCN Temp Temp.ttcn>
1340 type port MyPortType message { inout integer }
1341 type component MyComponent { port MyPortType MyPort; }
1343 testcase TC() runs on MyComponent {
1344 var MyComponent Peer;
1346 []MyPort.check (-> sender Peer) { }
1352 <RESULT IF_PASS NEGATIVE>
1359 .*---------------------------------------------------------------------*
1360 :h3.Adhoc - component operation in control part
1361 .*---------------------------------------------------------------------*
1364 <TC - Adhoc - component operation in control part>
1368 <MODULE TTCN Temp Temp.ttcn>
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; }
1377 function F() runs on MyComponent { }
1380 var MyComponent C1, C2;
1381 // TR-683: Create and running component operations in control part
1382 C2 := MyComponent.create;
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!
1399 (?im)operation.+?create.+?\bnot\b.+?allowed.+?\bin\b.+?control.+?part
1402 (?im)operation.+?component.+?running.+?\bnot\b.+?allowed.+?\bin\b.+?control.+?part
1405 (?im)component.+?operation.+?\bnot\b.+?allowed.+?\bin\b.+?control.+?part
1411 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1417 .*---------------------------------------------------------------------*
1418 :h3.Adhoc - operations on not allowed component types
1419 .*---------------------------------------------------------------------*
1422 <TC - Adhoc - operations on not allowed component types>
1426 <MODULE TTCN Temp Temp.ttcn>
1429 type port MPortType message { inout integer }
1430 type component MyComponent { port MPortType MPort; }
1432 function F() runs on MyComponent { }
1434 const MyComponent Null := null;
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);
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; }
1453 (?im)operand.+?refers.+?\bto\b.+?null.+?component.+?reference
1456 (?im)null.+?component.+?reference.+?shall.+?not.+?used.+?operation
1459 (?im)both.+?endpoints.+?are.+?test.+?component.+?ports
1462 (?im)system.+?component.+?reference.+?shall.+?not.+?used.+?operation
1468 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1474 .*---------------------------------------------------------------------*
1475 :h3.Adhoc - create, map/unmap operation on non-component
1476 .*---------------------------------------------------------------------*
1479 <TC - Adhoc - create, map/unmap operation on non-component>
1483 <MODULE TTCN Temp Temp.ttcn>
1486 const integer cInt := 9;
1489 function F() runs on INT { }
1491 testcase TC() runs on INT system INT {
1492 var integer vInt := 10;
1494 map(vInt:MyPort, system:MyPort);
1495 unmap(vInt:MyPort, system:MyPort);
1501 (?im)reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?component.+?type
1504 (?im)type.+?\bof\b.+?operand.+?should.+?\bbe\b.+?component.+?type
1507 (?im)reference.+?\bto\b.+?component.+?type.+?expected
1513 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1519 .*---------------------------------------------------------------------*
1520 :h3.Adhoc - connect/disconnect on non-component
1521 .*---------------------------------------------------------------------*
1524 <TC - Adhoc - connect/disconnect operation on non-component>
1528 <MODULE TTCN Temp Temp.ttcn>
1531 const integer cInt := 9;
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);
1543 (?im)reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?component.+?type
1546 (?im)type.+?\bof\b.+?operand.+?should.+?\bbe\b.+?component.+?type
1549 (?im)component.+?reference.+?expected.+?\bas\b.+?operand
1555 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1561 .*---------------------------------------------------------------------*
1562 :h3.Adhoc - start/stop operation on non-component
1563 .*---------------------------------------------------------------------*
1566 <TC - Adhoc - start/stop operation on non-component>
1570 <MODULE TTCN Temp Temp.ttcn>
1573 const integer cInt := 9;
1576 function F() runs on INT { }
1578 testcase TC() runs on INT system INT {
1579 var integer vInt := 10;
1587 (?im)reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?component.+?type
1590 (?im)type.+?\bof\b.+?operand.+?should.+?\bbe\b.+?component.+?type
1596 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1602 .*---------------------------------------------------------------------*
1603 :h3.Adhoc - running/done operation on non-component
1604 .*---------------------------------------------------------------------*
1607 <TC - Adhoc - running/done operation on non-component>
1611 <MODULE TTCN Temp Temp.ttcn>
1614 const integer cInt := 9;
1615 const integer INT := 120;
1617 testcase TC() runs on INT system INT {
1618 var integer vInt := 10;
1627 (?im)reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?type
1630 (?im)type.+?\bof\b.+?operand.+?should.+?\bbe\b.+?component.+?type
1633 (?im)component.+?reference.+?expected
1639 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1645 .*---------------------------------------------------------------------*
1646 :h3.Adhoc - connect/map on non-port
1647 .*---------------------------------------------------------------------*
1650 <TC - Adhoc - connect/map on non-port>
1654 <MODULE TTCN Temp Temp.ttcn>
1657 type component MyComponent { var integer vInt; }
1659 testcase TC() runs on MyComponent system MyComponent {
1661 connect(C:vInt, self:vInt);
1662 map(self:vInt, system:vInt);
1668 (?im)definition.+?\bis\b.+?variable.+?\bnot\b.+?port
1674 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1680 .*---------------------------------------------------------------------*
1681 :h3.Adhoc - send/receive on non-port
1682 .*---------------------------------------------------------------------*
1685 <TC - Adhoc - send/receive on non-port>
1689 <MODULE TTCN Temp Temp.ttcn>
1692 type component MyComponent { var integer vInt; }
1694 testcase TC() runs on MyComponent system MyComponent {
1698 []lInt.receive(integer:?) { }
1705 (?im)reference.+?\bto\b.+?port.+?expected
1711 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1717 .*---------------------------------------------------------------------*
1718 :h3.Adhoc - call/getreply on non-port
1719 .*---------------------------------------------------------------------*
1722 <TC - Adhoc - call/getreply on non-port>
1726 <MODULE TTCN Temp Temp.ttcn>
1730 type component MyComponent { var integer vInt; }
1732 testcase TC() runs on MyComponent system MyComponent {
1734 vInt.call(Sig:{}, 10.0) {
1735 []vInt.getreply(Sig:{}) { }
1737 []vInt.catch(timeout) { }
1744 (?im)reference.+?\bto\b.+?port.+?expected
1750 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1756 .*---------------------------------------------------------------------*
1757 :h3.Adhoc - too few or too many parameters to reference
1758 .*---------------------------------------------------------------------*
1761 <TC - Adhoc - too few or too many parameters to reference>
1765 <MODULE TTCN Temp Temp.ttcn>
1768 function F(in integer A, in float B, in charstring E) { }
1772 F(0, 1.0, "two", '0011'B);
1778 (?im)\btoo\b.+?few.+?parameters
1781 (?im)\btoo\b.+?many.+?parameters
1787 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1793 .*---------------------------------------------------------------------*
1794 :h3.Adhoc - imported component element hides a definition at module scope
1795 .*---------------------------------------------------------------------*
1796 NOTE: causes only warning messages.
1799 <TC - Adhoc - imported component element hides a definition at module scope>
1803 <MODULE TTCN TempA TempA.ttcn>
1805 type component MyComponent { const integer Hidden := 9; }
1808 <MODULE TTCN TempB TempB.ttcn>
1810 import from TempA all;
1811 const integer Hidden := 9;
1812 testcase TC() runs on MyComponent { }
1816 (?im)warning.+?imported.+?component.+?element.+?definition.+?hides.+?definition.+?\bat\b.+?module.+?scope
1819 (?im)warning.+?hidden.+?definition.+?\bis\b.+?here
1825 .*---------------------------------------------------------------------*
1826 :h3.Adhoc - constant definition for port and signature
1827 .*---------------------------------------------------------------------*
1830 <TC - Adhoc - constant definition for port and signature>
1834 <MODULE TTCN Temp Temp.ttcn>
1837 type port MyPortType procedure { inout Sig }
1838 const Sig cSig := 0;
1839 const MyPortType cMyPort := 0;
1843 (?im)constant.+?cannot.+?\bbe\b.+?defined.+?for.+?signature
1846 (?im)constant.+?cannot.+?\bbe\b.+?defined.+?for.+?port.+?type
1852 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1858 .*---------------------------------------------------------------------*
1859 :h3.Adhoc - external constant definition for port and signature
1860 .*---------------------------------------------------------------------*
1863 <TC - Adhoc - external constant definition for port and signature>
1867 <MODULE TTCN Temp Temp.ttcn>
1870 type port MyPortType procedure { inout Sig }
1871 external const Sig cSig;
1872 external const MyPortType cMyPort;
1876 (?im)external.+?constant.+?cannot.+?\bbe\b.+?defined.+?for.+?signature
1879 (?im)external.+?constant.+?cannot.+?\bbe\b.+?defined.+?for.+?port.+?type
1885 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1891 .*---------------------------------------------------------------------*
1892 :h3.Adhoc - signature as module parameter
1893 .*---------------------------------------------------------------------*
1896 <TC - Adhoc - signature as module parameter>
1900 <MODULE TTCN Temp Temp.ttcn>
1909 (?im)type.+?\bof\b.+?module.+?parameter.+?cannot.+?\bbe\b.+?signature
1915 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1921 .*---------------------------------------------------------------------*
1922 :h3.Adhoc - template definition for port type
1923 .*---------------------------------------------------------------------*
1926 <TC - Adhoc - template definition for port type>
1930 <MODULE TTCN Temp Temp.ttcn>
1932 type port MyPortType message { inout integer; }
1933 template MyPortType tPort := 0;
1937 (?im)template.+?cannot.+?\bbe\b.+?defined.+?\bfor\b.+?port.+?type
1943 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1949 .*---------------------------------------------------------------------*
1950 :h3.Adhoc - modified template from non-template
1951 .*---------------------------------------------------------------------*
1954 <TC - Adhoc - modified template from non-template>
1958 <MODULE TTCN Temp Temp.ttcn>
1960 type record MyRecord { integer I, float F }
1961 const MyRecord cMyRecord := { 0, 1.0 }
1962 template MyRecord tMyRecord modifies cMyRecord := { F := 1.1 }
1966 (?im)reference.+?\bto\b.+?template.+?expected.+?\bin\b.+?modifies
1972 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
1978 .*---------------------------------------------------------------------*
1979 :h3.Adhoc - modified template with parameters
1980 .*---------------------------------------------------------------------*
1983 <TC - Adhoc - modified template with parameters>
1987 <MODULE TTCN Temp Temp.ttcn>
1989 type record MyRecord { integer I, float F }
1990 template MyRecord MyBaseT (integer pI, template float pF) := {
1995 template MyRecord MyModifiedT1 (integer pI) modifies MyBaseT := {
1999 // different kind of parameters
2000 template MyRecord MyModifiedT2 (template integer pI, float pF)
2001 modifies MyBaseT:= {
2005 // different type of parameters
2006 template MyRecord MyModifiedT3 (charstring pI, template octetstring pF)
2007 modifies MyBaseT:= {
2013 (?im)modified.+?template.+?has.+?fewer.+?formal.+?parameters.+?than.+?base.+?template
2016 (?im)kind.+?\bof\b.+?parameter.+?\bis\b.+?\bnot\b.+?\bthe\b.+?same.+?\bas\b.+?\bin\b.+?base.+?template
2019 (?im)type.+?\bof\b.+?parameter.+?\bis\b.+?\bnot\b.+?\bthe\b.+?same.+?\bas\b.+?\bin\b.+?base.+?template
2025 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2031 .*---------------------------------------------------------------------*
2032 :h3.Adhoc - variable definition for signature
2033 .*---------------------------------------------------------------------*
2036 <TC - Adhoc - variable definition for signature>
2040 <MODULE TTCN Temp Temp.ttcn>
2049 (?im)variable.+?cannot.+?\bbe\b.+?defined.+?for.+?signature
2055 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2061 .*---------------------------------------------------------------------*
2062 :h3.Adhoc - template variable for port type
2063 .*---------------------------------------------------------------------*
2066 <TC - Adhoc - template variable for port type>
2070 <MODULE TTCN Temp Temp.ttcn>
2072 type port MyPortType message { inout charstring }
2074 var template MyPortType tMyPort;
2079 (?im)template.+?variable.+?cannot.+?\bbe\b.+?defined.+?for.+?port.+?type
2085 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2091 .*---------------------------------------------------------------------*
2092 :h3.Adhoc - timer array without default duration
2093 .*---------------------------------------------------------------------*
2096 <TC - Adhoc - timer array without default duration>
2100 <MODULE TTCN Temp Temp.ttcn>
2110 (?im)timer.+?does.+?not.+?have.+?default.+?duration
2113 (?im)Reference.+?\bto\b.+?timer.+?array.+?without.+?array.+?index
2119 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2125 .*---------------------------------------------------------------------*
2126 :h3.Adhoc - timer array with empty array as default duration
2127 .*---------------------------------------------------------------------*
2130 <TC - Adhoc - timer array with empty array as default duration>
2134 <MODULE TTCN Temp Temp.ttcn>
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;
2146 (?im)Too.+?few.+?elements.+?\bin\b.+?default.+?duration.+?\bof\b.+?timer.+?array
2152 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2158 .*---------------------------------------------------------------------*
2159 :h3.Adhoc - timer array with default duration of type other then SEQOF
2160 .*---------------------------------------------------------------------*
2163 <TC - Adhoc - timer array with default duration of type other then SEQOF>
2167 <MODULE TTCN Temp Temp.ttcn>
2170 timer MyFaultyTimers1[10] := ":)";
2171 timer MyFaultyTimers2[Nonexi] := '0101'B;
2172 MyFaultyTimers1[0].start;
2173 MyFaultyTimers2[0].start;
2178 (?im)array.+?value.+?was.+?expected.+?\bas\b.+?default.+?duration.+?\bof\b.+?timer.+?array
2181 (?im)\bno\b.+?definition.+?Nonexi
2187 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2193 .*---------------------------------------------------------------------*
2194 :h3.Adhoc - reference does not refer to a port type
2195 .*---------------------------------------------------------------------*
2198 <TC - Adhoc - reference does not refer to a port type>
2202 <MODULE TTCN Temp Temp.ttcn>
2205 const integer cInt:=0;
2206 type component MyComponent {
2213 (?im)type.+?reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?port.+?type
2216 (?im)reference.+?does.+?\bnot\b.+?refer.+?\bto\b.+?\ba\b\s*type
2222 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2228 .*---------------------------------------------------------------------*
2229 :h3.Adhoc - port and signature cannot be the return type of a function
2230 .*---------------------------------------------------------------------*
2233 <TC - Adhoc - port and signature cannot be the return type of a function>
2237 <MODULE TTCN Temp Temp.ttcn>
2240 type port MyPort procedure { inout Sig }
2241 function F() return Sig { }
2242 function G() return MyPort { }
2246 (?im)value.+?\bof\b.+?signature.+?cannot.+?\bbe\b.+?return.+?type.+?\bof\b.+?function
2249 (?im)port.+?type.+?cannot.+?\bbe\b.+?return.+?type.+?\bof\b.+?function
2255 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2261 .*---------------------------------------------------------------------*
2262 :h3.Adhoc - starting a function with return type `default' on a PTC
2263 .*---------------------------------------------------------------------*
2266 <TC - Adhoc - starting a function with return type `default' on a PTC>
2270 <MODULE TTCN Temp Temp.ttcn>
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 }
2278 type altstep aref();
2279 type altstep aref_C() runs on MyComponent;
2280 type altstep aref_S() runs on self;
2282 function F() runs on MyComponent return default { return null; }
2284 testcase TC() runs on MyComponent {
2291 (?im)Default type cannot be sent or received on a port
2294 (?im)Altstep type .+ with 'runs on self' clause cannot be sent or received on a port
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
2303 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2309 .*---------------------------------------------------------------------*
2310 :h3.Adhoc - port and signature cannot be the return type of an external function
2311 .*---------------------------------------------------------------------*
2314 <TC - Adhoc - port and signature cannot be the return type of an external function>
2318 <MODULE TTCN Temp Temp.ttcn>
2321 type port MyPort procedure { inout Sig }
2322 external function F() return Sig;
2323 external function G() return MyPort;
2327 (?im)value.+?\bof\b.+?signature.+?cannot.+?\bbe\b.+?return.+?type.+?\bof\b.+?external.+?function
2330 (?im)port.+?type.+?cannot.+?\bbe\b.+?return.+?type.+?\bof\b.+?external.+?function
2336 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2342 .*---------------------------------------------------------------------*
2343 :h3.Adhoc - reference to omit value
2344 .*---------------------------------------------------------------------*
2347 <TC - Adhoc - reference to omit value>
2351 <MODULE TTCN Temp Temp.ttcn>
2353 type record MyType1 {
2357 type record MyType2 {
2361 template MyType1 T1 := { 1, omit };
2362 // TR-702: Optional field in record type
2363 template MyType2 T2 := { omit, T1.F };
2367 (?im)error.+?omit.+?not.+?allowed.+?context
2373 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2379 .*---------------------------------------------------------------------*
2380 :h3.Adhoc - reference to inactive template field
2381 .*---------------------------------------------------------------------*
2384 <TC - Adhoc - reference to inactive template field>
2388 <MODULE TTCN Temp Temp.ttcn>
2394 template MyType T1 := { I := 1 }
2395 template float T2 := T1.F;
2399 (?im)reference.+?\bto\b.+?inactive.+?field.+?\bin\b.+?template
2405 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2411 .*---------------------------------------------------------------------*
2412 :h3.Adhoc - reference to field of value list match
2413 .*---------------------------------------------------------------------*
2416 <TC - Adhoc - reference to field of value list match>
2420 <MODULE TTCN Temp Temp.ttcn>
2426 template MyType T1 := ({ I := 1 }, { I := 2 }, { F := 3.0 });
2427 template float T2 := T1.F;
2431 (?im)reference.+?\bto\b.+?field.+?\bof\b.+?value.+?list.+?match
2437 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2443 .*---------------------------------------------------------------------*
2444 :h3.Adhoc - valueof operation on field of a template which has no fields
2445 .*---------------------------------------------------------------------*
2448 <TC - Adhoc - valueof operation on field of a template which has no fields>
2452 <MODULE TTCN Temp Temp.ttcn>
2454 template integer tI := 1;
2456 // TR-691: Three error messages for valueof operation on template's
2457 // nonexistent filed
2458 var integer I := valueof(tI.Nonexi);
2463 (?im)invalid.+?field.+?reference.+?integer.+?does.+?not.+?have.+?fields
2469 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2471 <RESULT IF_FAIL POSITIVE>
2472 (?im)invalid.+?field.+?reference.+?integer.+?does.+?not.+?have.+?fields
2478 .*---------------------------------------------------------------------*
2479 :h3.Adhoc - referenced template array
2480 .*---------------------------------------------------------------------*
2483 <TC - Adhoc - referenced template array>
2487 <MODULE TTCN Temp Temp.ttcn>
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;
2498 var integer I := valueof(tI[-1]);
2499 var integer J := valueof(tI[1274]);
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);
2508 if(match(tI[cBS], I)) { }
2510 var template recofCharstring T:= {"first", "second"};
2511 const charstring temp := valueof(T[0]);
2516 (?im)non-negative.+?integer.+?value.+?expected
2519 (?im)index.+?overflow
2522 (?im)\bno\b.+?definition.+?Nonexi
2525 (?im)specific.+?value.+?expected.+?instead.+?\bof\b.+?omit
2528 (?im)value.+?\bor\b.+?expression.+?\bof\b.+?type.+?integer.+?expected
2531 (?im)reference.+?\bto\b.+?value.+?expected.+?instead.+?\bof\b.+?template
2537 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2539 <RESULT IF_FAIL COUNT 1>
2540 (?im)non-negative.+?integer.+?value.+?expected
2542 <RESULT IF_FAIL COUNT 1>
2543 (?im)index.+?overflow
2545 <RESULT IF_FAIL COUNT 1>
2546 (?im)\bno\b.+?definition.+?Nonexi
2548 <RESULT IF_FAIL COUNT 2>
2549 (?im)specific.+?value.+?expected.+?instead.+?\bof\b.+?omit
2551 <RESULT IF_FAIL COUNT 2>
2552 (?im)value.+?\bor\b.+?expression.+?\bof\b.+?type.+?integer.+?expected
2554 <RESULT IF_FAIL COUNT 2>
2555 (?im)reference.+?\bto\b.+?value.+?expected.+?instead.+?\bof\b.+?template
2561 .*---------------------------------------------------------------------*
2562 :h3.Adhoc - too many/few elements in value list for record template
2563 .*---------------------------------------------------------------------*
2566 <TC - Adhoc - too many/few elements in value list for record template>
2570 <MODULE TTCN Temp Temp.ttcn>
2572 type record MyType {
2576 template MyType T1 := { 0 }
2577 template MyType T2 := { 0, 1.0, 2 }
2581 (?im)\berror\b.+?too.+?few.+?elements.+?in.+?value.+?list
2584 (?im)\berror\b.+?too.+?many.+?elements.+?in.+?value.+?list
2590 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2596 .*---------------------------------------------------------------------*
2597 :h3.TTCN-3:: IsValue - for a type reference
2598 .*---------------------------------------------------------------------*
2600 <TC - TTCN-3::IsValue - for a type reference>
2604 <MODULE TTCN ModuleA ModuleA.ttcn>
2607 type record length (10) of integer int10;
2613 testcase tc_isvalue_const() runs on C1
2615 if ( isvalue(int10) ) {
2623 <RESULT IF_PASS COUNT 1>
2624 (?im)\bReference to a value or template was expected instead of type `@ModuleA.int10'
2626 <RESULT IF_PASS COUNT 1>
2629 <RESULT IF_PASS POSITIVE>
2630 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2636 .*---------------------------------------------------------------------*
2637 :h3.TTCN-3:: IsValue - for a port reference
2638 .*---------------------------------------------------------------------*
2640 <TC - TTCN-3::IsValue - for a port reference>
2644 <MODULE TTCN ModuleA ModuleA.ttcn>
2647 type record length (10) of integer int10;
2649 type port P1 message
2659 testcase tc_isvalue_const() runs on C1
2663 if ( isvalue(p1) ) {
2671 <RESULT IF_PASS COUNT 1>
2672 (?im)\bReference to a value or template was expected instead of port `@ModuleA.C1.p1'
2674 <RESULT IF_PASS COUNT 1>
2677 <RESULT IF_PASS POSITIVE>
2678 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2685 .*---------------------------------------------------------------------*
2686 :h3.TTCN-3:: IsValue - for a testcase reference
2687 .*---------------------------------------------------------------------*
2689 <TC - TTCN-3::IsValue - for a testcase reference>
2693 <MODULE TTCN ModuleA ModuleA.ttcn>
2696 type record length (10) of integer int10;
2702 testcase tc_isvalue_const() runs on C1
2704 var boolean dontcare1 := isvalue(tc_isvalue_const);
2708 <RESULT IF_PASS COUNT 1>
2709 (?im)\bReference to parameterized definition `tc_isvalue_const' without actual parameter list
2711 <RESULT IF_PASS COUNT 1>
2712 (?im)\bReference to a value or template was expected instead of testcase `@ModuleA.tc_isvalue_const'
2714 <RESULT IF_PASS COUNT 2>
2717 <RESULT IF_PASS POSITIVE>
2718 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2726 .*---------------------------------------------------------------------*
2727 :h3.Adhoc:: Function reference - used in expression, no return value
2728 .*---------------------------------------------------------------------*
2730 <TC - Adhoc::Function reference - used in expression, no return value>
2733 <MODULE TTCN x x.ttcn>
2736 type function f_FT();
2737 // a function which happens to be compatible with f_FT
2740 var f_FT f := refers(f_str);
2741 var charstring vl_result := f.apply() & "";
2745 <RESULT IF_FAIL COUNT 1>
2746 (?is)\berror: Reference.+?value.+?expected.+?invocation.+?behavior.+?no return type\b
2748 <RESULT IF_FAIL POSITIVE>
2749 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2754 .*---------------------------------------------------------------------*
2755 :h3.Adhoc:: Function reference - incompatible function type used for record func.ref. value
2756 .*---------------------------------------------------------------------*
2758 <TC - Adhoc::Function reference - incompatible function type used for record func.ref. value>
2761 <MODULE TTCN x x.ttcn>
2763 type record adat_rekord {
2764 function (integer par1, integer par2) return integer muv_f,
2765 function (in integer par) return verdicttype ell_f
2767 function fn1(integer par1, integer par2) return float { return 1.1; }
2768 function fn2(in integer par) return verdicttype { return pass; }
2771 var adat_rekord ar := { refers(fn1), refers(fn2) }
2775 <RESULT IF_FAIL COUNT 1>
2778 <RESULT IF_FAIL POSITIVE>
2779 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2784 .*---------------------------------------------------------------------*
2785 :h3.Adhoc:: Function reference - bogus dereference
2786 .*---------------------------------------------------------------------*
2788 <TC - Adhoc::Function reference - bogus dereference>
2791 <MODULE TTCN deref_bogus deref_bogus.ttcn>
2792 module deref_bogus {
2794 execute(derefers(Noexi)())
2799 (?im)There.+?is.+?no.+?local.+?imported.+?definition.+?name
2805 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2810 .*---------------------------------------------------------------------*
2811 :h3.Adhoc:: Named actual parameters - no such parameter in function
2812 .*---------------------------------------------------------------------*
2814 <TC - Adhoc::Named actual parameters - no such parameter in function>
2817 <MODULE TTCN nosuchname nosuchname.ttcn>
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)
2825 testcase tc1() runs on C1
2827 f1(1, 2.2, "3", pardon := 3);
2832 (?im)Function\s+`\S+'\s+has\s+no\s+formal\s+parameter
2838 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2843 .*---------------------------------------------------------------------*
2844 :h3.Adhoc:: Named actual parameters - no such parameter in altstep
2845 .*---------------------------------------------------------------------*
2847 <TC - Adhoc::Named actual parameters - no such parameter in altstep>
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)
2856 [] any timer.timeout { setverdict(pass); }
2859 testcase tc1() runs on C1
2861 f1(1, 2.2, "3", pardon := 3);
2866 (?im)Altstep\s+`\S+'\s+has\s+no\s+formal\s+parameter
2872 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2877 .*---------------------------------------------------------------------*
2878 :h3.Adhoc:: Named actual parameters - no such parameter in testcase
2879 .*---------------------------------------------------------------------*
2881 <TC - Adhoc::Named actual parameters - no such parameter in testcase>
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
2891 [] any timer.timeout { setverdict(pass); }
2897 execute(f1(1, 2.2, "3", pardon := 3));
2902 (?im)Testcase\s+`\S+'\s+has\s+no\s+?formal\s+?parameter
2908 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2913 .*---------------------------------------------------------------------*
2914 :h3.Adhoc:: Named actual parameters - not enough parameters in function
2915 .*---------------------------------------------------------------------*
2917 <TC - Adhoc::Named actual parameters - not enough parameters in function>
2920 <MODULE TTCN notenough notenough.ttcn>
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)
2928 testcase tc1() runs on C1
2935 (?im)Too.+?few.+?parameters:.+?least.+?expected.+?instead
2941 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2946 .*---------------------------------------------------------------------*
2947 :h3.Adhoc:: Named actual parameters - not enough parameters in altstep
2948 .*---------------------------------------------------------------------*
2950 <TC - Adhoc::Named actual parameters - not enough parameters in altstep>
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)
2959 [] any timer.timeout { setverdict(pass); }
2962 testcase tc1() runs on C1
2969 (?im)Too.+?few.+?parameters:.+?least.+?expected.+?instead
2975 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2980 .*---------------------------------------------------------------------*
2981 :h3.Adhoc:: Named actual parameters - parameter overriding in function
2982 .*---------------------------------------------------------------------*
2984 <TC - Adhoc::Named actual parameters - parameter overriding in function>
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)
2995 testcase tc1() runs on C1
2997 f1(1, 2.2, "3", par1 := 42, par4 := true);
3002 (?im)Formal parameter `\S+' assigned more than once
3008 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3013 .*---------------------------------------------------------------------*
3014 :h3.Adhoc:: Named actual parameters - parameter overriding in altstep
3015 .*---------------------------------------------------------------------*
3017 <TC - Adhoc::Named actual parameters - parameter overriding in altstep>
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)
3026 [] any timer.timeout { setverdict(pass); }
3029 testcase tc1() runs on C1
3031 f1(1, 2.2, "3", par1 := 42, par4 := true);
3036 (?im)Formal parameter `\S+' assigned more than once
3042 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3047 .*---------------------------------------------------------------------*
3048 :h3.Adhoc:: Named actual parameters - too many parameters in function
3049 .*---------------------------------------------------------------------*
3051 <TC - Adhoc::Named actual parameters - too many parameters in function>
3054 <MODULE TTCN toomany toomany.ttcn>
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)
3062 testcase tc1() runs on C1
3064 f1(13, 0.99, "foo", true, 'BAADF00D'H, -);
3069 (?im)Too.+?many.+?parameters.+?most.+?was.+?expected.+?instead
3075 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3080 .*---------------------------------------------------------------------*
3081 :h3.Adhoc:: Named actual parameters - too many parameters in altstep
3082 .*---------------------------------------------------------------------*
3084 <TC - Adhoc::Named actual parameters - too many parameters in altstep>
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)
3093 [] any timer.timeout { setverdict(pass); }
3096 testcase tc1() runs on C1
3098 f1(13, 0.99, "foo", true, 'BAADF00D'H, -);
3103 (?im)Too.+?many.+?parameters.+?most.+?was.+?expected.+?instead
3109 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3114 .*---------------------------------------------------------------------*
3115 :h3.Adhoc:: Named actual parameters - same parameter more than once in function
3116 .*---------------------------------------------------------------------*
3118 <TC - Adhoc::Named actual parameters - same parameter more than once in function>
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)
3129 testcase tc1() runs on C1
3131 f1(1, 1.1, "!!!!11one!!", par4 := true, par4 := true);
3136 (?im)Formal.+?parameter.+?assigned.+?more.+?than.+?once
3142 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3147 .*---------------------------------------------------------------------*
3148 :h3.Adhoc:: Named actual parameters - same parameter more than once in altstep
3149 .*---------------------------------------------------------------------*
3151 <TC - Adhoc::Named actual parameters - same parameter more than once in altstep>
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)
3160 [] any timer.timeout { setverdict(pass); }
3163 testcase tc1() runs on C1
3165 f1(1, 1.1, "!!!!11one!!", par4 := true, par4 := true);
3170 (?im)Formal.+?parameter.+assigned.+?more.+?than.+?once
3176 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3181 .*---------------------------------------------------------------------*
3182 :h3.Adhoc:: Named actual parameters - wrong type for parameters in function
3183 .*---------------------------------------------------------------------*
3185 <TC - Adhoc::Named actual parameters - wrong type for parameters in function>
3188 <MODULE TTCN wrongtype wrongtype.ttcn>
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)
3196 testcase tc1() runs on C1
3198 f1(1, 2.2, par3 := true, par4 := "true");
3203 (?im)boolean.+?value.+?expected
3206 (?im)character.+?string.+?value.+?was.+?expected
3212 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3217 .*---------------------------------------------------------------------*
3218 :h3.Adhoc:: Named actual parameters - TR922
3219 .*---------------------------------------------------------------------*
3221 <TC - Adhoc::Named actual parameters - TR922>
3224 <MODULE TTCN TR922 TR922.ttcn>
3228 // a do-nothing function
3229 function twoparfn(in integer foo, in integer bar){}
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;
3238 type record of integer integers;
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);
3252 var twopar fn := null;
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);
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);
3276 var twotc tc2 := null;
3277 execute(derefers(tc2)(42,)));
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);
3296 syntax error, unexpected '\)'
3299 syntax error, unexpected ';', expecting '\)' or ','
3305 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3310 .*---------------------------------------------------------------------*
3311 :h3.Adhoc:: Named actual parameters - wrong type for the parameters in altstep
3312 .*---------------------------------------------------------------------*
3314 <TC - Adhoc::Named actual parameters - wrong type for the parameters in altstep>
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)
3323 [] any timer.timeout { setverdict(pass); }
3326 testcase tc1() runs on C1
3328 f1(1, 2.2, par3 := true, par4 := "true");
3333 (?im)boolean.+?value.+?expected
3336 (?im)character.+?string.+?value.+?was.+?expected
3342 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3347 .*---------------------------------------------------------------------*
3348 :h3.Adhoc:: Assignment notation with array indices - unsuitable type indices
3349 .*---------------------------------------------------------------------*
3351 <TC - Adhoc::Assignment notation with array indices - unsuitable type indices>
3354 <MODULE TTCN unsuitable_indices unsuitable_indices.ttcn>
3355 module unsuitable_indices
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
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 }
3402 (?is)\berror:.+?A.+?value.+?or.+?expression.+?type.+?integer.+?was.+?expected
3405 (?is)\berror:.+?A.+?non-negative.+?integer.+?expected.+?indexing.+?instead.+?of
3408 (?is)\berror:.+?Indexed assignment notation cannot be used for record type
3411 (?is)\berror:.+?Value list notation cannot be used for set type
3414 (?is)\berror:.+?Array index underflow: the index value must be at least `0' instead of `-1'
3420 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
3425 .*---------------------------------------------------------------------*
3426 :h3.Adhoc:: Arrays with indexed assignment notation - Variables
3427 .*---------------------------------------------------------------------*
3429 <TC - Adhoc::Arrays with indexed assignment notation - Variables>
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
3439 // With one dynamic index.
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.
3455 (?is)\berror: Array index overflow: the index value must be at most `0' instead of `1'
3458 (?is)\berror: Array index overflow: the index value must be at most `0' instead of `2'
3461 (?is)\berror: Duplicate index value `0' for components `2' and `1'
3464 (?is)\berror: Duplicate index value `0' for components `3' and `1'
3467 (?is)\berror: Array index underflow: the index value must be at least `1' instead of `0'
3470 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `6'
3473 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `3'
3476 (?is)\berror: Duplicate index value `1' for components `2' and `1'
3482 (?im)\bnotify: Errors found in the input module. Code will not be generated.
3487 .*---------------------------------------------------------------------*
3488 :h3.Adhoc:: Arrays with indexed assignment notation - Constants
3489 .*---------------------------------------------------------------------*
3491 <TC - Adhoc::Arrays with indexed assignment notation - Constants>
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
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.
3512 (?is)\berror: Array index overflow: the index value must be at most `1' instead of `3'
3515 (?is)\berror: It's not allowed to create hole\(s\) in constant values
3518 (?is)\berror: Array index overflow: the index value must be at most `1' instead of `2'
3521 (?is)\berror: Duplicate index value `0' for components `2' and `1'
3524 (?is)\berror: Array index underflow: the index value must be at least `2' instead of `0'
3527 (?is)\berror: Array index overflow: the index value must be at most `4' instead of `6'
3530 (?is)\berror: Array index underflow: the index value must be at least `2' instead of `1'
3536 (?im)\bnotify: Errors found in the input module. Code will not be generated.
3541 .*---------------------------------------------------------------------*
3542 :h3.Adhoc:: Arrays with indexed assignment notation - Templates
3543 .*---------------------------------------------------------------------*
3545 <TC - Adhoc::Arrays with indexed assignment notation - Templates>
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
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.
3568 (?is)\berror: Array index overflow: the index value must be at most `0' instead of `1'
3571 (?is)\berror: Duplicate index value `0' for components `2' and `1'
3574 (?is)\berror: Array index underflow: the index value must be at least `1' instead of `0'
3577 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `6'
3580 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `3'
3586 (?im)\bnotify: Errors found in the input module. Code will not be generated.
3591 .*---------------------------------------------------------------------*
3592 :h3.Adhoc:: Arrays with indexed assignment notation - Timers
3593 .*---------------------------------------------------------------------*
3595 <TC - Adhoc::Arrays with indexed assignment notation - Timers>
3598 <MODULE TTCN IndexedArrayTimers IndexedArrayTimers.ttcn>
3599 module IndexedArrayTimers {
3600 type component Empty { }
3601 testcase tc() runs on Empty
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.
3613 (?is)\berror: Array index overflow: the index value must be at most `0' instead of `1'
3616 (?is)\berror: Duplicate index value `0' for timer array elements `2' and `1'
3619 (?is)\berror: Array index underflow: the index value must be at least `1' instead of `0'
3622 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `3'
3625 (?is)\berror: Array index overflow: the index value must be at most `2' instead of `4'
3631 (?im)\bnotify: Errors found in the input module. Code will not be generated.
3636 .*---------------------------------------------------------------------*
3637 :h3.Adhoc:: replace() predefined function - bad arguments
3638 .*---------------------------------------------------------------------*
3640 <TC - Adhoc::replace() predefined function - bad arguments>
3643 <MODULE TTCN bad_arguments bad_arguments.ttcn>
3644 module bad_arguments
3646 type component empty { }
3647 type record of integer intlist1
3648 type record of integer intlist2
3649 testcase tc () runs on empty
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])
3668 (?is)\berror:.+?Second operand of operation `replace\(\)' should not be negative
3671 (?is)\berror:.+?Fourth operand of operation `replace\(\)' is of type `bitstring', but a value of type `charstring' was expected here
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
3677 (?is)\berror:.+?Fourth operand of operation `replace\(\)' is of type `charstring', but a value of type `\@bad_arguments.intlist1' was expected here
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\)
3683 (?is)\berror:.+?Third operand `len' \(100\) is greater than the length of the first operand \(13\)
3686 (?is)\berror:.+?Second operand of operation `replace\(\)' should be integer value
3691 .*---------------------------------------------------------------------*
3692 :h3.Adhoc:: runs on self + refers in component type definition
3693 .*---------------------------------------------------------------------*
3695 <TC - runs on self + refers in component type definition>
3698 <MODULE TTCN MTTSM00016005 MTTSM00016005.ttcn>
3699 module MTTSM00016005
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);
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 { }
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'
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'
3728 .*---------------------------------------------------------------------*
3729 :h3.Adhoc:: large integers - array definitions
3730 .*---------------------------------------------------------------------*
3732 <TC - large integers - arrays and large integers>
3735 <MODULE TTCN LargeIntArr LargeIntArr.ttcn>
3738 type integer intarr1[2222222222222222222222222222222]
3739 type integer intarr2[1111111111111111111111111111111..2222222222222222222222222222222]
3740 type integer intarr3[1111111111111111111111111111111..1]
3741 type integer intarr4[2..2222222222222222222222222222222]
3747 (?is)\berror: The array size should be less than `2147483647' instead of `2222222222222222222222222222222'
3750 (?is)\berror: The lower bound of an array index should be less than `2147483647' instead of `1111111111111111111111111111111'
3753 (?is)\berror: The upper bound of an array index should be less than `2147483647' instead of `2222222222222222222222222222222'
3758 .*---------------------------------------------------------------------*
3759 :h3.Adhoc:: large integers - array indexing
3760 .*---------------------------------------------------------------------*
3762 <TC - large integers - array indexing>
3765 <MODULE TTCN LargeIntIndexing LargeIntIndexing.ttcn>
3766 module LargeIntIndexing
3768 type integer intarr4[4]
3770 const integer ci1 := 11111111111111111111111111111111111111
3771 var intarr4 iarr1 := {1, 2, 3, 4}
3772 var intarr4 iarr2 := {1, 2, 3, -444444444444444444444444444}
3774 iarr2[12345678910111213141516] := 1
3779 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `11111111111111111111111111111111111111'
3782 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `12345678910111213141516'
3787 .*---------------------------------------------------------------------*
3788 :h3.Adhoc:: large integers - universal charstring elements
3789 .*---------------------------------------------------------------------*
3791 <TC - large integers - universal charstring elements>
3794 <MODULE TTCN LargeIntUni LargeIntUni.ttcn>
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)
3805 (?is)\berror: The first number of quadruple \(group\) must be within the range 0 .. 127 instead of 11111111111111111111111111111111
3808 (?is)\berror: at or before token `-': syntax error, unexpected '-', expecting Number
3811 (?is)\berror: The second number of quadruple \(plane\) must be within the range 0 .. 255 instead of 12345678910111213141516171819202
3814 (?is)\berror: The second number of quadruple \(plane\) must be within the range 0 .. 255 instead of 22222222222222222222222222222222
3817 (?is)\berror: The third number of quadruple \(row\) must be within the range 0 .. 255 instead of 33333333333333333333333333333333
3820 (?is)\berror: The fourth number of quadruple \(cell\) must be within the range 0 .. 255 instead of 44444444444444444444444444444444
3825 .*---------------------------------------------------------------------*
3826 :h3.Adhoc:: large integers - timer arrays
3827 .*---------------------------------------------------------------------*
3829 <TC - large integers - timer arrays>
3832 <MODULE TTCN LargeIntTimer LargeIntTimer.ttcn>
3833 module LargeIntTimer
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}
3844 (?is)\berror: Array index overflow: the index value must be at most `0' instead of `11111111111111111111111111111111111111'
3847 (?is)\berror: Reference to a constant value was expected instead of variable `vi1'
3850 (?is)\berror: A value or expression of type float was expected
3853 (?is)\berror: An integer value less than `2147483647' was expected for indexing timer array instead of `22222222222222222222222222222222222222'
3858 .*---------------------------------------------------------------------*
3859 :h3.Adhoc:: large integers - indexed notation
3860 .*---------------------------------------------------------------------*
3862 <TC - large integers - indexed notation>
3865 <MODULE TTCN LargeIntIndexed LargeIntIndexed.ttcn>
3866 module LargeIntIndexed
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}
3883 (?is)\berror: An integer value less than `2147483647' was expected for indexing type `.+?intlist' instead of `11111111111111111111111111111111'
3886 (?is)\berror: An integer value less than `2147483647' was expected for indexing type `.+?intset' instead of `11111111111111111111111111111111'
3889 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `12345678910111213141516171819202'
3892 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `11111111111111111111111111111111'
3895 (?is)\berror: Duplicate index value `1' for components `5' and `4'
3900 .*---------------------------------------------------------------------*
3901 :h3.Adhoc:: large integers - the substr() predefined function
3902 .*---------------------------------------------------------------------*
3904 <TC - large integers - the substr() predefined function>
3907 <MODULE TTCN LargeIntSubstr LargeIntSubstr.ttcn>
3908 module LargeIntSubstr
3911 var charstring cs1 := substr("example1", 11111111111111111111111111111111, 1)
3912 var charstring cs2 := substr("example2", 1, 11111111111111111111111111111111)
3913 var charstring cs3 := substr("example3", 12345678910111213141516171819202, 11111111111111111111111111111111)
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\)
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\)
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\)
3929 .*---------------------------------------------------------------------*
3930 :h3.Adhoc:: large integers - enumerations
3931 .*---------------------------------------------------------------------*
3933 <TC - large integers - enumerations>
3936 <MODULE TTCN LargeIntEnum LargeIntEnum.ttcn>
3939 type enumerated enum1 {first(1111111111111111111111111111)}
3945 (?is)\berror: The numeric value of enumeration `first' \(1111111111111111111111111111\) is too large for being represented in memory
3950 .*---------------------------------------------------------------------*
3951 :h3.Adhoc:: large integers - integer subtypes
3952 .*---------------------------------------------------------------------*
3954 <TC - large integers - integer subtypes>
3957 <MODULE TTCN LargeIntSubtypes LargeIntSubtypes.ttcn>
3958 module LargeIntSubtypes
3960 type integer int1 (12345678910111213141516171819..0)
3961 type integer int2 (0..12345678910111213141516171819)
3962 type integer int3 (12345678910111213141516171819..12345678910111213141516171819)
3963 type integer int4[4] (12345678910111213141516171819)
3969 (?is)\berror: lower boundary is bigger than upper boundary in integer subtype range
3974 .*---------------------------------------------------------------------*
3975 :h3.Adhoc:: large integers - value range templates
3976 .*---------------------------------------------------------------------*
3978 <TC - large integers - value range templates>
3981 <MODULE TTCN LargeIntRange LargeIntRange.ttcn>
3982 module LargeIntRange
3984 template integer itemp1 := (12345678910111213141516..1)
3985 template integer itemp2 := (12345678910111213141516..1234567891011121314151617)
3986 template integer itemp3 := (1..1234567891011121314151617)
3987 template integer itemp4 := (11111111111111111111111111)
3993 (?is)\berror: The lower boundary is higher than the upper boundary
3998 .*---------------------------------------------------------------------*
3999 :h3.Adhoc:: large integers - the replace() predefined function
4000 .*---------------------------------------------------------------------*
4002 <TC - large integers - the replace() predefined function>
4005 <MODULE TTCN LargeIntReplace LargeIntReplace.ttcn>
4006 module LargeIntReplace
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)
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\)
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\)
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\)
4030 .*---------------------------------------------------------------------*
4031 :h3.Adhoc:: large integers - other predefined functions
4032 .*---------------------------------------------------------------------*
4034 <TC - large integers - other predefined functions>
4037 <MODULE TTCN LargeIntPredef LargeIntPredef.ttcn>
4038 module LargeIntPredef
4045 var universal charstring us1
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)
4063 (?is)\berror: Value 1234567891011121314151617181920 does not fit in length 1
4066 (?is)\berror: The length of the resulting string is too large for being represented in memory
4069 (?is)\berror: The operand of operation `int2char\(\)' should be in range 0..127
4072 (?is)\berror: First operand of operation `int2unichar\(\)' should be in range 0..2147483647
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
4080 .*---------------------------------------------------------------------*
4081 :h3.Adhoc:: large integers - length restrictions
4082 .*---------------------------------------------------------------------*
4084 <TC - large integers - length restrictions>
4087 <MODULE TTCN LargeIntLenRest LargeIntLenRest.ttcn>
4088 module LargeIntLenRest
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)
4107 (?is)\berror: There are fewer \(3\) elements in the template than it is allowed by the length restriction \(12345678910111213141516\)
4110 (?is)\berror: There are fewer \(3\) elements in the template than it is allowed by the length restriction \(at least 12345678910111213141516\)
4113 (?is)\berror: The upper boundary of the length restriction must be a non-negative integer value instead of -12345678910111213141516
4116 (?is)\berror: The lower boundary of the length restriction must be a non-negative integer value instead of -2
4119 (?is)\berror: The upper boundary of the length restriction \(1\) cannot be smaller than the lower boundary \(1111111111111111111111111111\)
4122 (?is)\berror: An integer value less than `2147483647' was expected as the upper boundary of the length restriction instead of `1111111111111111111111111111'
4125 (?is)\berror: An integer value less than `2147483647' was expected as the lower boundary of the length restriction instead of `1111111111111111111111111111'
4128 (?is)\berror: The number of elements allowed by the length restriction \(1111111111111111111111111111\) contradicts the array size \(1\)
4133 .*---------------------------------------------------------------------*
4134 :h3.Adhoc:: large integers - basic operations
4135 .*---------------------------------------------------------------------*
4137 <TC - large integers - basic operations>
4140 <MODULE TTCN LargeIntBasic LargeIntBasic.ttcn>
4141 module LargeIntBasic
4146 bs1 := bs1 << 1234567891011121314151617181920
4147 bs1 := bs1 >> 1234567891011121314151617181920
4148 cs1 := cs1 <@ 1234567891011121314151617181920
4149 cs1 := cs1 @> 1234567891011121314151617181920
4154 (?is)\berror: Right operand of operation `<<' should be less than `2147483647' instead of `1234567891011121314151617181920'
4157 (?is)\berror: Right operand of operation `>>' should be less than `2147483647' instead of `1234567891011121314151617181920'
4160 (?is)\berror: Right operand of operation `<@' should be less than `2147483647' instead of `1234567891011121314151617181920'
4163 (?is)\berror: Right operand of operation `@>' should be less than `2147483647' instead of `1234567891011121314151617181920'
4168 .*---------------------------------------------------------------------*
4169 :h3.Adhoc:: TR 921 - indexing string type template variables
4170 .*---------------------------------------------------------------------*
4172 <TC - TR 921 - indexing string type template variables>
4175 <MODULE TTCN TR921 TR921.ttcn>
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"
4187 if ('11'O == ost[0]) { }
4188 if (ost[0] == '11'O) { }
4193 if ("11" == cst[0]) { }
4194 if (cst[0] == "11") { }
4199 if ('11'B == bst[0]) { }
4200 if (bst[0] == '11'B) { }
4205 if ('11'H == hst[0]) { }
4206 if (hst[0] == '11'H) { }
4208 // Universal charstring.
4211 if ("11" == ust[0]) { }
4212 if (ust[0] == "11") { }
4218 (?is)\berror: Reference to a value was expected instead of template variable `ost'
4221 (?is)\berror: Reference to template variable `ost' can not be indexed
4224 (?is)\berror: Reference to a value was expected instead of template variable `cst'
4227 (?is)\berror: Reference to template variable `cst' can not be indexed
4230 (?is)\berror: Reference to a value was expected instead of template variable `bst'
4233 (?is)\berror: Reference to template variable `bst' can not be indexed
4236 (?is)\berror: Reference to a value was expected instead of template variable `hst'
4239 (?is)\berror: Reference to template variable `hst' can not be indexed
4242 (?is)\berror: Reference to a value was expected instead of template variable `ust'
4245 (?is)\berror: Reference to template variable `ust' can not be indexed
4250 .*---------------------------------------------------------------------*
4251 :h3.Adhoc:: pattern concatenation - pattern concatenation mistakes
4252 .*---------------------------------------------------------------------*
4254 <TC - pattern concatenation - pattern concatenation mistakes>
4257 <MODULE TTCN PatternCat PatternCat.ttcn>
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
4266 var integer myvar := 123
4267 var charstring cs := "xyz"
4268 var octetstring os := '0123'O
4270 var srec myrec := { "xyz" }
4271 mylist[0].s := "xyz"
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" }
4293 (?is)\berror: at or before token `12': syntax error, unexpected Number, expecting Identifier or Cstring
4296 (?is)\berror: at or before token `refers': syntax error, unexpected RefersKeyword, expecting Identifier or Cstring
4299 (?is)\berror: at or before token `\(': syntax error, unexpected '\('
4304 .*---------------------------------------------------------------------*
4305 :h3.Adhoc:: TR 935 - concatenation of incompatible list types
4306 .*---------------------------------------------------------------------*
4308 <TC - TR 935 - concatenation of incompatible list types>
4311 <MODULE TTCN TR935 TR935.ttcn>
4313 type record of integer intlist1
4314 type record of integer intlist2
4316 var intlist1 il1 := { 1, 2, 3 }
4317 var intlist2 il2 := { 4 }
4319 // Merge this small test-case later.
4323 <RESULT LTRT COUNT 1>
4324 (?is)\berror: The operands of operation `&' should be of compatible types
4329 .*---------------------------------------------------------------------*
4330 :h3.Adhoc:: Type Compatibility - Sample tests for structured types
4331 .*---------------------------------------------------------------------*
4333 <TC - Type Compatibility - Sample test for structured types>
4336 <MODULE TTCN Compat1 Compat1.ttcn>
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]
4355 var myrec1 r1 := { 1 }
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 }
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
4373 <RESULT LTRT COUNT 1>
4374 (?is)\berror: Type mismatch: a value of type `\@Compat1.myrec2' was expected instead of `\@Compat1.myrec1'
4376 <RESULT LTRT COUNT 1>
4377 (?is)\berror: Type mismatch: a value of type `\@Compat1.myrecof1' was expected instead of `integer\[4\]'
4379 <RESULT LTRT COUNT 3>
4380 (?is)\berror: The operands of operation `==' should be of compatible types
4382 <RESULT FTRT COUNT 1>
4383 (?is)\berror: Type mismatch: `\@Compat1.myrecof1' and `integer\[4\]' are not compatible: Incompatible record of/SEQUENCE OF subtypes
4385 <RESULT FTRT COUNT 1>
4386 (?is)\berror: Type mismatch: `@Compat1.myrecof1' and `@Compat1.myrecof3' are not compatible: Incompatible record of/SEQUENCE OF subtypes
4388 <RESULT LTRT COUNT 1>
4389 (?is)\berror: Type mismatch: a value or template of type `\@Compat1.myrec1' was expected instead of `\@Compat1.myrecof3'
4392 (?is)\berror: First operand of operation `substr\(\)' should be a string, `record of' or `set of' value
4397 .*---------------------------------------------------------------------*
4398 :h3.Adhoc:: Type Compatibility - Simple records and others
4399 .*---------------------------------------------------------------------*
4401 <TC - Type Compatibility - Records and others>
4404 <MODULE TTCN Compat2 Compat2.ttcn>
4406 type port MyPort message {
4409 inout myrec1_alias // !OK
4411 type component Empty {
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]
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
4441 P.receive(rec4) // !OK
4443 function f1_Compat2(in myrec1 p1) { }
4444 function f2_Compat2() return myrec1 {
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 } }
4453 altstep as1_Compat2(in myrec1 p1) runs on Empty { [p1.a > p1.a] T.timeout { } }
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 } }
4470 // Records <-> records.
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
4480 // Records <-> sets.
4483 execute(tc1_Compat2(set1)) // !OK
4484 f1_Compat2(set1) // !OK
4485 if (set1 == rec1 or rec1 != set1) { } // !OK
4487 // Records <-> set ofs.
4490 execute(tc1_Compat2(setof1)) // !OK
4491 f1_Compat2(setof1) // !OK
4492 if (setof1 == rec1 or rec1 != setof1) { } // !OK
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
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
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
4515 // Records <-> arrays (good dimension).
4518 execute(tc1_Compat2(arr1)) // OK
4519 f1_Compat2(arr1) // OK
4520 if (arr1 == rec1 or rec1 != arr1) { } // OK
4522 // Records <-> arrays (bad dimension).
4525 if (arr1 == rec4 or rec4 != arr1) { } // !OK
4527 // Records <-> unions.
4530 if (uni1 == rec1 or rec1 != uni1) { } // !OK
4532 // Records <-> anytypes.
4535 if (any1 == rec1 or rec1 != any1) { } // !OK
4537 // Unions <-> unions.
4540 if (uni1 == uni2 or uni2 == uni1) { } // OK
4542 // Unions <-> anytypes.
4545 if (uni1 == any1 or any1 == uni1) { } // !OK
4547 } with { extension "anytype myrec1, myrec2" }
4549 <RESULT FTRT COUNT 1>
4550 (?is)\berror: Duplicate incoming message type `\@Compat2.myrec1'
4552 <RESULT FTRT COUNT 1>
4553 (?is)\berror: Duplicate outgoing message type `\@Compat2.myrec1'
4555 <RESULT FTRT COUNT 2>
4556 (?is)\bnote: Type `\@Compat2.myrec1' is already listed here
4558 <RESULT FTRT COUNT 1>
4559 (?is)\berror: Message type `\@Compat2.myrec4' is not present on the outgoing list of port type `\@Compat2.MyPort'
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'
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
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
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
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
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
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
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
4585 <RESULT FTRT COUNT 4>
4586 (?is)\berror: Type mismatch: `\@Compat2.myrec1' and `\@Compat2.myrecof3' are not compatible: Incompatible record of/SEQUENCE OF subtypes
4588 <RESULT FTRT COUNT 2>
4589 (?is)\berror: Type mismatch: `\@Compat2.myrecof3' and `\@Compat2.myrec1' are not compatible: Incompatible record of/SEQUENCE OF subtypes
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
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
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
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
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
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
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
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
4618 .*---------------------------------------------------------------------*
4619 :h3.Adhoc:: Type Compatibility - Standard compile-time errors
4620 .*---------------------------------------------------------------------*
4622 <TC - Type Compatibility - Standard compile-time errors>
4625 <MODULE TTCN Compat3 Compat3.ttcn>
4626 // Compile-time errors from the standard.
4629 integer a(0..10) optional,
4630 integer b(0..10) optional,
4636 integer b(0..10) optional,
4665 type union U1 { integer i }
4666 type union U2 { integer i, boolean b }
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 }
4677 MyVarA := MyVarB // OK
4678 MyVarC := MyVarB // OK
4679 MyVarA := MyVarD // !OK
4680 MyVarA := MyVarE // !OK
4682 var FType MyVarF := { a := 1, c := true }
4683 MyVarF := MyVarA // !OK
4685 var anytype x := u1 // !OK
4687 } with { extension "anytype integer" }
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
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
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
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
4704 .*---------------------------------------------------------------------*
4705 :h3.Adhoc:: Type Compatibility - More complex types
4706 .*---------------------------------------------------------------------*
4708 <TC - Type Compatibility - More complex types>
4711 <MODULE TTCN Compat4 Compat4.ttcn>
4713 type record myrec1 {
4714 integer f1 optional,
4718 type record myrec2 {
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.
4728 var myarr1 arr1 := {
4729 { { omit, 99, false }, { 1, 100, true } },
4730 { { 1, 2, false }, { 0, 1, false } }
4732 var mylist2 ml2 := {
4733 { { 1, 2, false }, { 11, 22, false } },
4734 { { -1, -2, true }, { -11, -22, true } }
4738 if (arr1 == ml2 or ml2 != arr1) { } // !OK
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
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
4751 .*---------------------------------------------------------------------*
4752 :h3.Adhoc:: Type Compatibility - Arrays and other list types
4753 .*---------------------------------------------------------------------*
4755 <TC - Type Compatibility - Arrays and other list types>
4758 <MODULE TTCN Compat5 Compat5.ttcn>
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;
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
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
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
4778 <RESULT LTRT COUNT 1>
4779 (?is)\berror: Type mismatch: a value of type `integer\[3\]' was expected instead of `integer\[2..4\]'
4781 <RESULT LTRT COUNT 1>
4782 (?is)\berror: Type mismatch: a value of type `integer\[1..3\]' was expected instead of `integer\[2..4\]'
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\]'
4790 .*---------------------------------------------------------------------*
4791 :h3.Adhoc:: Type Compatibility - Templates of all kind
4792 .*---------------------------------------------------------------------*
4794 <TC - Type Compatibility - Templates of all kind>
4797 <MODULE TTCN Compat6 Compat6.ttcn>
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
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 };
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 }
4816 var template rtype tv1
4817 var template r2type tv2
4819 if (match(valueof(t), u1)) { }
4820 if (match(c_b1, t_b1)) { }
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
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
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
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
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
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'
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'
4845 <RESULT LTRT COUNT 1>
4846 (?is)\berror: Type mismatch: a value or template of type `\@Compat6.rtype' was expected instead of `\@Compat6.r2type'
4848 <RESULT LTRT COUNT 1>
4849 (?is)\berror: Type mismatch: a value or template of type `\@Compat6.s2type' was expected instead of `\@Compat6.rtype'
4851 <RESULT LTRT COUNT 1>
4852 (?is)\berror: Type mismatch: a value of type `\@Compat6.b1_intset' was expected instead of `\@Compat6.b1_intlist'
4860 .*---------------------------------------------------------------------*
4861 :h3.Adhoc:: Type Compatibility - Recursive types
4862 .*---------------------------------------------------------------------*
4864 <TC - Type Compatibility - Recursive types>
4867 <MODULE TTCN Compat6 Compat6.ttcn>
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 }
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 } } } }
4893 if (v_r.rof == omit) { }
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) { }
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
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
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
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
4914 <RESULT LTRT COUNT 4>
4915 (?is)\berror: The operands of operation `==' should be of compatible types
4917 <RESULT LTRT COUNT 1>
4918 (?is)\berror: The operands of operation `!=' should be of compatible types
4920 <RESULT LTRT COUNT 1>
4921 (?is)\berror: Type mismatch: a value of type `\@Compat6.c11' was expected instead of `\@Compat6.c22'
4923 <RESULT LTRT COUNT 1>
4924 (?is)\berror: Type mismatch: a value of type `\@Compat6.recR' was expected instead of `\@Compat6.recofR'
4926 <RESULT LTRT COUNT 1>
4927 (?is)\berror: Type mismatch: a value of type `\@Compat6.recofR' was expected instead of `\@Compat6.recR'
4932 .*---------------------------------------------------------------------*
4933 :h3.Adhoc:: Default values of modified parametrized templates
4934 .*---------------------------------------------------------------------*
4936 <TC - Default values of modified parametrized templates>
4939 <MODULE TTCN TDefPar TDefPar.ttcn>
4941 // Negative tests for ETSI CR5091.
4943 type record MyRecordType {
4944 integer field1 optional,
4949 // For value parameters.
4951 template MyRecordType MyTemplate1(integer p_int) := {
4957 template MyRecordType MyTemplate2(integer p_int := -) modifies MyTemplate1 := {
4961 template MyRecordType MyTemplate3(integer p_int := -) := {
4965 template MyRecordType MyTemplate4(integer p_int := 1, charstring p_str, boolean p_bool) := {
4966 p_int, p_str, p_bool
4969 template MyRecordType MyTemplate5(integer p_int := -, charstring p_str := -, boolean p_bool := -) modifies MyTemplate4 := {
4970 p_int, p_str, p_bool
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
4977 // For template parameters.
4979 template MyRecordType TMyTemplate1(template integer p_int) := {
4985 template MyRecordType TMyTemplate2(template integer p_int := -) modifies TMyTemplate1 := {
4989 template MyRecordType TMyTemplate3(template integer p_int := -) := {
4993 template MyRecordType TMyTemplate4(template integer p_int := 1, template charstring p_str, template boolean p_bool) := {
4994 p_int, p_str, p_bool
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
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
5005 template MyRecordType TMyTemplate7(template integer p_int := 0) modifies MyRecordType := {
5009 type component Empty { timer T := 1.0 }
5011 testcase TC1(in integer p1 := -) runs on Empty { }
5012 testcase TC2(in template integer p1 := -) runs on Empty { }
5014 function Func1(in integer p1 := -) { }
5015 function Func2(in template integer p1 := -) { }
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 { } }
5024 (?is)\berror: Not used symbol \(`-'\) doesn't have the corresponding default parameter in the base template
5027 (?is)\berror: Only modified templates are allowed to use the not used symbol \(`-'\) as the default parameter
5030 (?is)\berror: integer value was expected
5033 (?is)\berror: character string value was expected
5036 (?is)\berror: boolean value was expected
5039 (?is)\berror: octetstring value was expected
5042 (?is)\berror: Reference to a template was expected in the `modifies' definition instead of type `\@TDefPar.MyRecordType'
5050 *---------------------------------------------------------------------*
5051 :h3.Adhoc:: __SCOPE__ macro
5052 .*---------------------------------------------------------------------*
5054 <TC - __SCOPE__ macro>
5057 <MODULE TTCN TDefPar TDefPar.ttcn>
5059 // Negative tests for __SCOPE__ macro.
5061 type enumerated Dummy { Dummy1, Dummy2 };
5063 type record MyRecord {
5065 charstring field2 (__SCOPE__) optional
5068 type record MyRecord2 {
5070 charstring field2 (__SCOPE__)
5074 template MyRecord t_MyTemplate := {
5075 field1 := __SCOPE__,
5076 //field2 := __SCOPE__ //NOK MyRecord not equal with t_MyTemplate
5077 field2 := "MyRecord"
5080 template MyRecord2 t_MyTemplate2 := {
5082 field1 := __SCOPE__,
5091 (?is)\berror: "t_MyTemplate2" is not a valid value for type `charstring' which has subtype \("MyRecord"\)
5094 (?is)\berror: "t_MyTemplate2" is not a valid value for type `charstring' which has subtype \("MyRecord2"\)
5099 *---------------------------------------------------------------------*
5100 :h3.Adhoc:: public/private/friend
5101 .*---------------------------------------------------------------------*
5103 <TC - public/private/friend>
5106 <MODULE TTCN module1 module1.ttcn>
5110 public modulepar charstring ts_m1:="public";
5111 private modulepar charstring ts_m2:="private";
5112 friend modulepar charstring ts_m3:="friend";
5114 friend module module2;
5116 private import from module2 all;//OK
5117 private import from module3 all;//OK
5118 private import from module4 all;//OK
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
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
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!
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
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)
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
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
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
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
5174 var Lib4Private_CT v_Lib4Private := Lib4Private_CT.create; // NOK, the name Lib4Privae_CT is not visible in module1
5180 <MODULE TTCN module2 module2.ttcn>
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;
5191 /*private*/ group g_Group2{
5192 type integer module2Type2;
5193 public type integer module2TypePublic2;
5194 friend type integer module2TypeFriend2;
5195 private type integer module2TypePrivate2;
5198 /*friend*/ group g_Group3{
5199 type integer module2Type3;
5200 public type integer module2TypePublic3;
5201 friend type integer module2TypeFriend3;
5202 private type integer module2TypePrivate3;
5208 <MODULE TTCN module3 module3.ttcn>
5211 type integer module3Type;
5212 public type integer module3TypePublic;
5213 friend type integer module3TypeFriend;
5214 private type integer module3TypePrivate;
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"}
5222 <MODULE TTCN module4 module4.ttcn>
5225 friend module module1;
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;
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;
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;
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
5250 //These functions cannot be called or started outside module4, though they are public!
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
5258 <MODULE TTCN module5 module5.ttcn>
5261 /*public*/ import from module2 all;//NOK no public import
5264 <MODULE TTCN module6 module6.ttcn>
5267 /*friend*/ import from module2 all;//NOK no friend import
5272 (?is)\berror: There is no local or imported definition with name `module2TypePrivate'
5275 (?is)\berror: There is no local or imported definition with name `module3TypeFriend'
5278 (?is)\berror: There is no local or imported definition with name `module3TypePrivate'
5281 (?is)\berror: There is no local or imported definition with name `Lib4Private_CT'
5284 (?is)\berror: The member definition `v_Lib4_3' in component type `User_CT' is not visible in this scope
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'
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'
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'
5296 (?is)\berror: Operation `create()' is not allowed in control part
5301 *---------------------------------------------------------------------*
5302 :h3.Adhoc:: Subtyping - Verdicts
5303 .*---------------------------------------------------------------------*
5305 <TC - Subtyping - Verdicts>
5308 <MODULE TTCN module1 module1.ttcn>
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)
5322 modulepar myv1 mp1 := inconc
5324 function fv1() return myv1 { return inconc }
5325 function fv2(in myv1 p1 := inconc) { }
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()
5338 (?is)\berror: inconc is not a valid value for type `verdicttype' which has subtype \(none,pass,fail\)
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\)
5349 *---------------------------------------------------------------------*
5350 :h3.Adhoc:: Subtyping - Booleans
5351 .*---------------------------------------------------------------------*
5353 <TC - Subtyping - Booleans>
5356 <MODULE TTCN module1 module1.ttcn>
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)
5368 modulepar myb1 mp1 := false
5370 function fb1() return myb1 { return false }
5371 function fb2(in myb1 p1 := false) { }
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()
5384 (?is)\berror: false is not a valid value for type `boolean' which has subtype \(true\)
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\)
5395 *---------------------------------------------------------------------*
5396 :h3.Adhoc:: Subtyping - Integers
5397 .*---------------------------------------------------------------------*
5399 <TC - Subtyping - Integers>
5402 <MODULE TTCN module1 module1.ttcn>
5405 type integer myi1 (1, 2, 3)
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)
5414 const myi1 c_myi1 := 4
5415 const myi2 c_myi2 := c_myi1
5416 const myi8 c_myi3 := 100
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
5423 modulepar myi1 mp1 := 4
5424 modulepar myi5 mp2 := 32 // No error.
5426 function fi1() return myi1 { return 4 }
5427 function fi2(in myi1 p1 := 4) { }
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
5443 (?is)\berror: 100 is not a valid value for type `integer' which has subtype \(1..3,99,101\)
5446 (?is)\berror: 4 is not a valid value for type `integer' which has subtype \(1..3\)
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\)
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\)
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\)
5458 (?is)\berror: While checking circular type references in subtype definitions: Circular reference: `\@module1.myi6' -> `\@module1.myi7' -> `\@module1.myi6'
5466 *---------------------------------------------------------------------*
5467 :h3.Adhoc:: Subtyping - Floats
5468 .*---------------------------------------------------------------------*
5470 <TC - Subtyping - Floats>
5473 <MODULE TTCN module1 module1.ttcn>
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)
5482 const myf1 c_myf1 := 4.0
5483 const myf2 c_myf2 := c_myf1
5485 template myf1 t_myf1 := 4.0
5486 template myf2 t_myf2 := t_myf1
5487 template myf1 t_myf3 := (4.0)
5489 modulepar myf1 mp1 := 4.0
5490 modulepar myf5 mp2 := 32.0 // No error.
5492 function ff1() return myf1 { return 4.0 }
5493 function ff2(in myf1 p1 := 4.0) { }
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()
5506 (?is)\berror: 4.0e0 is not a valid value for type `float' which has subtype \(1.0e0,2.0e0,3.0e0\)
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\)
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\)
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\)
5523 *---------------------------------------------------------------------*
5524 :h3.Adhoc:: Subtyping - Charstrings
5525 .*---------------------------------------------------------------------*
5527 <TC - Subtyping - Charstrings>
5530 <MODULE TTCN module1 module1.ttcn>
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")
5542 const myc1 c_myc1 := "sie"
5543 const myc2 c_myc2 := "sie"
5544 const myc8 c_myc3 := "ich"
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")
5551 function fc1() return myc1 { return "sie" }
5552 function fc2(in myc1 p1 := "sie") { }
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()
5566 (?is)\berror: Mixing of value list and range subtyping is not allowed for type `charstring'
5569 (?is)\berror: "sie" is not a valid value for type `charstring' which has subtype \("du","er","ich"\)
5572 (?is)\berror: "sie" is not a valid value for type `charstring' which has subtype length\(1\)
5575 (?is)\berror: The subtype is an empty set
5578 (?is)\berror: Subtype mismatch: subtype length\(1\) has no common value with subtype \("du","er","ich"\)
5586 *---------------------------------------------------------------------*
5587 :h3.Adhoc:: Subtyping - Universal Charstrings
5588 .*---------------------------------------------------------------------*
5590 <TC - Subtyping - Universal Charstrings>
5593 <MODULE TTCN module1 module1.ttcn>
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))
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)) { }
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()
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\)\)
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\)
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\)\)
5631 (?is)\berror: The subtype is an empty set
5639 *---------------------------------------------------------------------*
5640 :h3.Adhoc:: Subtyping - Bitstrings
5641 .*---------------------------------------------------------------------*
5643 <TC - Subtyping - Bitstrings>
5646 <MODULE TTCN module1 module1.ttcn>
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)
5661 function fb1() return myb1 { return '10'B }
5662 function fb2(in myb1 p1 := '00'B) { }
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()
5676 (?is)\berror: '10'B is not a valid value for type `bitstring' which has subtype \('00'B,'01'B\)
5679 (?is)\berror: '10'B is not a valid value for type `bitstring' which has subtype length\(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\)
5685 (?is)\berror: Subtype mismatch: subtype length\(1\) has no common value with subtype \('00'B,'01'B\)
5693 *---------------------------------------------------------------------*
5694 :h3.Adhoc:: Subtyping - Hexstrings
5695 .*---------------------------------------------------------------------*
5697 <TC - Subtyping - Hexstrings>
5700 <MODULE TTCN module1 module1.ttcn>
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)
5714 function fh1() return myh1 { return '00'H }
5715 function fh2(in myh1 p1 := '00'H) { }
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()
5728 (?is)\berror: '10'H is not a valid value for type `hexstring' which has subtype \('00'H,'01'H\)
5731 (?is)\berror: '10'H is not a valid value for type `hexstring' which has subtype length\(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\)
5737 (?is)\berror: Subtype mismatch: subtype length\(1\) has no common value with subtype \('00'H,'01'H\)
5745 *---------------------------------------------------------------------*
5746 :h3.Adhoc:: Subtyping - Octetstrings
5747 .*---------------------------------------------------------------------*
5749 <TC - Subtyping - Octetstrings>
5752 <MODULE TTCN module1 module1.ttcn>
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
5768 function fo1() return myo1 { return '1010'O }
5769 function fo2(in myo1 p1 := '1010'O) { }
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()
5784 (?is)\berror: '10'O is not a valid value for type `octetstring' which has subtype \('00'O,'01'O\)
5787 (?is)\berror: '1010'O is not a valid value for type `octetstring' which has subtype length\(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\)
5793 (?is)\berror: '1010'O is not a valid value for type `octetstring' which has subtype \('00'O,'01'O\)
5801 *---------------------------------------------------------------------*
5802 :h3.Adhoc:: Subtyping - Objids
5803 .*---------------------------------------------------------------------*
5805 <TC - Subtyping - Objids>
5808 <MODULE TTCN module1 module1.ttcn>
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}
5816 var template myo1 vt_myo1 := objid{0 0 0}
5817 var myo1 v_myo1 := objid{0 0 0}
5822 (?is)\berror: objid \{ 0 0 0 \} is not a valid value for type `objid' which has subtype \(objid \{ 0 4 0 \}\)
5827 *---------------------------------------------------------------------*
5828 :h3.Adhoc:: Subtyping - Anytypes
5829 .*---------------------------------------------------------------------*
5831 <TC - Subtyping - Anytypes>
5834 <MODULE TTCN module1 module1.ttcn>
5837 type anytype mya1 ({integer := 0})
5839 type integer myint1 (1, 2, 3)
5840 type mya2.myint1 myint2 (1..2)
5842 const mya1 c_mya1 := {integer := 1}
5843 const mya2.myint1 c_mya2 := 100
5844 const myint2 c_myi1 := 3
5846 template mya1 t_mya1 := {integer := 1}
5849 var template mya1 vt_mya1 := {integer := 1}
5850 var mya1 v_mya1 := {integer := 1}
5852 } with { extension "anytype integer, myint1" }
5855 (?is)\berror: 3 is not a valid value for type `integer' which has subtype \(1..2\)
5858 (?is)\berror: \{ integer := 1 \} is not a valid value for type `\@module1.anytype' which has subtype \(\{ integer := 0 \}\)
5861 (?is)\berror: 100 is not a valid value for type `integer' which has subtype \(1..3\)
5869 *---------------------------------------------------------------------*
5870 :h3.Adhoc:: Subtyping - Unions
5871 .*---------------------------------------------------------------------*
5873 <TC - Subtyping - Unions>
5876 <MODULE TTCN module1 module1.ttcn>
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)
5888 const myu2 c_myu1 := {f1 := 1}
5889 const myu5 c_myu2 := {f1 := 1}
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)}
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?
5906 (?is)\berror: \{ f1 := 1 \} is not a valid value for type `\@module1.myu1' which has subtype \(\{ f1 := 0 \},\{ f2 := "" \}\)
5909 (?is)\berror: Reference to non-existent field `interestingfieldreferencenotcheckedbutpossible' in type `\@module1.myu1'
5917 *---------------------------------------------------------------------*
5918 :h3.Adhoc:: Subtyping - Records
5919 .*---------------------------------------------------------------------*
5921 <TC - Subtyping - Records>
5924 <MODULE TTCN module1 module1.ttcn>
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, ""})
5937 integer f1 (1, 2, 3),
5938 charstring f2 length(3)
5941 // Only the constants are checked regarding subtypes.
5942 const myr2 c_myr1 := {1, ""}
5943 const myr4 c_myr2 := {1, ""}
5945 template myr2 t_myr1 := {1, ""}
5946 template myr4 t_myr2 := {1, ""}
5947 template myr6 t_myr3(in myi1 p1) := {p1, "abc"}
5949 function fr1() return myr2 { return {0, "1"} }
5950 function fr2(in myr2 p1 := {0, "1"}) { }
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) { }
5964 (?is)\berror: integer value was expected
5967 (?is)\berror: Type referenced by `myr1' does not have a subtype
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 := " " \}\)
5973 (?is)\berror: \{ f1 := 1, f2 := "" \} is not a valid value for type `\@module1.myr1' which has subtype \(\{ f1 := 0, f2 := "" \},\{ f1 := 0, f2 := " " \}\)
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 := " " \}\)
5979 (?is)\berror: Subtype mismatch: subtype \(1..3\) has no common value with subtype \(11,22,33\)
5982 (?is)\berror: \"abcdefghijk\" is not a valid value for type `charstring' which has subtype length\(3\)
5990 *---------------------------------------------------------------------*
5991 :h3.Adhoc:: Subtyping - Sets
5992 .*---------------------------------------------------------------------*
5994 <TC - Subtyping - Sets>
5997 <MODULE TTCN module1 module1.ttcn>
6004 type integer myi1 (11, 22, 33)
6005 type mys1 mys2 ({f1 := 0, f2 := ""}, {f1 := 0, f2 := " "})
6007 integer f1 (1, 2, 3),
6008 charstring f2 length(3)
6010 type mys1 myr4 (mys2)
6011 type mys2 mys5 (mys2, mys2, {f1 := 0, f2 := ""}, {f1 := 0, f2 := ""})
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 := ""}
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}
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"}
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.
6033 (?is)\berror: \{ f1 := 1, f2 := "" \} is not a valid value for type `\@module1.mys1' which has subtype \(\{ f1 := 0, f2 := "" \},\{ f1 := 0, f2 := " " \}\)
6036 (?is)\berror: Subtype mismatch: subtype \(1..3\) has no common value with subtype \(11,22,33\)
6039 (?is)\berror: \"itstoolong\" is not a valid value for type `charstring' which has subtype length\(3\)
6042 (?is)\berror: 100 is not a valid value for type `integer' which has subtype \(1..3\)
6050 *---------------------------------------------------------------------*
6051 :h3.Adhoc:: Subtyping - Recordofs
6052 .*---------------------------------------------------------------------*
6054 <TC - Subtyping - Recordofs>
6057 <MODULE TTCN module1 module1.ttcn>
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)
6069 const myro1 c_myro1 := {0, 1}
6070 const myro2 c_myro2 := {0, 1}
6071 const myro6 c_myro3 := {c_myro1[0]}
6073 template myro1 t_myro1 := {0, 1}
6074 template myro2 t_myro2 := {0, 1}
6075 template myro6 t_myro3 := {0}
6077 modulepar myro1 mp1 := {0, 1}
6078 modulepar myro2 mp2 := {0, 1}
6079 modulepar myro6 mp3 := {}
6081 function fro1() return myro1 { return {0, 1} }
6082 function fro2(in myro1 p1 := {0, 1}) { }
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)) { }
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\)
6099 (?is)\berror: There must not be more than 1 elements in the list
6102 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myro1' which has subtype length\(1\)
6105 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myro2' which has subtype length\(4..8\)
6108 (?is)\berror: At least 4 elements must be present in the list
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\)
6114 (?is)\berror: record of value was expected
6117 (?is)\berror: \{ \} is not a valid value for type `\@module1.myro1' which has subtype length\(1\)
6119 <RESULT LTRT COUNT 2>
6120 (?is)\berror: The operands of operation `==' should be of compatible types
6122 <RESULT LTRT COUNT 1>
6123 (?is)\berror: Type mismatch: a value or template of type `\@module1.myro1' was expected instead of `\@module1.myro2'
6125 <RESULT FTRT COUNT 3>
6126 (?is)\berror: Type mismatch: `\@module1.myro1' and `\@module1.myro2' are not compatible: Incompatible record of/SEQUENCE OF subtypes
6129 (?is)\berror: Reference `myro2' must refer to a type which has the same root type as this type
6137 *---------------------------------------------------------------------*
6138 :h3.Adhoc:: Subtyping - Setofs
6139 .*---------------------------------------------------------------------*
6141 <TC - Subtyping - Setofs>
6144 <MODULE TTCN module1 module1.ttcn>
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)
6155 template myso1 t_myso1 := {0, 1}
6156 template myso2 t_myso2 := {0, 1}
6157 template myso5 t_myso3 := {0}
6159 const myso1 c_myso1 := {0, 1}
6160 const myso2 c_myso2 := {0, 1}
6161 const myso5 c_myso3 := {c_myso1[0]}
6163 modulepar myso1 mp1 := {0, 1}
6164 modulepar myso2 mp2 := {0, 1}
6165 modulepar myso5 mp3 := {}
6167 function fso1() return myso1 { return {0, 1} }
6168 function fso2(in myso1 p1 := {0, 1}) { }
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)) { }
6182 (?is)\berror: Reference `myso1' must refer to a type which has the same root type as this type
6185 (?is)\berror: Reference `myso2' must refer to a type which has the same root type as this type
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\)
6191 (?is)\berror: There must not be more than 1 elements in the list
6194 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myso1' which has subtype length\(1\)
6197 (?is)\berror: At least 4 elements must be present in the list
6200 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myso2' which has subtype length\(4..8\)
6203 (?is)\berror: \{ \} is not a valid value for type `\@module1.myso1' which has subtype length\(1\)
6205 <RESULT LTRT COUNT 2>
6206 (?is)\berror: The operands of operation `==' should be of compatible types
6208 <RESULT LTRT COUNT 1>
6209 (?is)\berror: Type mismatch: a value or template of type `\@module1.myso1' was expected instead of `\@module1.myso2'
6211 <RESULT FTRT COUNT 3>
6212 (?is)\berror: Type mismatch: `\@module1.myso1' and `\@module1.myso2' are not compatible: Incompatible set of/SET OF subtypes
6220 *---------------------------------------------------------------------*
6221 :h3.Adhoc:: Subtyping - Arrays
6222 .*---------------------------------------------------------------------*
6224 <TC - Subtyping - Arrays>
6227 <MODULE TTCN module1 module1.ttcn>
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)
6236 template mya1 t_mya1 := {2}
6237 template mya3 t_mya2 := {2, 3}
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.
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) { }
6256 (?is)\berror: Length subtyping is not allowed for type `integer'
6259 (?is)\berror: Subtype constraints are not applicable to type `integer\[1\]'
6262 (?is)\berror: Too many elements in the array value: 1 was expected instead of 2
6271 *---------------------------------------------------------------------*
6272 :h3.Adhoc:: Special float values
6273 .*---------------------------------------------------------------------*
6275 <TC - Special float values>
6278 <MODULE TTCN module1 module1.ttcn>
6281 const float cf_pinf := infinity;
6282 const float cf_minf := -infinity;
6283 const float cf_nan := not_a_number;
6285 type float MyFlt (-infinity..infinity);
6286 type float MyFlt2 (not_a_number);
6291 vf1 := not_a_number;
6298 (?is)\berror: NaN is not a valid value for type `float' which has subtype \(-INF..INF\)
6301 (?is)\berror: 1.0e0 is not a valid value for type `float' which has subtype \(NaN\)
6304 (?is)\berror: Subtype mismatch: subtype \(NaN\) has no common value with subtype \(-INF..INF\)
6313 *---------------------------------------------------------------------*
6314 :h3.Adhoc:: Exclusive ranges - integer type
6315 .*---------------------------------------------------------------------*
6317 <TC - Exclusive ranges - integer type>
6320 <MODULE TTCN module1 module1.ttcn>
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;
6335 (?is)\berror: invalid lower boundary, -infinity cannot be excluded from an integer subtype range
6338 (?is)\berror: invalid upper boundary, infinity cannot be excluded from an integer subtype range
6341 (?is)\berror: lower boundary is bigger than upper boundary in integer subtype range
6344 (?is)\berror: 10 is not a valid value for type `integer' which has subtype \(2..9,11..19\)
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\)
6350 (?is)\berror: 20 is not a valid value for type `integer' which has subtype \(2..19\)
6359 *---------------------------------------------------------------------*
6360 :h3.Adhoc:: Exclusive ranges - float type
6361 .*---------------------------------------------------------------------*
6363 <TC - Exclusive ranges - float type>
6366 <MODULE TTCN module1 module1.ttcn>
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;
6382 (?is)\berror: !-infinity is not a valid upper boundary
6385 (?is)\berror: !infinity is not a valid lower boundary
6388 (?is)\berror: lower boundary cannot be not_a_number in float subtype range
6391 (?is)\berror: -INF is not a valid value for type `float' which has subtype \(!-INF..!INF\)
6394 (?is)\berror: INF is not a valid value for type `float' which has subtype \(!-INF..!INF\)
6397 (?is)\berror: NaN is not a valid value for type `float' which has subtype \(!-INF..!INF\)
6400 (?is)\bwarning: The subtype of type `float' is a full set, it does not constrain the root type.
6403 (?is)\berror: 0.0e0 is not a valid value for type `float' which has subtype \(-INF..!0.0e0,!0.0e0..INF\)
6412 *---------------------------------------------------------------------*
6413 :h3.Adhoc:: Exclusive ranges - charstring type
6414 .*---------------------------------------------------------------------*
6416 <TC - Exclusive ranges - charstring type>
6419 <MODULE TTCN module1 module1.ttcn>
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";
6433 (?is)\berror: lower boundary is bigger than upper boundary in charstring subtype range
6436 (?is)\berror: "c" is not a valid value for type `charstring' which has subtype from\("b","d".."y"\)
6439 (?is)\berror: "0" is not a valid value for type `charstring' which has subtype \(from\("b","d".."y"\) union from\("1".."9","c"\)\)
6447 *---------------------------------------------------------------------*
6448 :h3.Adhoc:: invalid syntax - equality followed by negation
6449 .*---------------------------------------------------------------------*
6451 <TC - invalid syntax - equality followed by negation>
6454 <MODULE TTCN module1 module1.ttcn>
6464 (?is)\berror: The operation `not' is not allowed to be the second operand of operation `!='
6469 .*---------------------------------------------------------------------*
6470 :h3.Adhoc:: special float values
6471 .*---------------------------------------------------------------------*
6473 <TC - special float values>
6476 <MODULE TTCN x x.ttcn>
6478 const float a := infinity;
6479 const float b := not_a_number;
6480 const float c := 0.0 / b;
6482 var float d := rnd( a );
6483 var float e := rnd( b );
6489 <RESULT IF_PASS COUNT 1>
6490 (?im)error: Second operand of operation `/' cannot be NaN, it must be a numeric value
6492 <RESULT IF_PASS COUNT 1>
6493 (?im)error: The operand of operation `rnd \(seed\)' cannot be INF, it must be a numeric value
6495 <RESULT IF_PASS COUNT 1>
6496 (?im)error: The operand of operation `rnd \(seed\)' cannot be NaN, it must be a numeric value
6498 <RESULT IF_PASS COUNT 1>
6499 (?im)error: A non-negative float value was expected as timer duration instead of `INF'
6501 <RESULT IF_PASS COUNT 1>
6502 (?im)error: A non-negative float value was expected as timer duration instead of `NaN'
6504 <RESULT IF_PASS COUNT 5>
6511 .*---------------------------------------------------------------------*
6512 :h3.Adhoc:: template restrictions (TR: HL77646)
6513 .*---------------------------------------------------------------------*
6515 <TC - template restrictions (TR: HL77646)>
6518 <MODULE TTCN Temp Temp.ttcn>
6520 type record of integer MyRecOfInt;
6521 template(value) integer t_MyInt := 1
6522 template(value) MyRecOfInt t_MyRecOfInt := {[2]:= t_MyInt }
6529 type record of C ROF;
6537 var template(value) R tr1;
6538 var template R tr2 := { 1, omit, { {b:=true}, {i:=1}, {b:=(true,false)} } }
6543 <MODULE CFG Temp Temp.cfg>
6546 LogSourceInfo := Yes
6547 Logfile := "Temp%i.log"
6550 DiskFullAction := error
6552 ConsoleMask := WARNING | ERROR | TESTCASE | STATISTICS
6557 (?im)warning: Inadequate restriction on the referenced template variable `tr2', this may cause a dynamic test case error at runtime
6559 <RESULT IF_PASS COUNT 1>
6560 (?im)Dynamic test case error: Restriction `value' on template of type @Temp.R violated.
6567 .*---------------------------------------------------------------------*
6568 :h3.Adhoc:: template restrictions (TR: HL77646) 2
6569 .*---------------------------------------------------------------------*
6571 <TC - template restrictions (TR: HL77646) 2>
6574 <MODULE TTCN Temp Temp.ttcn>
6577 type record of R ROF;
6578 type record of R ROF2;
6586 var template(value) C t1;
6587 var template(present) C t2 := { r := { [2] := {} } }
6589 var template(value) ROF2 t11;
6590 var template(present) ROF2 t21 := { {}, ({},{}) }
6595 <MODULE CFG Temp Temp.cfg>
6598 LogSourceInfo := Yes
6599 Logfile := "Temp%i.log"
6602 DiskFullAction := error
6604 ConsoleMask := WARNING | ERROR | TESTCASE | STATISTICS
6609 (?im)warning: Inadequate restriction on the referenced template variable `.+', this may cause a dynamic test case error at runtime
6611 <RESULT IF_PASS COUNT 1>
6612 (?im)Dynamic test case error: Restriction `value' on template of type @Temp.ROF2 violated.
6618 .*---------------------------------------------------------------------*
6619 :h3.Adhoc:: constant parameter in decvalue function
6620 .*---------------------------------------------------------------------*
6622 <TC - constant parameter in decvalue function>
6625 <MODULE TTCN x x.ttcn>
6627 type integer myint with {encode "RAW"}
6630 } with {encode "XML"};
6632 const bitstring c_bs0 := ''B;
6636 var integer ret := decvalue(c_bs0, v_r);
6641 <RESULT IF_PASS COUNT 1>
6642 (?im)error: Reference to 'constant' cannot be used as the first operand of the 'decvalue' operation
6644 <RESULT IF_PASS COUNT 1>
6650 .*---------------------------------------------------------------------*
6651 :h3.Adhoc:: extra checks for decvalue (HM59355)
6652 .*---------------------------------------------------------------------*
6654 <TC - extra checks for decvalue (HM59355)>
6657 <MODULE TTCN x x.ttcn>
6659 type record MyEmptyRecord { } with { encode "XML" }
6663 var template MyEmptyRecord t
6664 i := decvalue(s, MyEmptyRecord)
6665 // Original error: expected unqualified-id before '.' token
6667 // Original error: 'class x::MyEmptyRecord_template' has no member named 'decode'
6671 <RESULT IF_PASS COUNT 1>
6672 (?im)error: Reference to 'type' cannot be used.
6674 <RESULT IF_PASS COUNT 1>
6675 (?im)error: Reference to 'template variable' cannot be used.
6677 <RESULT IF_PASS COUNT 2>
6683 .*---------------------------------------------------------------------*
6684 :h3.Adhoc:: SIGSEGV on missing modules (HM62166)
6685 .*---------------------------------------------------------------------*
6687 <TC - SIGSEGV on missing modules (HM62166)>
6690 <MODULE TTCN x x.asn>
6691 Example DEFINITIONS ::= BEGIN
6694 MyType FROM Z {itu-t(0)};
6695 EXTENSION ::= CLASS {&id Code}
6696 myExtension EXTENSION ::= {IDENTIFIED BY global : {itu-t(0)}}
6699 <RESULT IF_PASS COUNT 1>
6700 (?im)error: There is no module with identifier \`Y\'
6702 <RESULT IF_PASS COUNT 1>
6703 (?im)error: There is no module with identifier \`Z\'
6705 <RESULT IF_PASS COUNT 1>
6706 (?im)error: There is no assignment or imported symbol with name \`Code\' in module \`Example\'
6708 <RESULT IF_PASS COUNT 1>
6709 (?im)error: Cannot recognize fieldspec
6711 <RESULT IF_PASS COUNT 1>
6712 (?im)error: Unexpected \`\<upperidentifier\>\'
6714 <RESULT IF_PASS COUNT 1>
6715 (?im)error: Superfluous part detected
6717 <RESULT IF_PASS COUNT 1>
6718 (?im)error: Check the syntax of objectclass \(consider using debug messages\)
6720 <RESULT IF_PASS COUNT 7>
6726 *---------------------------------------------------------------------*
6727 :h3.Adhoc:: Subtyping - Octetstring TR (TR:?)
6728 .*---------------------------------------------------------------------*
6730 <TC - Subtyping - Octetstring TR (TR:?)>
6733 <MODULE TTCN module1 module1.ttcn>
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);
6750 *---------------------------------------------------------------------*
6751 :h3.Adhoc:: Subtyping - String indexing (TR:?)
6752 .*---------------------------------------------------------------------*
6754 <TC - Subtyping - String indexing (TR:?)>
6757 <MODULE TTCN module1 module1.ttcn>
6760 type octetstring OCT1 length(1);
6761 type octetstring OCT2 length(2);
6763 const OCT2 long_octet := '0102'O;
6764 const OCT1 short_octet := long_octet[0];
6766 type port myport message { inout OCT1; } with { extension "internal" };
6767 type port myport2 message { inout OCT2; } with { extension "internal" };
6768 type component mycomp {
6773 function myfunc() runs on mycomp
6777 p.receive(OCT1:?) -> value o2[0];
6778 p2.receive(OCT2:?) -> value o1;
6779 p2.receive(OCT2:?) -> value o2[0];
6790 o2 := myfunc12(o1,o2);
6792 o2[0] := myfunc12(o1,o2);
6796 o1[0] := myfunc12(o1,o2);
6798 o1 := myfunc12(o2,o1);
6799 o1 := myfunc12in(o2,o1);
6800 o1 := myfunc12out(o2,o1);
6801 o2 := myfunc12(o1,o2);
6804 function myfunc12(inout OCT1 p_o1, inout OCT2 p_o2) return OCT1
6809 function myfunc12in(in OCT1 p_o1, in OCT2 p_o2) return OCT1
6814 function myfunc12out(out OCT1 p_o1, out OCT2 p_o2) return OCT1
6819 function myfunc12err(inout OCT1 p_o1, inout OCT2 p_o2) return OCT2
6825 var OCT2 o2 := 'BABE'O;
6826 var integer i := oct2int(o2[0]); // HQ38022
6830 <RESULT IF_PASS COUNT 3>
6831 (?im)error: Subtype mismatch: subtype length\(2\) has no common value with a string element
6833 <RESULT IF_PASS COUNT 7>
6834 (?im)error: Subtype mismatch: subtype length\(2\) has no common value with subtype length\(1\)
6836 <RESULT IF_PASS COUNT 4>
6837 (?im)error: Subtype mismatch: subtype length\(1\) has no common value with subtype length\(2\)
6839 <RESULT IF_PASS COUNT 1>
6840 (?im)error: Subtype mismatch: string element has no common value with subtype length\(2\)
6842 <RESULT IF_PASS COUNT 2>
6843 (?im)error: Reference to a string element of type `octetstring' cannot be used in this context
6851 *---------------------------------------------------------------------*
6852 :h3.Adhoc:: Subtyping - function references
6853 .*---------------------------------------------------------------------*
6855 <TC - Subtyping - function references>
6858 <MODULE TTCN module1 module1.ttcn>
6861 type octetstring OCT1 length(1);
6862 type octetstring OCT2 length(2);
6864 const OCT2 long_octet := '0102'O;
6865 const OCT1 short_octet := long_octet[0];
6867 type function myfunctype(inout OCT2 p_o1, inout OCT1 p_o2) return OCT2
6869 function myfunc(inout OCT1 p_o1, inout OCT2 p_o2) return OCT1
6875 var myfunctype f := refers(myfunc);
6879 <RESULT IF_PASS COUNT 1>
6880 (?im)error: Subtype mismatch: subtype length\(2\) has no common value with subtype length\(1\)
6882 <RESULT IF_PASS COUNT 1>
6883 (?im)error: Subtype mismatch: subtype length\(1\) has no common value with subtype length\(2\)
6885 <RESULT IF_PASS COUNT 1>
6886 (?im)error: Return type subtype mismatch: subtype length\(2\) has no common value with subtype length\(1\)
6894 *---------------------------------------------------------------------*
6895 :h3.Adhoc:: Values - Valueof TR (TR:HM93087)
6896 .*---------------------------------------------------------------------*
6898 <TC - Values - Valueof TR (TR:HM93087)>
6901 <MODULE TTCN module1 module1.ttcn>
6908 if (valueof(rec:{1}) == {1}) { }
6918 *---------------------------------------------------------------------*
6919 :h3.Adhoc:: Recursion - recursion TR (TR:HM93170)
6920 .*---------------------------------------------------------------------*
6922 <TC - Recursion - recursion TR (TR:HM93170)>
6925 <MODULE TTCN module1 module1.ttcn>
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 };
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'
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'
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'
6956 *---------------------------------------------------------------------*
6957 :h3.Adhoc:: Recursion - union TR (TR:HM93077)
6958 .*---------------------------------------------------------------------*
6960 <TC - Recursion - union TR (TR:HM93077)>
6963 <MODULE TTCN module1 module1.ttcn>
6965 type union ValidUnion0 {
6969 type union ValidUnion1 {
6975 type union InvalidUnion0 {
6979 type union InvalidUnion1 {
6983 type union InvalidUnion2 {
6987 type union InvalidUnion3 {
6993 type union InvalidUnion4 {
6997 type record InvalidRecord0 {
7002 <RESULT IF_PASS COUNT 1>
7003 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion0' -> `\@module1.InvalidUnion0.u1' -> `\@module1.InvalidUnion0'
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'
7008 <RESULT IF_PASS COUNT 1>
7009 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion3' -> `\@module1.InvalidUnion3.u1' -> `\@module1.InvalidUnion3'
7011 <RESULT IF_PASS COUNT 1>
7012 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion3' -> `\@module1.InvalidUnion3.u2' -> `\@module1.InvalidUnion3'
7014 <RESULT IF_PASS COUNT 1>
7015 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion3' -> `\@module1.InvalidUnion3.u3' -> `\@module1.InvalidUnion3'
7017 <RESULT IF_PASS COUNT 1>
7018 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidRecord0' -> `\@module1.InvalidRecord0.r1' -> `\@module1.InvalidRecord0'
7020 <RESULT IF_PASS COUNT 1>
7021 (?im)\bnotify: Errors found in the input module. Code will not be generated.
7026 .*---------------------------------------------------------------------*
7027 :h3.Adhoc:: Negative testing semantic check error messages
7028 .*---------------------------------------------------------------------*
7030 <TC - Negative testing semantic check error messages>
7033 <MODULE ASN Virag Virag.asn>
7034 Virag DEFINITIONS ::=
7037 MySeqOf ::= SEQUENCE OF INTEGER
7038 MySeq ::= SEQUENCE {
7042 MyUnion ::= CHOICE {
7047 MyCharstring1 ::= VisibleString
7048 MyCharstring2 ::= IA5String
7052 <MODULE TTCN virag virag.ttcn>
7055 import from Virag all;
7063 type record of integer MYROFI;
7070 with { encode "TEXT" variant "" }
7071 type record MYREC2 { integer i }
7072 const MYREC c_myrec1 := {i:=1}
7074 erroneous "value := 2"
7075 erroneous (x) "value := 2"
7076 erroneous (i, r.i, r.r.i) "value := 2"
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"
7091 const MYREC c_myrec12 := {i:=1} with {
7092 erroneous (r) "before := omit all"
7093 erroneous (b) "value := 0"
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"
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"
7106 const MYREC c_myrec17 := {i:=1} with {
7107 erroneous (r.b) "value := 1"
7108 erroneous (r) "value := 1"
7110 const MYREC c_myrec18 := {i:=1} with {
7111 erroneous (b) "before := omit all"
7112 erroneous (r) "before := omit all"
7114 const MYREC c_myrec19 := {i:=1} with {
7115 erroneous (b) "value := 1"
7116 erroneous (r) "before := omit all"
7118 const MYREC c_myrec20 := {i:=1} with {
7119 erroneous (b) "after := omit all"
7120 erroneous (i) "after := omit all"
7122 const MYREC c_myrec21 := {i:=1} with {
7123 erroneous (r) "value := 1"
7124 erroneous (b) "after := omit all"
7126 const MYREC c_myrec22 := {i:=1} with {
7127 erroneous (r) "value := omit"
7128 erroneous (r.i) "value := 1"
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 ""}
7140 <RESULT FTRT COUNT 1>
7141 (?im)\berror: At least one qualifier must be specified for the `erroneous' attribute
7144 <RESULT FTRT COUNT 1>
7145 (?im)\berror: Reference to non-existent field `x' in type `@virag.MYREC'
7148 <RESULT FTRT COUNT 1>
7149 (?im)\berror: Keyword `all' is expected after `omit' when omitting all fields after the specified field
7152 <RESULT FTRT COUNT 1>
7153 (?im)\berror: Keyword `all' is expected after `omit' when omitting all fields before the specified field
7156 <RESULT FTRT COUNT 1>
7157 (?im)\berror: Unexpected `all' keyword after `omit' when omitting one field
7160 <RESULT FTRT COUNT 1>
7161 (?im)\berror: Unexpected `all' keyword after the in-line template
7164 <RESULT FTRT COUNT 1>
7165 (?im)\berror: Cannot determine the type of the in-line template
7168 <RESULT FTRT COUNT 1>
7169 (?im)\berror: There is no local or imported definition with name `nonexi'
7172 <RESULT FTRT COUNT 1>
7173 (?im)\berror: An in-line template of type `integer' cannot be used as a `raw' erroneous value
7176 <RESULT FTRT COUNT 1>
7177 (?im)\berror: record of value was expected
7180 <RESULT FTRT COUNT 1>
7181 (?im)\berror: A specific value without matching symbols was expected
7184 <RESULT FTRT COUNT 1>
7185 (?im)\berror: Field `r' cannot be referenced because all fields after field `b' have been omitted
7188 <RESULT FTRT COUNT 1>
7189 (?im)\berror: Field `b' cannot be referenced because all fields before field `r' have been omitted
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
7196 <RESULT FTRT COUNT 1>
7197 (?im)\berror: There is nothing to omit after the last field \(r\) of a record/set type
7200 <RESULT FTRT COUNT 1>
7201 (?im)\berror: Reference to field `r' with indicator `value' would invalidate previously specified erroneous data
7204 <RESULT FTRT COUNT 1>
7205 (?im)\berror: There is nothing to omit before the first field \(i\)
7208 <RESULT FTRT COUNT 1>
7209 (?im)\berror: Duplicate reference to field `b' with indicator `value'
7212 <RESULT FTRT COUNT 1>
7213 (?im)\berror: Duplicate reference to field `b' with indicator `after'
7216 <RESULT FTRT COUNT 1>
7217 (?im)\berror: Duplicate reference to field `b' with indicator `before'
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'
7224 <RESULT FTRT COUNT 1>
7225 (?im)\berror: Omitting fields before field `r' would invalidate previously specified erroneous data
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'
7232 <RESULT FTRT COUNT 1>
7233 (?im)\berror: Omitting fields after field `b' would invalidate previously specified erroneous data
7236 <RESULT FTRT COUNT 1>
7237 (?im)\berror: Field `r.i' is embedded into a field which was previously overwritten or omitted
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.
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.
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.
7252 <RESULT FTRT COUNT 1>
7253 (?im)\berror: Type `VisibleString' and type `@virag.MYREC' have no common encoding
7256 <RESULT FTRT COUNT 1>
7257 (?im)\berror: Type `@virag.MYREC2' and type `@virag.MYREC' have no common encoding
7261 (?im)\berror: The `erroneous' attribute can be used only on template and constant definitions
7264 <RESULT FTRT COUNT 33>
7269 <RESULT LTRT COUNT 27>
7270 (?im)\berror: `erroneous' attributes can be used only with the Function Test Runtime
7273 <RESULT LTRT COUNT 27>
7274 (?im)\bnote: If you need negative testing use the -R flag when generating the makefile
7277 <RESULT LTRT COUNT 30>
7280 <RESULT LTRT COUNT 27>
7287 .*---------------------------------------------------------------------*
7288 :h3.Adhoc:: Syntax errors in logfiles (TR HN52781)
7289 .*---------------------------------------------------------------------*
7291 <TC - Syntax errors in logfiles (TR HN52781)>
7294 <MODULE TTCN Temp Temp.ttcn>
7299 <MODULE CFG Temp Temp.cfg>
7301 very_unknown_module_parameter := "should be logged normally"
7303 LogSourceInfo := Yes
7304 Logfile := "Temp%i.log"
7306 ConsoleMask := LOG_ALL
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.
7316 .*---------------------------------------------------------------------*
7317 :h3.Adhoc:: testcase.stop
7318 .*---------------------------------------------------------------------*
7320 <TC - testcase.stop>
7323 <MODULE TTCN Temp Temp.ttcn>
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!!!");
7335 <MODULE CFG Temp Temp.cfg>
7338 LogSourceInfo := Yes
7339 Logfile := "Temp%i.log"
7341 ConsoleMask := LOG_ALL
7345 <RESULT IF_PASS COUNT 1>
7346 (?im)Dynamic test case error: testcase.stop
7348 <RESULT IF_PASS COUNT 1>
7349 (?im)Is it a Bird\?! Is it a Plane\?! No!! It's a dynamic test case error!!!
7354 .*---------------------------------------------------------------------*
7355 :h3.Adhoc:: Indexing of string template variables (CR_TR00018474)
7356 .*---------------------------------------------------------------------*
7358 <TC - Indexing of string template variables (CR_TR00018474)>
7361 <MODULE TTCN Temp Temp.ttcn>
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)
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) {}
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.
7386 testcase TC_bitstrings() runs on MyComp {
7387 var template bitstring vtb := '0011110000'B
7395 fsi_bitstrings(vtb[0])
7398 testcase TC_hexstrings() runs on MyComp {
7399 var template hexstring vth := 'AABBCCDDEE'H
7407 fsi_hexstrings(vth[0])
7410 testcase TC_octetstrings() runs on MyComp {
7411 var template octetstring vto := 'ABBAABBA'O
7419 fsi_octetstrings(vto[0])
7422 testcase TC_universal_charstrings() runs on MyComp {
7423 var template universal charstring vtu := "fisherman"
7429 fsi_universal_charstrings(vtu[0])
7434 <RESULT IF_PASS COUNT 2>
7435 (?im)error: Reference to template variable `vtc' can not be indexed
7437 <RESULT IF_PASS COUNT 1>
7438 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tcs'
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
7443 <RESULT IF_PASS COUNT 2>
7444 (?im)error: Reference to template variable `vtb' can not be indexed
7446 <RESULT IF_PASS COUNT 1>
7447 (?im)error: Invalid array element reference: type `bitstring' cannot be indexed
7449 <RESULT IF_PASS COUNT 1>
7450 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tbs'
7452 <RESULT IF_PASS COUNT 2>
7453 (?im)error: Reference to template variable `vth' can not be indexed
7455 <RESULT IF_PASS COUNT 2>
7456 (?im)error: Reference to template variable `vto' can not be indexed
7458 <RESULT IF_PASS COUNT 2>
7459 (?im)error: Reference to template variable `vtu' can not be indexed
7461 <RESULT IF_PASS COUNT 1>
7462 (?im)error: Invalid array element reference: type `hexstring' cannot be indexed
7464 <RESULT IF_PASS COUNT 1>
7465 (?im)error: Invalid array element reference: type `octetstring' cannot be indexed
7467 <RESULT IF_PASS COUNT 1>
7468 (?im)error: Invalid array element reference: type `universal charstring' cannot be indexed
7470 <RESULT IF_PASS COUNT 1>
7471 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.ths'
7473 <RESULT IF_PASS COUNT 1>
7474 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tos'
7476 <RESULT IF_PASS COUNT 1>
7477 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tus'
7482 .*---------------------------------------------------------------------*
7483 :h3.Adhoc:: Indexing of string template variables DTEs (CR_TR00018474)
7484 .*---------------------------------------------------------------------*
7486 <TC - Indexing of string template variables DTEs (CR_TR00018474)>
7489 <MODULE TTCN Temp Temp.ttcn>
7491 type component MyComp {}
7493 testcase TC_bitstrings() runs on MyComp {
7494 var template bitstring vtb := '0*?1'B // It's a pattern, cannot be indexed, runtime error.
7499 testcase TC_hexstrings() runs on MyComp {
7500 var template hexstring vth := 'AABB?CC'H // It's a pattern, cannot be indexed, runtime error.
7505 testcase TC_octetstrings() runs on MyComp {
7506 var template octetstring vto := 'AABB??*'O // It's a pattern, cannot be indexed, runtime error.
7513 execute(TC_bitstrings());
7514 execute(TC_hexstrings());
7515 execute(TC_octetstrings());
7519 <MODULE CFG Temp Temp.cfg>
7522 LogSourceInfo := Yes
7523 Logfile := "Temp%i.log"
7525 ConsoleMask := LOG_ALL
7529 <RESULT IF_PASS COUNT 1>
7530 (?im)Dynamic test case error: Accessing a bitstring element of a non-specific bitstring template.
7532 <RESULT IF_PASS COUNT 1>
7533 (?im)Dynamic test case error: Accessing a hexstring element of a non-specific hexstring template.
7535 <RESULT IF_PASS COUNT 1>
7536 (?im)Dynamic test case error: Accessing an octetstring element of a non-specific octetstring template.
7541 .*--------------------------------------------------------------------------*
7542 :h3.Adhoc - TR HO69261 Incorrect code generated for create with optional parameters
7543 .*--------------------------------------------------------------------------*
7546 <TC - Adhoc - TR HO69261 Incorrect code generated for create with optional parameters>
7550 <MODULE TTCN Temp Temp.ttcn>
7553 charstring cs optional
7555 type component CT {}
7557 testcase tc() runs on CT
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);
7566 <RESULT IF_PASS NEGATIVE>
7572 .*--------------------------------------------------------------------------*
7573 :h3.Adhoc - sizeof()/lengthof() DTEs
7574 .*--------------------------------------------------------------------------*
7577 <TC - Adhoc - sizeof()/lengthof() DTEs>
7581 <MODULE TTCN Temp Temp.ttcn>
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!!!!
7592 testcase tc_sizeof_lengthof_standard2() runs on CT {
7593 if(lengthof('1*F'H) ==3){ setverdict(pass)}else { setverdict(fail) }; //DTE???
7597 execute(tc_sizeof_lengthof_standard1())
7598 execute(tc_sizeof_lengthof_standard2())
7602 <MODULE CFG Temp Temp.cfg>
7605 LogSourceInfo := Yes
7606 Logfile := "Temp%i.log"
7608 ConsoleMask := LOG_ALL
7612 <RESULT IF_PASS NEGATIVE>
7613 (?is)\berror: Performing lengthof() operation on a template of type \@Temp.ROI with no exact length.
7615 <RESULT IF_PASS NEGATIVE>
7616 (?is)\berror: Performing lengthof() operation on a hexstring template with no exact length.
7621 .*--------------------------------------------------------------------------*
7622 :h3.Adhoc - sizeof()/lengthof() compilation errors
7623 .*--------------------------------------------------------------------------*
7626 <TC - Adhoc - sizeof()/lengthof() compilation errors>
7630 <MODULE TTCN Temp Temp.ttcn>
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) };
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)
7646 .*--------------------------------------------------------------------------*
7647 :h3.Adhoc - Additional RAW attribute checks for LENGTHTO
7648 .*--------------------------------------------------------------------------*
7651 <TC - Additional RAW attribute checks for LENGTHTO>
7655 <MODULE TTCN Temp Temp.ttcn>
7657 type union myu_ok { integer a, integer b }
7658 type union myu_nok { integer a, charstring b }
7659 type record of integer mylist
7665 variant (f2) "LENGTHTO (f3)"
7672 variant (f2) "LENGTHTO (f3)"
7679 variant (f2) "LENGTHTO (f3)"
7686 variant (f2) "LENGTHTO (f3)"
7692 variant (f1) "LENGTHTO (f2)"
7694 } with { encode "RAW" }
7696 <RESULT IF_PASS COUNT 1>
7697 (?is)\berror: The union type LENGTHTO field must contain only integer fields
7699 <RESULT IF_PASS COUNT 1>
7700 (?is)\berror: The LENGTHTO field must be an integer or union type instead of `\@Temp.mylist'
7702 <RESULT IF_PASS COUNT 1>
7703 (?is)\berror: The LENGTHTO field must be an integer or union type instead of `charstring'
7705 <RESULT IF_PASS COUNT 3>
7711 .*--------------------------------------------------------------------------*
7712 :h3.Adhoc - HQ43433 decode parameter check
7713 .*--------------------------------------------------------------------------*
7716 <TC - HQ43433 decode parameter check>
7720 <MODULE TTCN Temp Temp.ttcn>
7724 // type definition incl. RAW attribute
7729 variant (i) "BYTEORDER(last)";
7732 // wrapper functions for encoding/decoding
7733 function enc(S s) return bitstring {
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 {
7745 // decvalue 1st par should be inout by standard?
7746 i := decvalue(bs, s);
7750 function dec2(in bitstring bs) return S {
7753 // decvalue 1st par should be inout by standard?
7754 i := decvalue(bs, s);
7758 function dec3(out bitstring bs) return S {
7761 var bitstring vl_bs:=bs;
7762 // decvalue 1st par should be inout by standard?
7763 i := decvalue(bs, s);
7768 function dec_inout(inout bitstring bs) return S {
7771 // decvalue 1st par should be inout by standard?
7772 i := decvalue(bs, s);
7776 type component MyComp {}
7778 testcase tc_default() runs on MyComp {
7779 var S s := { i := 2 };
7786 log("decoded:",s_mod);
7787 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7791 testcase tc_in() runs on MyComp {
7792 var S s := { i := 2 };
7799 log("decoded:",s_mod);
7800 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7803 /* debate: out fv can use out param!! TR???
7804 testcase tc_out() runs on MyComp {
7805 var S s := { i := 2 };
7812 log("decoded:",s_mod);
7813 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7817 testcase tc_inout() runs on MyComp {
7818 var S s := { i := 2 };
7824 s_mod := dec_inout(bs);
7825 log("decoded:",s_mod);
7826 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7830 //======Another example=====
7833 const MyType c_MyType := 42;
7834 const bitstring c_encoded := '00110011'B;
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:",
7842 if(v_MyType==51 and p_bit==''B) { setverdict(pass)} else {setverdict(fail)}
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:",
7852 if(v_MyType==51 and p_bit==''B) { setverdict(pass)} else {setverdict(fail)}
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);
7863 execute(tc_default());
7865 //execute(tc_out());
7866 execute(tc_inout());
7877 <MODULE CFG Temp Temp.cfg>
7881 LogSourceInfo := Yes
7882 Logfile := "Temp%i.log"
7884 ConsoleMask := LOG_ALL
7890 Overall verdict: pass
7897 .*--------------------------------------------------------------------------*
7898 :h3.Adhoc - @try @catch blocks no errors
7899 .*--------------------------------------------------------------------------*
7902 <TC - @try @catch blocks no errors>
7906 <MODULE TTCN Temp Temp.ttcn>
7908 type component MyComp {}
7913 function fv2() return integer {
7929 testcase tc() runs on MyComp {
7944 <RESULT IF_PASS COUNT 0>
7950 .*--------------------------------------------------------------------------*
7951 :h3.Adhoc - @try @catch blocks semantic errors
7952 .*--------------------------------------------------------------------------*
7955 <TC - @try @catch blocks semantic errors>
7959 <MODULE TTCN Temp Temp.ttcn>
7961 type component MyComp {}
7967 function fv2() return integer {
7984 testcase tc() runs on MyComp {
7996 const charstring dte_str := "";
8001 <RESULT IF_PASS COUNT 2>
8002 (?is)\berror: Definition with identifier `e' is not unique in the scope hierarchy
8004 <RESULT IF_PASS COUNT 2>
8005 (?is)\berror: `try' statement block must be followed by a `catch' block
8007 <RESULT IF_PASS COUNT 2>
8008 (?is)\berror: `catch' statement block must be preceded by a `try' block
8010 <RESULT IF_PASS COUNT 1>
8011 (?is)\berror: The function has return type, but control might leave it without reaching a return statement
8013 <RESULT IF_PASS COUNT 1>
8014 (?is)\berror: Duplicate definition with identifier `dte_str'
8016 <RESULT IF_PASS COUNT 1>
8017 (?is)\berror: Type mismatch: a value of type `integer' was expected instead of `charstring'
8019 <RESULT IF_PASS COUNT 9>
8025 .*---------------------------------------------------------------------*
8026 :h3.Adhoc:: @try @catch blocks catching DTEs
8027 .*---------------------------------------------------------------------*
8029 <TC - @try @catch blocks catching DTEs>
8032 <MODULE TTCN Temp Temp.ttcn>
8034 type component MyComp {}
8035 function safe_str2int(in charstring int_str, in integer defval) return integer {
8037 return str2int(int_str);
8043 testcase TC1() runs on MyComp {
8044 if (safe_str2int("bread", -1)==-1) { setverdict(pass); }
8045 else { setverdict(fail); }
8047 testcase TC2() runs on MyComp {
8048 var integer myEvilUnboundVariable;
8050 myEvilUnboundVariable := myEvilUnboundVariable + 1;
8057 testcase TC3() runs on MyComp {
8064 if (match(e, pattern "*division by zero*")) { setverdict(pass); }
8065 else { setverdict(fail); }
8076 <MODULE CFG Temp Temp.cfg>
8079 LogSourceInfo := Yes
8080 Logfile := "Temp%i.log"
8082 ConsoleMask := LOG_ALL
8086 <RESULT IF_PASS COUNT 0>
8087 (?im)Dynamic test case error:
8089 <RESULT IF_PASS COUNT 1>
8090 (?im)Overall verdict: pass
8095 .*---------------------------------------------------------------------*
8096 :h3.Adhoc:: @lazy parameters - no errors
8097 .*---------------------------------------------------------------------*
8099 <TC - @lazy parameters - no errors>
8102 <MODULE TTCN Temp Temp.ttcn>
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));
8116 function MyFunc(in @lazy charstring str) {
8121 function MyFunc2(in @lazy charstring sz) {
8124 function MyFn1(in @lazy charstring str) return charstring {
8127 function MyFn2(in @lazy charstring s) return charstring {
8128 return MyFn2(s&MyFn1(s));
8130 function MyFuncNormalEval(in charstring str, boolean b) {
8132 var charstring s := str;
8133 if (s=="") { log(s); }
8136 function MyFuncLazyEval(in @lazy charstring str, boolean b) {
8138 var charstring s := str;
8139 if (s=="") { log(s); }
8142 function Fdefaultpar( @lazy integer pi := 123 ) { log(pi); }
8143 function FuncTemplate(in template @lazy charstring tp) {
8147 function FuncTempl(in template @lazy charstring tp) {
8155 template REC trec(template @lazy integer pi) := {
8159 function usingRECfield(@lazy integer pi) {
8162 type record of integer RECOFINT;
8163 type record RECINT {
8164 RECOFINT ints optional,
8165 RECINT next optional
8167 function usingRECINTfield(@lazy integer pi) {
8168 var integer ii := pi + 100;
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]);
8186 <RESULT IF_PASS COUNT 0>
8192 .*---------------------------------------------------------------------*
8193 :h3.Adhoc:: @lazy parameters - no runtime error
8194 .*---------------------------------------------------------------------*
8196 <TC - @lazy parameters - no runtime error>
8199 <MODULE TTCN Temp Temp.ttcn>
8201 type component MyComp {}
8202 function DTEfunc(in charstring s) return charstring {
8206 function LazyFunc(in boolean b, in @lazy charstring s) return charstring {
8213 testcase LazyTC() runs on MyComp {
8214 log(LazyFunc(true, DTEfunc("x")));
8222 <MODULE CFG Temp Temp.cfg>
8225 LogSourceInfo := Yes
8226 Logfile := "Temp%i.log"
8228 ConsoleMask := LOG_ALL
8232 <RESULT IF_PASS COUNT 0>
8233 (?im)Dynamic test case error:
8235 <RESULT IF_PASS COUNT 1>
8236 (?im)Overall verdict: pass
8241 .*--------------------------------------------------------------------------*
8242 :h3.Adhoc - @lazy parameters - semantic errors
8243 .*--------------------------------------------------------------------------*
8246 <TC - @lazy parameters - semantic errors>
8250 <MODULE TTCN Temp Temp.ttcn>
8252 type function FT(in charstring str);
8253 function FTinst(in @lazy charstring str) {}
8254 type function FT2(in @lazy charstring str);
8256 var FT ft1 := refers(FTinst);
8261 <RESULT IF_PASS COUNT 1>
8262 (?is)\berror: Formal parameter `str' cannot be \@lazy, not supported in this case.
8264 <RESULT IF_PASS COUNT 1>
8265 (?is)\berror: Parameter \@lazy-ness mismatch
8267 <RESULT IF_PASS COUNT 2>
8273 .*---------------------------------------------------------------------*
8274 :h3.Adhoc:: @lazy parameters - correct lazy evaluation
8275 .*---------------------------------------------------------------------*
8277 <TC - @lazy parameters - correct lazy evaluation>
8280 <MODULE TTCN Temp Temp.ttcn>
8282 type component MyComp2 {
8283 var integer ci := 0;
8285 function FN2() runs on MyComp2 return integer {
8286 if (ci==0) { testcase.stop("ci==0 error!"); }
8289 function Lazy2(in @lazy integer pi) runs on MyComp2 {
8291 var integer vi := pi; // evaluated: 3*11 = 33
8292 if (vi!=33) { setverdict(fail); }
8294 vi := pi; // not evaled -> 33
8295 if (vi!=33) { setverdict(fail); }
8297 testcase TC2() runs on MyComp2 {
8306 <MODULE CFG Temp Temp.cfg>
8309 LogSourceInfo := Yes
8310 Logfile := "Temp%i.log"
8312 ConsoleMask := LOG_ALL
8316 <RESULT IF_PASS COUNT 0>
8317 (?im)Dynamic test case error:
8319 <RESULT IF_PASS COUNT 1>
8320 (?im)Overall verdict: pass
8325 .*---------------------------------------------------------------------*
8326 :h3.Adhoc:: modulepar invalid simple type: component, port, default
8327 .*---------------------------------------------------------------------*
8329 <TC - Adhoc::modulepar invalid type - component, port, default>
8332 <MODULE TTCN Temp Temp.ttcn>
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;
8340 type port port_PT message {
8343 type default default_DT;
8346 <RESULT IF_FAIL COUNT 3>
8349 <RESULT IF_FAIL POSITIVE>
8350 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
8351 <END_RESULT><END_TC>
8354 .*------------------------------------------------------------------------------------*
8355 :h3.Adhoc:: modulepar invalid compound type: record, set with component, default
8356 .*------------------------------------------------------------------------------------*
8358 <TC - Adhoc::modulepar invalid type - compound type>
8361 <MODULE TTCN Temp Temp.ttcn>
8363 modulepar invalidRec tsp_Rec;
8364 modulepar invalidSet tsp_Set;
8365 modulepar invalidUnion tsp_Union;
8366 type record invalidRec {
8371 type set invalidSet {
8376 type union invalidUnion {
8380 type default default_DT;
8381 type component comp_CT {
8382 var integer v_int := 0;
8386 <RESULT IF_FAIL COUNT 3>
8389 <RESULT IF_FAIL POSITIVE>
8390 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
8391 <END_RESULT><END_TC>
8394 .*------------------------------------------------------------------------------------*
8395 :h3.Adhoc:: modulepar invalid list: record of, set of and array with component, default
8396 .*------------------------------------------------------------------------------------*
8398 <TC - Adhoc::modulepar invalid list - record of, set of and array with component, default>
8401 <MODULE TTCN Temp Temp.ttcn>
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;
8415 <RESULT IF_FAIL COUNT 3>
8418 <RESULT IF_FAIL POSITIVE>
8419 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
8420 <END_RESULT><END_TC>
8423 .*-----------------------------------------------------------*
8424 :h3.Adhoc:: modulepar invalid type: circular type definition
8425 .*-----------------------------------------------------------*
8427 <TC - Adhoc::modulepar invalid type - circular type definition>
8430 <MODULE TTCN Temp Temp.ttcn>
8432 modulepar invalidRec tsp_Rec;
8433 type record invalidRec {
8438 type set invalidSet {
8443 type component comp_CT {
8444 var integer v_int := 0;
8448 <RESULT IF_FAIL COUNT 1>
8449 (?im)\bcircular\b.+?\breference\b
8451 <RESULT IF_FAIL COUNT 2>
8454 <RESULT IF_FAIL POSITIVE>
8455 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
8456 <END_RESULT><END_TC>
8459 .*-----------------------------------------------------------*
8460 :h3.Adhoc:: record of [-] in type reference
8461 .*-----------------------------------------------------------*
8463 <TC - record of [-] in type reference>
8466 <MODULE TTCN Temp Temp.ttcn>
8468 type record GetResponseX {
8474 type record MyRecord {
8475 GetResponseX.pcB_list[-] field1
8477 type record of GetResponseX.pcB_list[-] MyPcB_list;
8478 type GetResponseX.pcB_list[-].pcB MyCharType;
8479 type port PCOType message {
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;
8491 const GetResponseX.pcB_list[-] cg_RecofElem := {
8495 modulepar GetResponseX.pcB_list[-] tsp_RecofElem := {
8499 template GetResponseX.pcB_list[-] t_RecofElem := {
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;
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);}
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 { }
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 := {
8542 execute (tc(v_RecofElem));
8546 <MODULE CFG Temp Temp.cfg>
8549 LogSourceInfo := Yes
8550 Logfile := "Temp%i.log"
8552 ConsoleMask := LOG_ALL
8556 <RESULT IF_PASS COUNT 0>
8557 (?im)Dynamic test case error:
8559 <RESULT IF_PASS COUNT 1>
8560 (?im)Overall verdict: pass
8565 .*-----------------------------------------------------------*
8566 :h3.Adhoc:: HP36129: Check for component name correctness
8567 .*-----------------------------------------------------------*
8569 <TC - HP36129: Check for component name correctness>
8572 <MODULE TTCN Temp Temp.ttcn>
8574 type port PT message {
8576 } with { extension "internal" }
8580 function f1() runs on C{
8583 testcase tc() runs on C {
8584 var C comp := C.create("Alma-a.!ta");
8594 <MODULE CFG Temp Temp.cfg>
8597 LogSourceInfo := Yes
8598 "Alma-a.!ta".FileMask := WARNING
8599 ConsoleMask := LOG_ALL
8603 <RESULT IF_PASS COUNT 0>
8604 (?im)Dynamic test case error:
8606 <RESULT IF_PASS COUNT 1>
8607 (?im)Overall verdict: pass
8612 *-----------------------------------------------------------*
8613 :h3.Adhoc:: HT23335: Type Infinity is not a valid value for type `integer' which as subtype (-1..65535)
8614 .*-----------------------------------------------------------*
8616 <TC - HT23335: Type Infinity is not a valid value for type `integer' which as subtype (-1..65535)>
8620 <MODULE TTCN Temp Temp.ttcn>
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)
8628 type record MyRecF {
8629 float fnum (limes_f1..limes_f2)
8632 template MyRecI t1 := { inum := (0..infinity) };
8633 template MyRecF t2 := { fnum := (-infinity..0.0) };
8637 <RESULT IF_FAIL COUNT 2>
8638 (?im)\Infinity is not a valid value for type\b