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.2x/152 91-CRL 113 200/5 Uen
21 :prep.ETH/XZ Jeno Balasko
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 R1.6
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 intlist
3648 testcase tc () runs on empty
3651 var charstring cs_1 := "My name is JJ"
3652 var bitstring bs_1 := '11'B
3653 var charstring cs_2 := replace("My name is JJ", -1, 2, "xx")
3654 var intlist il1 := { 1, 2, 3 }
3655 cs_2 := replace("My name is JJ", 1, 2, '11'B)
3656 cs_2 := replace("My name is JJ", 100, 2, "x")
3657 cs_2 := replace("My name is JJ", a, 100, "x")
3658 cs_2 := replace(cs_1, 1, 2, bs_1)
3659 cs_2 := replace(cs_1, 1.0, 2, "xx")
3660 il1 := replace(il1, 1, 1, cs_1[10])
3665 (?is)\berror:.+?Second operand of operation `replace\(\)' should not be negative
3668 (?is)\berror:.+?Fourth operand of operation `replace\(\)' is of type `bitstring', but a value of type `charstring' was expected here
3671 (?is)\berror:.+?Fourth operand of operation `replace\(\)' is of type `charstring', but a value of type `\@bad_arguments.intlist' was expected here
3674 (?is)\berror:.+?The sum of second operand `index' \(100\) and third operand `len' \(2\) is greater than the length of the first operand \(13\)
3677 (?is)\berror:.+?Third operand `len' \(100\) is greater than the length of the first operand \(13\)
3680 (?is)\berror:.+?Second operand of operation `replace\(\)' should be integer value
3685 .*---------------------------------------------------------------------*
3686 :h3.Adhoc:: runs on self + refers in component type definition
3687 .*---------------------------------------------------------------------*
3689 <TC - runs on self + refers in component type definition>
3692 <MODULE TTCN MTTSM00016005 MTTSM00016005.ttcn>
3693 module MTTSM00016005
3695 type function FT_f_runsOnSelf() runs on self;
3696 type component C { const integer ci:=1; }
3697 type component D extends My_RunsOnSelf_CT { const integer di:=9; }
3698 type component E {const integer ei:=0; }
3699 type component My_RunsOnSelf_CT extends C {
3700 var FT_f_runsOnSelf v_f_runsOnSelf := refers(f_runsOnSomething);
3701 var FT_f_runsOnSelf v_f_runsOnSelf2 := refers(f_runsOnC);
3702 var FT_f_runsOnSelf v_f_runsOnSelf3 := refers(f_runsOnD);
3703 var FT_f_runsOnSelf v_f_runsOnSelf4 := refers(f_runsOnE);
3706 function f_runsOnSomething() runs on My_RunsOnSelf_CT { }
3707 function f_runsOnC() runs on C { }
3708 function f_runsOnD() runs on D { }
3709 function f_runsOnE() runs on E { }
3714 (?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'
3717 (?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'
3722 .*---------------------------------------------------------------------*
3723 :h3.Adhoc:: large integers - array definitions
3724 .*---------------------------------------------------------------------*
3726 <TC - large integers - arrays and large integers>
3729 <MODULE TTCN LargeIntArr LargeIntArr.ttcn>
3732 type integer intarr1[2222222222222222222222222222222]
3733 type integer intarr2[1111111111111111111111111111111..2222222222222222222222222222222]
3734 type integer intarr3[1111111111111111111111111111111..1]
3735 type integer intarr4[2..2222222222222222222222222222222]
3741 (?is)\berror: The array size should be less than `2147483647' instead of `2222222222222222222222222222222'
3744 (?is)\berror: The lower bound of an array index should be less than `2147483647' instead of `1111111111111111111111111111111'
3747 (?is)\berror: The upper bound of an array index should be less than `2147483647' instead of `2222222222222222222222222222222'
3752 .*---------------------------------------------------------------------*
3753 :h3.Adhoc:: large integers - array indexing
3754 .*---------------------------------------------------------------------*
3756 <TC - large integers - array indexing>
3759 <MODULE TTCN LargeIntIndexing LargeIntIndexing.ttcn>
3760 module LargeIntIndexing
3762 type integer intarr4[4]
3764 const integer ci1 := 11111111111111111111111111111111111111
3765 var intarr4 iarr1 := {1, 2, 3, 4}
3766 var intarr4 iarr2 := {1, 2, 3, -444444444444444444444444444}
3768 iarr2[12345678910111213141516] := 1
3773 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `11111111111111111111111111111111111111'
3776 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `12345678910111213141516'
3781 .*---------------------------------------------------------------------*
3782 :h3.Adhoc:: large integers - universal charstring elements
3783 .*---------------------------------------------------------------------*
3785 <TC - large integers - universal charstring elements>
3788 <MODULE TTCN LargeIntUni LargeIntUni.ttcn>
3792 var universal charstring vus1 := char(11111111111111111111111111111111, 0, 0, 0) & char(1, 1, 1, 1)
3793 var universal charstring vus2 := char(-11111111111111111111111111111111, 0, 0, 0) & char(1, 1, 1, 1)
3794 var universal charstring vus3 := char(11111111111111111111111111111111, 12345678910111213141516171819202, 0, 0) & char(1, 1, 1, -1) & char(11111111111111111111111111111111, 22222222222222222222222222222222, 33333333333333333333333333333333, 44444444444444444444444444444444)
3799 (?is)\berror: The first number of quadruple \(group\) must be within the range 0 .. 127 instead of 11111111111111111111111111111111
3802 (?is)\berror: at or before token `-': syntax error, unexpected '-', expecting Number
3805 (?is)\berror: The second number of quadruple \(plane\) must be within the range 0 .. 255 instead of 12345678910111213141516171819202
3808 (?is)\berror: The second number of quadruple \(plane\) must be within the range 0 .. 255 instead of 22222222222222222222222222222222
3811 (?is)\berror: The third number of quadruple \(row\) must be within the range 0 .. 255 instead of 33333333333333333333333333333333
3814 (?is)\berror: The fourth number of quadruple \(cell\) must be within the range 0 .. 255 instead of 44444444444444444444444444444444
3819 .*---------------------------------------------------------------------*
3820 :h3.Adhoc:: large integers - timer arrays
3821 .*---------------------------------------------------------------------*
3823 <TC - large integers - timer arrays>
3826 <MODULE TTCN LargeIntTimer LargeIntTimer.ttcn>
3827 module LargeIntTimer
3830 const integer ci1 := 11111111111111111111111111111111111111
3831 var integer vi1 := ci1
3832 timer tarr1[1] := {[11111111111111111111111111111111111111] := 1}
3833 timer tarr2[vi1] := {[22222222222222222222222222222222222222] := 1, [vi1] := vi1, [vi1 + 1] := 11111111111111111111111111111111111111}
3838 (?is)\berror: Array index overflow: the index value must be at most `0' instead of `11111111111111111111111111111111111111'
3841 (?is)\berror: Reference to a constant value was expected instead of variable `vi1'
3844 (?is)\berror: A value or expression of type float was expected
3847 (?is)\berror: An integer value less than `2147483647' was expected for indexing timer array instead of `22222222222222222222222222222222222222'
3852 .*---------------------------------------------------------------------*
3853 :h3.Adhoc:: large integers - indexed notation
3854 .*---------------------------------------------------------------------*
3856 <TC - large integers - indexed notation>
3859 <MODULE TTCN LargeIntIndexed LargeIntIndexed.ttcn>
3860 module LargeIntIndexed
3862 type record of integer intlist
3863 type set of integer intset
3864 type integer intarr4[4]
3865 template intlist itemp1 := {11111111111111111111111111111111, 11, 111}
3866 template intlist itemp2 := {[11111111111111111111111111111111] := 1}
3867 template intlist itemp3 := {[valueof(itemp1[1])] := 1, [1] := 1, [11111111111111111111111111111111] := 1, [11] := 1, [11111111111111111111111111111111] := 1 }
3868 template intset itemp4 := {[11111111111111111111111111111111] := 1}
3869 template intset itemp5 := {[valueof(itemp1[1])] := 1, [1] := 1, [11111111111111111111111111111111] := 1, [11] := 1, [11111111111111111111111111111111] := 1 }
3870 template intarr4 itemp6 := {[12345678910111213141516171819202] := 1}
3871 template intarr4 itemp7 := {[0] := 1, [12345678910111213141516171819202] := 1, [11111111111111111111111111111111] := 1, [1] := 1, [1] := 1}
3877 (?is)\berror: An integer value less than `2147483647' was expected for indexing type `.+?intlist' instead of `11111111111111111111111111111111'
3880 (?is)\berror: An integer value less than `2147483647' was expected for indexing type `.+?intset' instead of `11111111111111111111111111111111'
3883 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `12345678910111213141516171819202'
3886 (?is)\berror: Array index overflow: the index value must be at most `3' instead of `11111111111111111111111111111111'
3889 (?is)\berror: Duplicate index value `1' for components `5' and `4'
3894 .*---------------------------------------------------------------------*
3895 :h3.Adhoc:: large integers - the substr() predefined function
3896 .*---------------------------------------------------------------------*
3898 <TC - large integers - the substr() predefined function>
3901 <MODULE TTCN LargeIntSubstr LargeIntSubstr.ttcn>
3902 module LargeIntSubstr
3905 var charstring cs1 := substr("example1", 11111111111111111111111111111111, 1)
3906 var charstring cs2 := substr("example2", 1, 11111111111111111111111111111111)
3907 var charstring cs3 := substr("example3", 12345678910111213141516171819202, 11111111111111111111111111111111)
3912 (?is)\berror: The sum of second operand `index' \(11111111111111111111111111111111\) and third operand `returncount' \(1\) is greater than the length of the first operand \(8\)
3915 (?is)\berror: The sum of second operand `index' \(1\) and third operand `returncount' \(11111111111111111111111111111111\) is greater than the length of the first operand \(8\)
3918 (?is)\berror: The sum of second operand `index' \(12345678910111213141516171819202\) and third operand `returncount' \(11111111111111111111111111111111\) is greater than the length of the first operand \(8\)
3923 .*---------------------------------------------------------------------*
3924 :h3.Adhoc:: large integers - enumerations
3925 .*---------------------------------------------------------------------*
3927 <TC - large integers - enumerations>
3930 <MODULE TTCN LargeIntEnum LargeIntEnum.ttcn>
3933 type enumerated enum1 {first(1111111111111111111111111111)}
3939 (?is)\berror: The numeric value of enumeration `first' \(1111111111111111111111111111\) is too large for being represented in memory
3944 .*---------------------------------------------------------------------*
3945 :h3.Adhoc:: large integers - integer subtypes
3946 .*---------------------------------------------------------------------*
3948 <TC - large integers - integer subtypes>
3951 <MODULE TTCN LargeIntSubtypes LargeIntSubtypes.ttcn>
3952 module LargeIntSubtypes
3954 type integer int1 (12345678910111213141516171819..0)
3955 type integer int2 (0..12345678910111213141516171819)
3956 type integer int3 (12345678910111213141516171819..12345678910111213141516171819)
3957 type integer int4[4] (12345678910111213141516171819)
3963 (?is)\berror: lower boundary is bigger than upper boundary in integer subtype range
3968 .*---------------------------------------------------------------------*
3969 :h3.Adhoc:: large integers - value range templates
3970 .*---------------------------------------------------------------------*
3972 <TC - large integers - value range templates>
3975 <MODULE TTCN LargeIntRange LargeIntRange.ttcn>
3976 module LargeIntRange
3978 template integer itemp1 := (12345678910111213141516..1)
3979 template integer itemp2 := (12345678910111213141516..1234567891011121314151617)
3980 template integer itemp3 := (1..1234567891011121314151617)
3981 template integer itemp4 := (11111111111111111111111111)
3987 (?is)\berror: The lower boundary is higher than the upper boundary
3992 .*---------------------------------------------------------------------*
3993 :h3.Adhoc:: large integers - the replace() predefined function
3994 .*---------------------------------------------------------------------*
3996 <TC - large integers - the replace() predefined function>
3999 <MODULE TTCN LargeIntReplace LargeIntReplace.ttcn>
4000 module LargeIntReplace
4003 var charstring cs1 := "exampletext1"
4004 var charstring cs2 := "exampletext2"
4005 cs1 := replace("exampletext1", 11111111111111111111111111111111, 1, "hello")
4006 cs1 := replace("exampletext1", 1, 11111111111111111111111111111111, "hello")
4007 cs1 := replace("exampletext1", 11111111111111111111111111111111, 11111111111111111111111111111111, "hello")
4008 cs1 := replace("exampletext1", 11111111111111111111111111111111, 11111111111111111111111111111111, cs2)
4013 (?is)\berror: The sum of second operand `index' \(11111111111111111111111111111111\) and third operand `len' \(1\) is greater than the length of the first operand \(12\)
4016 (?is)\berror: The sum of second operand `index' \(1\) and third operand `len' \(11111111111111111111111111111111\) is greater than the length of the first operand \(12\)
4019 (?is)\berror: The sum of second operand `index' \(11111111111111111111111111111111\) and third operand `len' \(11111111111111111111111111111111\) is greater than the length of the first operand \(12\)
4024 .*---------------------------------------------------------------------*
4025 :h3.Adhoc:: large integers - other predefined functions
4026 .*---------------------------------------------------------------------*
4028 <TC - large integers - other predefined functions>
4031 <MODULE TTCN LargeIntPredef LargeIntPredef.ttcn>
4032 module LargeIntPredef
4039 var universal charstring us1
4041 bs1 := int2bit(1234567891011121314151617181920, 1)
4042 bs1 := int2bit(1, 1234567891011121314151617181920)
4043 bs1 := int2bit(1234567891011121314151617181920, 1234567891011121314151617181920)
4044 hs1 := int2hex(1234567891011121314151617181920, 1)
4045 hs1 := int2hex(1, 1234567891011121314151617181920)
4046 hs1 := int2hex(1234567891011121314151617181920, 1234567891011121314151617181920)
4047 os1 := int2oct(1234567891011121314151617181920, 1)
4048 os1 := int2oct(1, 1234567891011121314151617181920)
4049 os1 := int2oct(1234567891011121314151617181920, 1234567891011121314151617181920)
4050 cs1 := regexp("Hello, World!", "(Hello, World!)*", 1234567891011121314151617181920)
4051 cs1 := int2char(1234567891011121314151617181920)
4052 us1 := int2unichar(1234567891011121314151617181920)
4057 (?is)\berror: Value 1234567891011121314151617181920 does not fit in length 1
4060 (?is)\berror: The length of the resulting string is too large for being represented in memory
4063 (?is)\berror: The operand of operation `int2char\(\)' should be in range 0..127
4066 (?is)\berror: First operand of operation `int2unichar\(\)' should be in range 0..2147483647
4069 (?is)\berror: The the third operand of `regexp\(\)' is too large: The requested group index is 1234567891011121314151617181920, but the pattern contains only 1 group
4074 .*---------------------------------------------------------------------*
4075 :h3.Adhoc:: large integers - length restrictions
4076 .*---------------------------------------------------------------------*
4078 <TC - large integers - length restrictions>
4081 <MODULE TTCN LargeIntLenRest LargeIntLenRest.ttcn>
4082 module LargeIntLenRest
4084 type record of integer intlist
4085 type set of integer intset
4086 type integer intarr[1]
4087 template intlist ilent1 := {1, 2, 3} length(12345678910111213141516)
4088 template intlist ilent2 := {1, 12345678910111213141516} length(1..12345678910111213141516)
4089 template intlist ilent3 := {1, 2, 3} length(-2..-12345678910111213141516)
4090 template intlist ilent4 := {1, 2, 3} length(12345678910111213141516..1)
4091 template intlist ilent5 := {1, 2, 3} length(12345678910111213141516..12345678910111213141516)
4092 template intarr iat1 := {1} length(1111111111111111111111111111)
4093 template intarr iat2 := {1} length(1..1111111111111111111111111111)
4094 template intarr iat3 := {1} length(1111111111111111111111111111..1)
4095 template intarr iat4 := {1} length(1111111111111111111111111111..1111111111111111111111111111)
4101 (?is)\berror: There are fewer \(3\) elements in the template than it is allowed by the length restriction \(12345678910111213141516\)
4104 (?is)\berror: There are fewer \(3\) elements in the template than it is allowed by the length restriction \(at least 12345678910111213141516\)
4107 (?is)\berror: The upper boundary of the length restriction must be a non-negative integer value instead of -12345678910111213141516
4110 (?is)\berror: The lower boundary of the length restriction must be a non-negative integer value instead of -2
4113 (?is)\berror: The upper boundary of the length restriction \(1\) cannot be smaller than the lower boundary \(1111111111111111111111111111\)
4116 (?is)\berror: An integer value less than `2147483647' was expected as the upper boundary of the length restriction instead of `1111111111111111111111111111'
4119 (?is)\berror: An integer value less than `2147483647' was expected as the lower boundary of the length restriction instead of `1111111111111111111111111111'
4122 (?is)\berror: The number of elements allowed by the length restriction \(1111111111111111111111111111\) contradicts the array size \(1\)
4127 .*---------------------------------------------------------------------*
4128 :h3.Adhoc:: large integers - basic operations
4129 .*---------------------------------------------------------------------*
4131 <TC - large integers - basic operations>
4134 <MODULE TTCN LargeIntBasic LargeIntBasic.ttcn>
4135 module LargeIntBasic
4140 bs1 := bs1 << 1234567891011121314151617181920
4141 bs1 := bs1 >> 1234567891011121314151617181920
4142 cs1 := cs1 <@ 1234567891011121314151617181920
4143 cs1 := cs1 @> 1234567891011121314151617181920
4148 (?is)\berror: Right operand of operation `<<' should be less than `2147483647' instead of `1234567891011121314151617181920'
4151 (?is)\berror: Right operand of operation `>>' should be less than `2147483647' instead of `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'
4162 .*---------------------------------------------------------------------*
4163 :h3.Adhoc:: TR 921 - indexing string type template variables
4164 .*---------------------------------------------------------------------*
4166 <TC - TR 921 - indexing string type template variables>
4169 <MODULE TTCN TR921 TR921.ttcn>
4173 var template octetstring ost := '11'O
4174 var template charstring cst := "11"
4175 var template bitstring bst := '11'B
4176 var template hexstring hst := '11'H
4177 var template universal charstring ust := "11"
4181 if ('11'O == ost[0]) { }
4182 if (ost[0] == '11'O) { }
4187 if ("11" == cst[0]) { }
4188 if (cst[0] == "11") { }
4193 if ('11'B == bst[0]) { }
4194 if (bst[0] == '11'B) { }
4199 if ('11'H == hst[0]) { }
4200 if (hst[0] == '11'H) { }
4202 // Universal charstring.
4205 if ("11" == ust[0]) { }
4206 if (ust[0] == "11") { }
4212 (?is)\berror: Reference to a value was expected instead of template variable `ost'
4215 (?is)\berror: Reference to template variable `ost' can not be indexed
4218 (?is)\berror: Reference to a value was expected instead of template variable `cst'
4221 (?is)\berror: Reference to template variable `cst' can not be indexed
4224 (?is)\berror: Reference to a value was expected instead of template variable `bst'
4227 (?is)\berror: Reference to template variable `bst' can not be indexed
4230 (?is)\berror: Reference to a value was expected instead of template variable `hst'
4233 (?is)\berror: Reference to template variable `hst' can not be indexed
4236 (?is)\berror: Reference to a value was expected instead of template variable `ust'
4239 (?is)\berror: Reference to template variable `ust' can not be indexed
4244 .*---------------------------------------------------------------------*
4245 :h3.Adhoc:: pattern concatenation - pattern concatenation mistakes
4246 .*---------------------------------------------------------------------*
4248 <TC - pattern concatenation - pattern concatenation mistakes>
4251 <MODULE TTCN PatternCat PatternCat.ttcn>
4254 function myfunc(in integer i) return charstring { return "xyz" }
4255 function myfuncp(in integer i) return charstring { return "xyz" }
4256 type record srec { charstring s }
4257 type record of srec slist
4260 var integer myvar := 123
4261 var charstring cs := "xyz"
4262 var octetstring os := '0123'O
4264 var srec myrec := { "xyz" }
4265 mylist[0].s := "xyz"
4267 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & 12 }
4268 { var template charstring myt := pattern "valami" & cs & "megegyszer" & 12 & "utoljara" }
4269 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & refers(myfunc) }
4270 { var template charstring myt := pattern "valami" & cs & "megegyszer" & refers(myfunc) & "utoljara" }
4271 { var template charstring myt := pattern "valami" & cs & "megegyszer" & myfunc() & "utoljara" }
4272 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & myfunc() }
4273 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & myfuncp(1) }
4274 { var template charstring myt := pattern "valami" & cs & "megegyszer" & myfuncp(1) & "utoljara" }
4275 { var template charstring myt := pattern "valami" & cs & "megegyszer" & myfuncp(myvar) & "utoljara" }
4276 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & myfuncp(myvar) }
4277 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & myvar }
4278 { var template charstring myt := pattern "valami" & cs & "megegyszer" & myvar & "utoljara" }
4279 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & slist }
4280 { var template charstring myt := pattern "valami" & cs & "megegyszer" & slist & "utoljara" }
4281 { var template charstring myt := pattern "valami" & cs & "megegyszer" & "utoljara" & os }
4282 { var template charstring myt := pattern "valami" & cs & "megegyszer" & os & "utoljara" }
4287 (?is)\berror: at or before token `12': syntax error, unexpected Number, expecting Identifier or Cstring
4290 (?is)\berror: at or before token `refers': syntax error, unexpected RefersKeyword, expecting Identifier or Cstring
4293 (?is)\berror: at or before token `\(': syntax error, unexpected '\('
4298 .*---------------------------------------------------------------------*
4299 :h3.Adhoc:: Type Compatibility - Sample tests for structured types
4300 .*---------------------------------------------------------------------*
4302 <TC - Type Compatibility - Sample test for structured types>
4305 <MODULE TTCN Compat1 Compat1.ttcn>
4307 type record myrec1 { integer a }
4308 type record myrec2 { integer a }
4309 type record length(2) of integer myrecof1
4310 type record of integer myrecof2
4311 type record length(4) of integer myrecof3
4312 template myrecof3 t_myrecof3 := { 1, 2, 3, 4 }
4313 type integer myarr1[4]
4324 var myrec1 r1 := { 1 }
4328 var myrecof1 ro1 := { 1, 2 }
4329 var myrecof2 ro2 := { }
4330 var myrecof3 ro3 := { 1, 2, 3, 4 }
4331 var myarr1 ar1 := { 1, 2, 3, 4 }
4334 ro1 := ar1 // !OK -> Incompatible dimension/subtype.
4335 if (r1 == r2) { } // OK
4336 if (ro1 == ro3) { } // !OK -> Incompatible subtypes.
4337 if (uni1 == uni2) { } // OK -> Can be compatible at run-time.
4338 ro2 := substr(myrec1 : t_myrecof3, 0, 1) // !OK
4342 <RESULT LTRT COUNT 1>
4343 (?is)\berror: Type mismatch: a value of type `\@Compat1.myrec2' was expected instead of `\@Compat1.myrec1'
4345 <RESULT LTRT COUNT 1>
4346 (?is)\berror: Type mismatch: a value of type `\@Compat1.myrecof1' was expected instead of `integer\[4\]'
4348 <RESULT LTRT COUNT 2>
4349 (?is)\berror: The operands of operation `==' should be of compatible types
4351 <RESULT FTRT COUNT 1>
4352 (?is)\berror: Type mismatch: `\@Compat1.myrecof1' and `integer\[4\]' are not compatible: Incompatible record of/SEQUENCE OF subtypes
4355 (?is)\berror: Type mismatch: `@Compat1.myrecof1' and `@Compat1.myrecof3' are not compatible: Incompatible record of/SEQUENCE OF subtypes
4357 <RESULT LTRT COUNT 1>
4358 (?is)\berror: Type mismatch: a value or template of type `\@Compat1.myrec1' was expected instead of `\@Compat1.myrecof3'
4361 (?is)\berror: First operand of operation `substr\(\)' should be a string, `record of' or `set of' value
4366 .*---------------------------------------------------------------------*
4367 :h3.Adhoc:: Type Compatibility - Simple records and others
4368 .*---------------------------------------------------------------------*
4370 <TC - Type Compatibility - Records and others>
4373 <MODULE TTCN Compat2 Compat2.ttcn>
4375 type port MyPort message {
4378 inout myrec1_alias // !OK
4380 type component Empty {
4384 type record myrec1 { integer a }
4385 type myrec1 myrec1_alias // Only a "typedef".
4386 type record myrec2 { integer a }
4387 type record myrec3 { integer a optional }
4388 type record myrec4 { integer a, integer b }
4389 type set myset1 { integer a }
4390 type set of integer mysetof1
4391 type record of integer myrecof1
4392 type record length(1) of integer myrecof2
4393 type record length(2) of integer myrecof3
4394 type integer myarr1[1]
4403 testcase tc1_Compat2(in myrec1 p1) runs on Empty {
4404 // For template instances the compatibility check is reversed.
4405 var myrec4 rec4 := { 1, 2 }
4406 activate(as1_Compat2(myrec2 : { 1 })) // OK
4407 activate(as1_Compat2(myrec3 : { 1 })) // !OK
4408 activate(as1_Compat2(rec4)) // !OK
4410 P.receive(rec4) // !OK
4412 function f1_Compat2(in myrec1 p1) { }
4413 function f2_Compat2() return myrec1 {
4417 if (l_rec2.a > l_rec2.a) { return l_rec2 } // OK
4418 else if (l_rec2.a == l_rec2.a) { return l_rec3 } // !OK
4419 else if (l_rec2.a < l_rec2.a) { return l_rec4 } // !OK
4420 else { return { 1 } }
4422 altstep as1_Compat2(in myrec1 p1) runs on Empty { [p1.a > p1.a] T.timeout { } }
4424 var myrec1 rec1 := { 1 }
4425 var myrec2 rec2 := rec1 // OK
4426 var myrec3 rec3 := { omit }
4427 var myrec4 rec4 := { rec1.a, rec2.a }
4428 var myset1 set1 := { 1 }
4429 var mysetof1 setof1 := { 1 }
4430 var myrecof1 recof1 := { 1 }
4431 var myrecof2 recof2 := { 1 }
4432 var myrecof3 recof3 := { 1, 2 }
4433 var myarr1 arr1 := { 1 }
4434 var myarr2 arr2 := { 1, 2 }
4435 var myuni1 uni1 := { a := { 1 } }
4436 var myuni2 uni2 := { b := { 1 } }
4437 var anytype any1 := { myrec1 := { 1 } }
4439 // Records <-> records.
4441 if (rec2 == rec3 or rec2 != rec3) { } // OK
4442 execute(tc1_Compat2(rec2)) // OK
4443 execute(tc1_Compat2(rec3)) // !OK
4444 execute(tc1_Compat2(rec4)) // !OK
4445 f1_Compat2(rec2) // OK
4446 f1_Compat2(rec3) // !OK
4447 f1_Compat2(rec4) // !OK
4449 // Records <-> sets.
4452 execute(tc1_Compat2(set1)) // !OK
4453 f1_Compat2(set1) // !OK
4454 if (set1 == rec1 or rec1 != set1) { } // !OK
4456 // Records <-> set ofs.
4459 execute(tc1_Compat2(setof1)) // !OK
4460 f1_Compat2(setof1) // !OK
4461 if (setof1 == rec1 or rec1 != setof1) { } // !OK
4463 // Records <-> record ofs.
4464 recof1 := rec1 // OK
4465 rec1 := recof1 // OK
4466 execute(tc1_Compat2(recof1)) // OK
4467 f1_Compat2(recof1) // OK
4468 if (recof1 == rec1 or rec1 != recof1) { } // OK
4470 // Records <-> record ofs (good restriction).
4471 recof2 := rec1 // OK
4472 rec1 := recof2 // OK
4473 execute(tc1_Compat2(recof2)) // OK
4474 f1_Compat2(recof2) // OK
4475 if (recof2 == rec1 or rec1 != recof2) { } // OK
4477 // Records <-> record ofs (bad restriction).
4478 recof3 := rec1 // !OK
4479 rec1 := recof3 // !OK
4480 execute(tc1_Compat2(recof3)) // !OK
4481 f1_Compat2(recof3) // !OK
4482 if (recof3 == rec1 or rec1 != recof3) { } // !OK
4484 // Records <-> arrays (good dimension).
4487 execute(tc1_Compat2(arr1)) // OK
4488 f1_Compat2(arr1) // OK
4489 if (arr1 == rec1 or rec1 != arr1) { } // OK
4491 // Records <-> arrays (bad dimension).
4494 if (arr1 == rec4 or rec4 != arr1) { } // !OK
4496 // Records <-> unions.
4499 if (uni1 == rec1 or rec1 != uni1) { } // !OK
4501 // Records <-> anytypes.
4504 if (any1 == rec1 or rec1 != any1) { } // !OK
4506 // Unions <-> unions.
4509 if (uni1 == uni2 or uni2 == uni1) { } // OK
4511 // Unions <-> anytypes.
4514 if (uni1 == any1 or any1 == uni1) { } // !OK
4516 } with { extension "anytype myrec1, myrec2" }
4518 <RESULT FTRT COUNT 1>
4519 (?is)\berror: Duplicate incoming message type `\@Compat2.myrec1'
4521 <RESULT FTRT COUNT 1>
4522 (?is)\berror: Duplicate outgoing message type `\@Compat2.myrec1'
4524 <RESULT FTRT COUNT 2>
4525 (?is)\bnote: Type `\@Compat2.myrec1' is already listed here
4527 <RESULT FTRT COUNT 1>
4528 (?is)\berror: Message type `\@Compat2.myrec4' is not present on the outgoing list of port type `\@Compat2.MyPort'
4530 <RESULT FTRT COUNT 1>
4531 (?is)\berror: Message type `\@Compat2.myrec4' is not present on the incoming list of port of type `\@Compat2.MyPort'
4533 <RESULT FTRT COUNT 3>
4534 (?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
4536 <RESULT FTRT COUNT 4>
4537 (?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
4539 <RESULT FTRT COUNT 4>
4540 (?is)\berror: Type mismatch: `\@Compat2.myrec1' and `\@Compat2.myrec4' are not compatible: The number of fields in record/SEQUENCE types must be the same
4542 <RESULT FTRT COUNT 4>
4543 (?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
4545 <RESULT FTRT COUNT 2>
4546 (?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
4548 <RESULT FTRT COUNT 4>
4549 (?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
4551 <RESULT FTRT COUNT 2>
4552 (?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
4554 <RESULT FTRT COUNT 4>
4555 (?is)\berror: Type mismatch: `\@Compat2.myrec1' and `\@Compat2.myrecof3' are not compatible: Incompatible record of/SEQUENCE OF subtypes
4557 <RESULT FTRT COUNT 2>
4558 (?is)\berror: Type mismatch: `\@Compat2.myrecof3' and `\@Compat2.myrec1' are not compatible: Incompatible record of/SEQUENCE OF subtypes
4560 <RESULT FTRT COUNT 2>
4561 (?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
4563 <RESULT FTRT COUNT 2>
4564 (?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
4566 <RESULT FTRT COUNT 2>
4567 (?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
4569 <RESULT FTRT COUNT 2>
4570 (?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
4572 <RESULT FTRT COUNT 2>
4573 (?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
4575 <RESULT FTRT COUNT 2>
4576 (?is)\berror: Type mismatch: `\@Compat2.anytype' and `\@Compat2.myrec1' are not compatible: Type anytype is compatible only with other anytype types
4578 <RESULT FTRT COUNT 2>
4579 (?is)\berror: Type mismatch: `\@Compat2.myuni1' and `\@Compat2.anytype' are not compatible: Type anytype is compatible only with other anytype types
4581 <RESULT FTRT COUNT 2>
4582 (?is)\berror: Type mismatch: `\@Compat2.anytype' and `\@Compat2.myuni1' are not compatible: Type anytype is compatible only with other anytype types
4587 .*---------------------------------------------------------------------*
4588 :h3.Adhoc:: Type Compatibility - Standard compile-time errors
4589 .*---------------------------------------------------------------------*
4591 <TC - Type Compatibility - Standard compile-time errors>
4594 <MODULE TTCN Compat3 Compat3.ttcn>
4595 // Compile-time errors from the standard.
4598 integer a(0..10) optional,
4599 integer b(0..10) optional,
4605 integer b(0..10) optional,
4634 type union U1 { integer i }
4635 type union U2 { integer i, boolean b }
4638 var AType MyVarA := { -, 1, true }
4639 var BType MyVarB := { omit, 2, true }
4640 var CType MyVarC := { 3, omit, true }
4641 var DType MyVarD := { 4, 4, true }
4642 var EType MyVarE := { 5, 5, true, omit }
4643 var U1 u1 := { i := 1 }
4646 MyVarA := MyVarB // OK
4647 MyVarC := MyVarB // OK
4648 MyVarA := MyVarD // !OK
4649 MyVarA := MyVarE // !OK
4651 var FType MyVarF := { a := 1, c := true }
4652 MyVarF := MyVarA // !OK
4654 var anytype x := u1 // !OK
4656 } with { extension "anytype integer" }
4658 <RESULT FTRT COUNT 1>
4659 (?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
4661 <RESULT FTRT COUNT 1>
4662 (?is)\berror: Type mismatch: `\@Compat3.AType' and `\@Compat3.EType' are not compatible: The number of fields in record/SEQUENCE types must be the same
4664 <RESULT FTRT COUNT 1>
4665 (?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
4667 <RESULT FTRT COUNT 1>
4668 (?is)\berror: Type mismatch: `@Compat3.anytype' and `\@Compat3.U1' are not compatible: Type anytype is compatible only with other anytype types
4673 .*---------------------------------------------------------------------*
4674 :h3.Adhoc:: Type Compatibility - More complex types
4675 .*---------------------------------------------------------------------*
4677 <TC - Type Compatibility - More complex types>
4680 <MODULE TTCN Compat4 Compat4.ttcn>
4682 type record myrec1 {
4683 integer f1 optional,
4687 type record myrec2 {
4692 type record of myrec1 mylist1
4693 type myrec2 myarr2[2]
4694 type mylist1 myarr1[2] // Top-level 1.
4695 type record of myarr2 mylist2 // Top-level 2.
4697 var myarr1 arr1 := {
4698 { { omit, 99, false }, { 1, 100, true } },
4699 { { 1, 2, false }, { 0, 1, false } }
4701 var mylist2 ml2 := {
4702 { { 1, 2, false }, { 11, 22, false } },
4703 { { -1, -2, true }, { -11, -22, true } }
4707 if (arr1 == ml2 or ml2 != arr1) { } // !OK
4711 <RESULT FTRT COUNT 2>
4712 (?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
4714 <RESULT FTRT COUNT 2>
4715 (?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
4720 .*---------------------------------------------------------------------*
4721 :h3.Adhoc:: Type Compatibility - Arrays and other list types
4722 .*---------------------------------------------------------------------*
4724 <TC - Type Compatibility - Arrays and other list types>
4727 <MODULE TTCN Compat5 Compat5.ttcn>
4729 const integer i1[2 .. 4] := { 1, 2, 3 }
4730 const integer i2[3] := i1
4731 const integer i3[1..3] := i1
4732 const integer i1[2][1..2] := { { 1, 2 }, { 3, 4 } };
4733 const integer i2[2][0..1] := i1;
4738 <RESULT FTRT COUNT 1>
4739 (?is)\berror: Type mismatch: `integer\[3\]' and `integer\[2..4\]' are not compatible: Array types should have the same dimension
4741 <RESULT FTRT COUNT 1>
4742 (?is)\berror: Type mismatch: `integer\[1..3\]' and `integer\[2..4\]' are not compatible: Array types should have the same dimension
4744 <RESULT FTRT COUNT 1>
4745 (?is)\berror: Type mismatch: `integer\[2\]\[0..1\]' and `integer\[2..4\]' are not compatible: Array types should have the same dimension
4747 <RESULT LTRT COUNT 1>
4748 (?is)\berror: Type mismatch: a value of type `integer\[3\]' was expected instead of `integer\[2..4\]'
4750 <RESULT LTRT COUNT 1>
4751 (?is)\berror: Type mismatch: a value of type `integer\[1..3\]' was expected instead of `integer\[2..4\]'
4753 <RESULT LTRT COUNT 1>
4754 (?is)\berror: Type mismatch: a value of type `integer\[2\]\[0..1\]' was expected instead of `integer\[2..4\]'
4759 .*---------------------------------------------------------------------*
4760 :h3.Adhoc:: Type Compatibility - Templates of all kind
4761 .*---------------------------------------------------------------------*
4763 <TC - Type Compatibility - Templates of all kind>
4766 <MODULE TTCN Compat6 Compat6.ttcn>
4768 type record rtype { integer i, boolean b }
4769 type set stype { integer i, boolean b }
4770 type record r2type { integer i1, integer i2 }
4771 type set of integer s2type
4773 template rtype t := { 1, true }
4774 template stype t1 modifies t := { b := false }
4775 template r2type u := { 1, 2 };
4776 template s2type u1 modifies u := { 2, 1 };
4778 // Test for the first bug (TR 955).
4779 type record of integer b1_intlist
4780 type set of integer b1_intset
4781 const b1_intlist c_b1 := { 1, 2, 3 }
4782 template b1_intset t_b1 := { 3, 2, 1 }
4785 var template rtype tv1
4786 var template r2type tv2
4788 if (match(valueof(t), u1)) { }
4789 if (match(c_b1, t_b1)) { }
4793 <RESULT FTRT COUNT 1>
4794 (?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
4796 <RESULT FTRT COUNT 1>
4797 (?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
4799 <RESULT FTRT COUNT 1>
4800 (?is)\berror: Type mismatch: `\@Compat6.rtype.b' of type `boolean' and `\@Compat6.r2type.i2' of type `integer' are not compatible
4802 <RESULT FTRT COUNT 1>
4803 (?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
4805 <RESULT FTRT COUNT 1>
4806 (?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
4808 <RESULT LTRT COUNT 1>
4809 (?is)\berror: The modified template has different type than base template `\@Compat6.t': `\@Compat6.rtype' was expected instead of `\@Compat6.stype'
4811 <RESULT LTRT COUNT 1>
4812 (?is)\berror: The modified template has different type than base template `\@Compat6.u': `\@Compat6.r2type' was expected instead of `\@Compat6.s2type'
4814 <RESULT LTRT COUNT 1>
4815 (?is)\berror: Type mismatch: a value or template of type `\@Compat6.rtype' was expected instead of `\@Compat6.r2type'
4817 <RESULT LTRT COUNT 1>
4818 (?is)\berror: Type mismatch: a value or template of type `\@Compat6.s2type' was expected instead of `\@Compat6.rtype'
4820 <RESULT LTRT COUNT 1>
4821 (?is)\berror: Type mismatch: a value of type `\@Compat6.b1_intset' was expected instead of `\@Compat6.b1_intlist'
4829 .*---------------------------------------------------------------------*
4830 :h3.Adhoc:: Type Compatibility - Recursive types
4831 .*---------------------------------------------------------------------*
4833 <TC - Type Compatibility - Recursive types>
4836 <MODULE TTCN Compat6 Compat6.ttcn>
4838 type record of recR recofR
4839 type record recR { recofR rof optional }
4840 type record c1 { recR f1 }
4841 type record c11 { c1 f1 }
4842 type record c2 { recofR f1 }
4843 type record c22 { c2 f1 }
4854 // Make sure that we don't stuck in an infinite recursion.
4855 var recofR v_rof := { { omit } }
4856 var recR v_r := { rof := omit }
4857 var c11 cc1 := { f1 := { { omit } } }
4858 var c22 cc2 := { f1 := { { { omit } } } }
4862 if (v_r.rof == omit) { }
4864 if (cc1 == v_r or v_rof == cc2) { } // Just to get an error...
4865 var A a := { f1 := 1, f2 := { f1 := { 1, omit }, f2 := 11 } }
4866 var B b := { f1 := a, f2 := 1 }
4867 if (a == b and not b != a) { }
4871 <RESULT FTRT COUNT 1>
4872 (?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
4874 <RESULT FTRT COUNT 1>
4875 (?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
4877 <RESULT FTRT COUNT 1>
4878 (?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
4880 <RESULT FTRT COUNT 1>
4881 (?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
4883 <RESULT LTRT COUNT 4>
4884 (?is)\berror: The operands of operation `==' should be of compatible types
4886 <RESULT LTRT COUNT 1>
4887 (?is)\berror: The operands of operation `!=' should be of compatible types
4889 <RESULT LTRT COUNT 1>
4890 (?is)\berror: Type mismatch: a value of type `\@Compat6.c11' was expected instead of `\@Compat6.c22'
4892 <RESULT LTRT COUNT 1>
4893 (?is)\berror: Type mismatch: a value of type `\@Compat6.recR' was expected instead of `\@Compat6.recofR'
4895 <RESULT LTRT COUNT 1>
4896 (?is)\berror: Type mismatch: a value of type `\@Compat6.recofR' was expected instead of `\@Compat6.recR'
4901 .*---------------------------------------------------------------------*
4902 :h3.Adhoc:: Default values of modified parametrized templates
4903 .*---------------------------------------------------------------------*
4905 <TC - Default values of modified parametrized templates>
4908 <MODULE TTCN TDefPar TDefPar.ttcn>
4910 // Negative tests for ETSI CR5091.
4912 type record MyRecordType {
4913 integer field1 optional,
4918 // For value parameters.
4920 template MyRecordType MyTemplate1(integer p_int) := {
4926 template MyRecordType MyTemplate2(integer p_int := -) modifies MyTemplate1 := {
4930 template MyRecordType MyTemplate3(integer p_int := -) := {
4934 template MyRecordType MyTemplate4(integer p_int := 1, charstring p_str, boolean p_bool) := {
4935 p_int, p_str, p_bool
4938 template MyRecordType MyTemplate5(integer p_int := -, charstring p_str := -, boolean p_bool := -) modifies MyTemplate4 := {
4939 p_int, p_str, p_bool
4942 template MyRecordType MyTemplate6(integer p_int := 1, charstring p_str, boolean p_bool, octetstring p_ostr := -) modifies MyTemplate4 := {
4943 p_int, p_str, p_bool
4946 // For template parameters.
4948 template MyRecordType TMyTemplate1(template integer p_int) := {
4954 template MyRecordType TMyTemplate2(template integer p_int := -) modifies TMyTemplate1 := {
4958 template MyRecordType TMyTemplate3(template integer p_int := -) := {
4962 template MyRecordType TMyTemplate4(template integer p_int := 1, template charstring p_str, template boolean p_bool) := {
4963 p_int, p_str, p_bool
4966 template MyRecordType TMyTemplate5(template integer p_int := -, template charstring p_str := -, template boolean p_bool := -) modifies TMyTemplate4 := {
4967 p_int, p_str, p_bool
4970 template MyRecordType TMyTemplate6(template integer p_int := 1, template charstring p_str, template boolean p_bool, template octetstring p_ostr := -) modifies TMyTemplate4 := {
4971 p_int, p_str, p_bool
4974 template MyRecordType TMyTemplate7(template integer p_int := 0) modifies MyRecordType := {
4978 type component Empty { timer T := 1.0 }
4980 testcase TC1(in integer p1 := -) runs on Empty { }
4981 testcase TC2(in template integer p1 := -) runs on Empty { }
4983 function Func1(in integer p1 := -) { }
4984 function Func2(in template integer p1 := -) { }
4986 altstep Alt1(in integer p1 := -) runs on Empty { [1 > 2] T.timeout { } }
4987 altstep Alt2(in template integer p1 := -) runs on Empty { [1 > 2] T.timeout { } }
4993 (?is)\berror: Not used symbol \(`-'\) doesn't have the corresponding default parameter in the base template
4996 (?is)\berror: Only modified templates are allowed to use the not used symbol \(`-'\) as the default parameter
4999 (?is)\berror: integer value was expected
5002 (?is)\berror: character string value was expected
5005 (?is)\berror: boolean value was expected
5008 (?is)\berror: octetstring value was expected
5011 (?is)\berror: Reference to a template was expected in the `modifies' definition instead of type `\@TDefPar.MyRecordType'
5019 *---------------------------------------------------------------------*
5020 :h3.Adhoc:: __SCOPE__ macro
5021 .*---------------------------------------------------------------------*
5023 <TC - __SCOPE__ macro>
5026 <MODULE TTCN TDefPar TDefPar.ttcn>
5028 // Negative tests for __SCOPE__ macro.
5030 type enumerated Dummy { Dummy1, Dummy2 };
5032 type record MyRecord {
5034 charstring field2 (__SCOPE__) optional
5037 type record MyRecord2 {
5039 charstring field2 (__SCOPE__)
5043 template MyRecord t_MyTemplate := {
5044 field1 := __SCOPE__,
5045 //field2 := __SCOPE__ //NOK MyRecord not equal with t_MyTemplate
5046 field2 := "MyRecord"
5049 template MyRecord2 t_MyTemplate2 := {
5051 field1 := __SCOPE__,
5060 (?is)\berror: "t_MyTemplate2" is not a valid value for type `charstring' which has subtype \("MyRecord"\)
5063 (?is)\berror: "t_MyTemplate2" is not a valid value for type `charstring' which has subtype \("MyRecord2"\)
5068 *---------------------------------------------------------------------*
5069 :h3.Adhoc:: public/private/friend
5070 .*---------------------------------------------------------------------*
5072 <TC - public/private/friend>
5075 <MODULE TTCN module1 module1.ttcn>
5079 public modulepar charstring ts_m1:="public";
5080 private modulepar charstring ts_m2:="private";
5081 friend modulepar charstring ts_m3:="friend";
5083 friend module module2;
5085 private import from module2 all;//OK
5086 private import from module3 all;//OK
5087 private import from module4 all;//OK
5089 const module2Type akarmi1 := 1; //OK, type is implicitly public
5090 const module2TypePublic akarmi2 := 2; //OK, type is explicitly public
5091 const module2TypeFriend akarmi3 := 3; //OK, module1 is friend of module2
5092 const module2TypePrivate akarmi4 := 4; //NOK, module2TypePrivate is private to module2
5095 const module3Type akarmi5 := 5; //OK, type is implicitly public
5096 const module3TypePublic akarmi6 := 6; //OK, type is explicitly public
5097 const module3TypeFriend akarmi7 := 7; //NOK, module1 is NOT a friend of module3
5098 const module3TypePrivate akarmi8 := 8; //NOK, module2TypePrivate is private to module2
5101 function MyFunc1() runs on Lib4_CT {} //OK
5102 function MyFunc2() runs on Lib4Friend_CT {} //OK, module1 is friend for module4
5103 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!
5106 function f_set2_Lib4_1() runs on Lib4_CT { v_Lib4_1 := 0 } //OK
5107 function f_set2_Lib4_2() runs on Lib4_CT { v_Lib4_2 := 0 } //OK
5108 function f_set2_Lib4_3() runs on Lib4_CT { v_Lib4_3 := 0 } //OK
5109 function f_set2_Lib4Friend_1() runs on Lib4Friend_CT { v_Lib4Friend_1 := 0 } //OK
5110 function f_set2_Lib4Friend_2() runs on Lib4Friend_CT { v_Lib4Friend_2 := 0 } //OK
5111 function f_set2_Lib4Friend_3() runs on Lib4Friend_CT { v_Lib4Friend_3 := 0 } //OK
5114 type component User_CT extends Lib4_CT {};
5115 function f_set3_Lib4_1() runs on User_CT { v_Lib4_1 := 0 } //OK
5116 function f_set3_Lib4_2() runs on User_CT { v_Lib4_2 := 0 } //OK
5117 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)
5119 //in short: visibility of the component type definition (name) and allowed use of the component
5120 //type definitions are two different things. Component type visibility is checked when checking
5121 //the runs on clause. Component definition visibility is checked (after a successful runs on
5122 //check), when the definition is used within the body of the function
5125 //All setter functions of module4 are public, hence can be called from any function
5126 //with a compatible runs on clause
5127 function f_MyFunc_1() runs on User_CT { f_set_Lib4_1() } //OK
5128 function f_MyFunc_2() runs on User_CT { f_set_Lib4_2() } //OK
5129 function f_MyFunc_3() runs on User_CT { f_set_Lib4_3() } //OK
5131 type component UserFriend_CT extends Lib4Friend_CT {}; //OK
5132 function f_MyFuncFriend_1() runs on UserFriend_CT { f_set_Lib4Friend_1() } //OK
5133 function f_MyFuncFriend_2() runs on UserFriend_CT { f_set_Lib4Friend_2() } //OK
5134 function f_MyFuncFriend_3() runs on UserFriend_CT { f_set_Lib4Friend_3() } //OK
5137 type component UserPrivate_CT extends Lib4Private_CT {}; //NOK, the name Lib4Private_CT is not visible in module1
5138 function f_MyFuncPrivate_1() runs on UserPrivate_CT { f_set_Lib4Private_1() } //NOK, UserPrivate_CT has an error
5139 function f_MyFuncPrivate_2() runs on UserPrivate_CT { f_set_Lib4Private_2() } //NOK, UserPrivate_CT has an error
5140 function f_MyFuncPrivate_3() runs on UserPrivate_CT { f_set_Lib4Private_3() } //NOK, UserPrivate_CT has an error
5143 var Lib4Private_CT v_Lib4Private := Lib4Private_CT.create; // NOK, the name Lib4Privae_CT is not visible in module1
5149 <MODULE TTCN module2 module2.ttcn>
5152 friend module module1;
5153 public group g_Group1{
5154 type integer module2Type;
5155 public type integer module2TypePublic;
5156 friend type integer module2TypeFriend;
5157 private type integer module2TypePrivate;
5160 /*private*/ group g_Group2{
5161 type integer module2Type2;
5162 public type integer module2TypePublic2;
5163 friend type integer module2TypeFriend2;
5164 private type integer module2TypePrivate2;
5167 /*friend*/ group g_Group3{
5168 type integer module2Type3;
5169 public type integer module2TypePublic3;
5170 friend type integer module2TypeFriend3;
5171 private type integer module2TypePrivate3;
5177 <MODULE TTCN module3 module3.ttcn>
5180 type integer module3Type;
5181 public type integer module3TypePublic;
5182 friend type integer module3TypeFriend;
5183 private type integer module3TypePrivate;
5185 public type port pPublic message { inout charstring; } with {extension "internal"}
5186 private type port pPrivate message { inout charstring; } with {extension "internal"}
5187 friend type port pFriend message { inout charstring; } with {extension "internal"}
5191 <MODULE TTCN module4 module4.ttcn>
5194 friend module module1;
5196 type component Lib4_CT {
5197 var integer v_Lib4_1;
5198 public var integer v_Lib4_2;
5199 private var integer v_Lib4_3;
5201 friend type component Lib4Friend_CT {
5202 var integer v_Lib4Friend_1;
5203 public var integer v_Lib4Friend_2;
5204 private var integer v_Lib4Friend_3;
5206 private type component Lib4Private_CT {
5207 var integer v_Lib4Private_1;
5208 public var integer v_Lib4Private_2;
5209 private var integer v_Lib4Private_3;
5212 function f_set_Lib4_1() runs on Lib4_CT { v_Lib4_1 := 0 } //OK
5213 function f_set_Lib4_2() runs on Lib4_CT { v_Lib4_2 := 0 } //OK
5214 function f_set_Lib4_3() runs on Lib4_CT { v_Lib4_3 := 0 } //OK
5215 function f_set_Lib4Friend_1() runs on Lib4Friend_CT { v_Lib4Friend_1 := 0 } //OK
5216 function f_set_Lib4Friend_2() runs on Lib4Friend_CT { v_Lib4Friend_2 := 0 } //OK
5217 function f_set_Lib4Friend_3() runs on Lib4Friend_CT { v_Lib4Friend_3 := 0 } //OK
5219 //These functions cannot be called or started outside module4, though they are public!
5221 function f_set_Lib4Private_1() runs on Lib4Private_CT { v_Lib4Private_1 := 0 } //OK
5222 function f_set_Lib4Private_2() runs on Lib4Private_CT { v_Lib4Private_2 := 0 } //OK
5223 function f_set_Lib4Private_3() runs on Lib4Private_CT { v_Lib4Private_3 := 0 } //OK
5227 <MODULE TTCN module5 module5.ttcn>
5230 /*public*/ import from module2 all;//NOK no public import
5233 <MODULE TTCN module6 module6.ttcn>
5236 /*friend*/ import from module2 all;//NOK no friend import
5241 (?is)\berror: There is no local or imported definition with name `module2TypePrivate'
5244 (?is)\berror: There is no local or imported definition with name `module3TypeFriend'
5247 (?is)\berror: There is no local or imported definition with name `module3TypePrivate'
5250 (?is)\berror: There is no local or imported definition with name `Lib4Private_CT'
5253 (?is)\berror: The member definition `v_Lib4_3' in component type `User_CT' is not visible in this scope
5256 (?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'
5259 (?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'
5262 (?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'
5265 (?is)\berror: Operation `create()' is not allowed in control part
5270 *---------------------------------------------------------------------*
5271 :h3.Adhoc:: Subtyping - Verdicts
5272 .*---------------------------------------------------------------------*
5274 <TC - Subtyping - Verdicts>
5277 <MODULE TTCN module1 module1.ttcn>
5280 type verdicttype myv1 (pass, fail, none)
5281 type myv1 myv2 (inconc)
5282 // No error for disjunct types.
5283 type verdicttype myv3 (myv1, myv2)
5284 type myv3 myv4 (myv3, myv3, myv3)
5285 const myv1 c_myv1 := inconc
5286 const myv2 c_myv2 := c_myv1
5287 template myv1 t_myv1 := inconc
5288 template myv2 t_myv2 := t_myv1
5289 template myv1 t_myv3 := (inconc)
5291 modulepar myv1 mp1 := inconc
5293 function fv1() return myv1 { return inconc }
5294 function fv2(in myv1 p1 := inconc) { }
5297 var template myv1 vt_myv1 := inconc
5298 var template myv1 vt_myv2 := t_myv2
5299 var template myv2 vt_myv3 := fv1() // No error.
5300 var myv1 v_myv1 := inconc
5301 var myv1 v_myv2 := valueof(t_myv2)
5302 var myv2 v_myv3 := fv1()
5307 (?is)\berror: inconc is not a valid value for type `verdicttype' which has subtype \(none,pass,fail\)
5310 (?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\)
5318 *---------------------------------------------------------------------*
5319 :h3.Adhoc:: Subtyping - Booleans
5320 .*---------------------------------------------------------------------*
5322 <TC - Subtyping - Booleans>
5325 <MODULE TTCN module1 module1.ttcn>
5328 type boolean myb1 (true)
5329 type myb1 myb2 (false)
5330 type boolean myb3 (myb1, myb2)
5331 const myb1 c_myb1 := false
5332 const myb2 c_myb2 := c_myb1
5333 template myb1 t_myb1 := false
5334 template myb2 t_myb2 := t_myb1
5335 template myb1 t_myb3 := (false)
5337 modulepar myb1 mp1 := false
5339 function fb1() return myb1 { return false }
5340 function fb2(in myb1 p1 := false) { }
5343 var template myb1 vt_myb1 := false
5344 var template myb1 vt_myb2 := t_myb2
5345 var template myb2 vt_myb3 := fb1()
5346 var myb1 v_myb1 := false
5347 var myb1 v_myb2 := valueof(t_myb2)
5348 var myb2 v_myb3 := fb1()
5353 (?is)\berror: false is not a valid value for type `boolean' which has subtype \(true\)
5356 (?is)\berror: The subtype restriction is not a subset of the restriction on the parent type. Subtype \(false\) is not subset of subtype \(true\)
5364 *---------------------------------------------------------------------*
5365 :h3.Adhoc:: Subtyping - Integers
5366 .*---------------------------------------------------------------------*
5368 <TC - Subtyping - Integers>
5371 <MODULE TTCN module1 module1.ttcn>
5374 type integer myi1 (1, 2, 3)
5376 type myi1 myi3 (4..8)
5377 type myi1 myi4 (4..8, 16)
5378 type integer myi5 (myi1, myi2)
5379 type integer myi6 (1, 2, myi7)
5380 type integer myi7 (myi6, 1, 2)
5381 type integer myi8 (myi1, 99, 101)
5383 const myi1 c_myi1 := 4
5384 const myi2 c_myi2 := c_myi1
5385 const myi8 c_myi3 := 100
5387 template myi1 t_myi1 := 4
5388 template myi2 t_myi2 := t_myi1
5389 template myi1 t_myi3 := (4)
5390 template myi8 t_myi4 := c_myi3
5392 modulepar myi1 mp1 := 4
5393 modulepar myi5 mp2 := 32 // No error.
5395 function fi1() return myi1 { return 4 }
5396 function fi2(in myi1 p1 := 4) { }
5399 var template myi1 vt_myi1 := 4
5400 var template myi1 vt_myi2 := t_myi2
5401 var template myi2 vt_myi3 := fi1()
5402 var template myi8 vt_myi4 := 100
5403 var myi1 v_myi1 := 4
5404 // It seems, that no additional error is reported here.
5405 var myi1 v_myi2 := valueof(t_myi2)
5406 var myi2 v_myi3 := fi1()
5407 var myi8 v_myi4 := 100
5412 (?is)\berror: 100 is not a valid value for type `integer' which has subtype \(1..3,99,101\)
5415 (?is)\berror: 4 is not a valid value for type `integer' which has subtype \(1..3\)
5418 (?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\)
5421 (?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\)
5424 (?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\)
5427 (?is)\berror: While checking circular type references in subtype definitions: Circular reference: `\@module1.myi6' -> `\@module1.myi7' -> `\@module1.myi6'
5435 *---------------------------------------------------------------------*
5436 :h3.Adhoc:: Subtyping - Floats
5437 .*---------------------------------------------------------------------*
5439 <TC - Subtyping - Floats>
5442 <MODULE TTCN module1 module1.ttcn>
5445 type float myf1 (1.0, 2.0, 3.0)
5446 type myf1 myf2 (4.0)
5447 type myf1 myf3 (4.0..8.0)
5448 type myf1 myf4 (4.0..8.0, 16.0)
5449 type float myf5 (myf1, myf2)
5451 const myf1 c_myf1 := 4.0
5452 const myf2 c_myf2 := c_myf1
5454 template myf1 t_myf1 := 4.0
5455 template myf2 t_myf2 := t_myf1
5456 template myf1 t_myf3 := (4.0)
5458 modulepar myf1 mp1 := 4.0
5459 modulepar myf5 mp2 := 32.0 // No error.
5461 function ff1() return myf1 { return 4.0 }
5462 function ff2(in myf1 p1 := 4.0) { }
5465 var template myf1 vt_myf1 := 4.0
5466 var template myf1 vt_myf2 := t_myf2
5467 var template myf2 vt_myf3 := ff1()
5468 var myf1 v_myf1 := 4.0
5469 var myf1 v_myf2 := valueof(t_myf2)
5470 var myf2 v_myf3 := ff1()
5475 (?is)\berror: 4.0e0 is not a valid value for type `float' which has subtype \(1.0e0,2.0e0,3.0e0\)
5478 (?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\)
5481 (?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\)
5484 (?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\)
5492 *---------------------------------------------------------------------*
5493 :h3.Adhoc:: Subtyping - Charstrings
5494 .*---------------------------------------------------------------------*
5496 <TC - Subtyping - Charstrings>
5499 <MODULE TTCN module1 module1.ttcn>
5502 type charstring myc1 ("ich", "du", "er")
5503 type charstring myc2 length(1)
5504 type myc1 myc3 length(1)
5505 type myc1 myc4 ("a".."z") // No error message.
5506 type myc1 myc5 ("a".."z", "sie")
5507 type charstring myc6 (myc1, myc2)
5508 type myc1 myc7 (pattern "itstoolong")
5509 type myc1 myc8 (pattern "i*h")
5511 const myc1 c_myc1 := "sie"
5512 const myc2 c_myc2 := "sie"
5513 const myc8 c_myc3 := "ich"
5515 template myc1 t_myc1 := "sie"
5516 template myc2 t_myc2 := "sie"
5517 template myc2 t_myc3 := t_myc1
5518 template myc1 t_myc4 := ("sie")
5520 function fc1() return myc1 { return "sie" }
5521 function fc2(in myc1 p1 := "sie") { }
5524 var template myc1 vt_myc1 := "sie"
5525 var template myc2 vt_myc2 := "sie"
5526 var template myc2 vt_myc3 := fc1()
5527 var myc1 v_myc1 := "sie"
5528 // Additional `(' characters in the error message.
5529 var myc2 v_myc2 := "sie"
5530 var myc2 v_myc3 := fc1()
5535 (?is)\berror: Mixing of value list and range subtyping is not allowed for type `charstring'
5538 (?is)\berror: "sie" is not a valid value for type `charstring' which has subtype \("du","er","ich"\)
5541 (?is)\berror: "sie" is not a valid value for type `charstring' which has subtype length\(1\)
5544 (?is)\berror: The subtype is an empty set
5547 (?is)\berror: Subtype mismatch: subtype length\(1\) has no common value with subtype \("du","er","ich"\)
5555 *---------------------------------------------------------------------*
5556 :h3.Adhoc:: Subtyping - Universal Charstrings
5557 .*---------------------------------------------------------------------*
5559 <TC - Subtyping - Universal Charstrings>
5562 <MODULE TTCN module1 module1.ttcn>
5565 type universal charstring myu1 (char(0, 0, 0, 0), char(0, 0, 0, 1))
5566 type universal charstring myu2 length(1)
5567 type myu1 myu3 length(2)
5568 type universal charstring myu4 (myu1, myu2)
5569 type universal charstring myu5 (pattern "abc?\q{0, 0, 1, 113}")
5570 const myu1 c_myu1 := char(0, 0, 1, 0)
5571 const myu2 c_myu2 := char(0, 0, 1, 0) & char(0, 0, 1, 0)
5572 template myu1 t_myu1 := char(0, 0, 1, 0)
5573 template myu2 t_myu2 := char(0, 0, 1, 0) & char(0, 0, 1, 0)
5574 template myu2 t_myu3 := t_myu1
5575 template myu1 t_myu4 := (char(0, 0, 1, 0))
5577 function fu1() return myu1 { return char(0, 0, 1, 0) & char(0, 0, 1, 0) }
5578 function fu2(in myu1 p1 := char(0, 0, 1, 0) & char(0, 0, 1, 0)) { }
5581 var template myu1 vt_myu1 := char(0, 0, 1, 0)
5582 var template myu2 vt_myu2 := char(0, 0, 1, 0) & char(0, 0, 1, 0)
5583 var template myu2 vt_myu3 := fu1()
5584 var myu1 v_myu1 := char(0, 0, 1, 0)
5585 var myu2 v_myu2 := char(0, 0, 1, 0) & char(0, 0, 1, 0)
5586 var myu2 v_myu3 := fu1()
5591 (?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\)\)
5594 (?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\)
5597 (?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\)\)
5600 (?is)\berror: The subtype is an empty set
5608 *---------------------------------------------------------------------*
5609 :h3.Adhoc:: Subtyping - Bitstrings
5610 .*---------------------------------------------------------------------*
5612 <TC - Subtyping - Bitstrings>
5615 <MODULE TTCN module1 module1.ttcn>
5618 type bitstring myb1 ('00'B, '01'B)
5619 type bitstring myb2 length(1)
5620 // The consistent `The subtype is an empty set' error message may be better.
5621 type myb1 myb3 length(1)
5622 type bitstring myb4 (myb1, myb2)
5623 const myb1 c_myb1 := '10'B
5624 const myb2 c_myb2 := '10'B
5625 template myb1 t_myb1 := '10'B
5626 template myb2 t_myb2 := '10'B
5627 template myb2 t_myb3 := t_myb1
5628 template myb1 t_myb4 := ('10'B)
5630 function fb1() return myb1 { return '10'B }
5631 function fb2(in myb1 p1 := '00'B) { }
5634 var template myb1 vt_myb1 := '10'B
5635 var template myb2 vt_myb2 := '10'B
5636 // It's not yet checked.
5637 var template myb2 vt_myb3 := fb1()
5638 var myb1 v_myb1 := '10'B
5639 var myb2 v_myb2 := '10'B
5640 var myb2 v_myb3 := fb1()
5645 (?is)\berror: '10'B is not a valid value for type `bitstring' which has subtype \('00'B,'01'B\)
5648 (?is)\berror: '10'B is not a valid value for type `bitstring' which has subtype length\(1\)
5651 (?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\)
5654 (?is)\berror: Subtype mismatch: subtype length\(1\) has no common value with subtype \('00'B,'01'B\)
5662 *---------------------------------------------------------------------*
5663 :h3.Adhoc:: Subtyping - Hexstrings
5664 .*---------------------------------------------------------------------*
5666 <TC - Subtyping - Hexstrings>
5669 <MODULE TTCN module1 module1.ttcn>
5672 type hexstring myh1 ('00'H, '01'H)
5673 type hexstring myh2 length(1)
5674 type myh1 myh3 length(1)
5675 type hexstring myh4 (myh1, myh2)
5676 const myh1 c_myh1 := '10'H
5677 const myh2 c_myh2 := '10'H
5678 template myh1 t_myh1 := '10'H
5679 template myh2 t_myh2 := '10'H
5680 template myh2 t_myh3 := t_myh1
5681 template myh1 t_myh4 := ('10'H)
5683 function fh1() return myh1 { return '00'H }
5684 function fh2(in myh1 p1 := '00'H) { }
5687 var template myh1 vt_myh1 := '10'H
5688 var template myh2 vt_myh2 := '10'H
5689 var template myh2 vt_myh3 := fh1()
5690 var myh1 v_myh1 := '10'H
5691 var myh2 v_myh2 := '10'H
5692 var myh2 v_myh3 := fh1()
5697 (?is)\berror: '10'H is not a valid value for type `hexstring' which has subtype \('00'H,'01'H\)
5700 (?is)\berror: '10'H is not a valid value for type `hexstring' which has subtype length\(1\)
5703 (?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\)
5706 (?is)\berror: Subtype mismatch: subtype length\(1\) has no common value with subtype \('00'H,'01'H\)
5714 *---------------------------------------------------------------------*
5715 :h3.Adhoc:: Subtyping - Octetstrings
5716 .*---------------------------------------------------------------------*
5718 <TC - Subtyping - Octetstrings>
5721 <MODULE TTCN module1 module1.ttcn>
5724 type octetstring myo1 ('00'O, '01'O)
5725 type octetstring myo2 length(1)
5726 type myo1 myo3 length(2)
5727 type octetstring myo4 (myo1, myo2)
5728 const myo1 c_myo1 := '10'O
5729 const myo2 c_myo2 := '1010'O
5730 const myo3 c_myo3 := '10'O
5731 template myo1 t_myo1 := '10'O
5732 template myo2 t_myo2 := '1010'O
5733 template myo2 t_myo3 := t_myo1
5734 template myo1 t_myo4 := ('10'O)
5735 template myo3 t_myo5 := '10'O
5737 function fo1() return myo1 { return '1010'O }
5738 function fo2(in myo1 p1 := '1010'O) { }
5741 var template myo1 vt_myo1 := '10'O
5742 var template myo2 vt_myo2 := '1010'O
5743 var template myo3 vt_myo3 := '10'O
5744 var template myo1 vt_myo4 := fo1()
5745 var myo1 v_myo1 := '10'O
5746 var myo2 v_myo2 := '1010'O
5747 var myo3 v_myo3 := '10'O
5748 var myo1 v_myo4 := fo1()
5753 (?is)\berror: '10'O is not a valid value for type `octetstring' which has subtype \('00'O,'01'O\)
5756 (?is)\berror: '1010'O is not a valid value for type `octetstring' which has subtype length\(1\)
5759 (?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\)
5762 (?is)\berror: '1010'O is not a valid value for type `octetstring' which has subtype \('00'O,'01'O\)
5770 *---------------------------------------------------------------------*
5771 :h3.Adhoc:: Subtyping - Objids
5772 .*---------------------------------------------------------------------*
5774 <TC - Subtyping - Objids>
5777 <MODULE TTCN module1 module1.ttcn>
5780 type objid myo1 (objid{itu_t(0) identified_organization(4) etsi(0)})
5781 const myo1 c_myo1 := objid{0 0 0}
5782 template myo1 t_myo1 := objid{0 0 0}
5785 var template myo1 vt_myo1 := objid{0 0 0}
5786 var myo1 v_myo1 := objid{0 0 0}
5791 (?is)\berror: objid \{ 0 0 0 \} is not a valid value for type `objid' which has subtype \(objid \{ 0 4 0 \}\)
5796 *---------------------------------------------------------------------*
5797 :h3.Adhoc:: Subtyping - Anytypes
5798 .*---------------------------------------------------------------------*
5800 <TC - Subtyping - Anytypes>
5803 <MODULE TTCN module1 module1.ttcn>
5806 type anytype mya1 ({integer := 0})
5808 type integer myint1 (1, 2, 3)
5809 type mya2.myint1 myint2 (1..2)
5811 const mya1 c_mya1 := {integer := 1}
5812 const mya2.myint1 c_mya2 := 100
5813 const myint2 c_myi1 := 3
5815 template mya1 t_mya1 := {integer := 1}
5818 var template mya1 vt_mya1 := {integer := 1}
5819 var mya1 v_mya1 := {integer := 1}
5821 } with { extension "anytype integer, myint1" }
5824 (?is)\berror: 3 is not a valid value for type `integer' which has subtype \(1..2\)
5827 (?is)\berror: \{ integer := 1 \} is not a valid value for type `\@module1.anytype' which has subtype \(\{ integer := 0 \}\)
5830 (?is)\berror: 100 is not a valid value for type `integer' which has subtype \(1..3\)
5838 *---------------------------------------------------------------------*
5839 :h3.Adhoc:: Subtyping - Unions
5840 .*---------------------------------------------------------------------*
5842 <TC - Subtyping - Unions>
5845 <MODULE TTCN module1 module1.ttcn>
5852 type myu1 myu2 ({f1 := 0}, {f2 := ""})
5853 type myu1 myu3 ({f1 := 100}, {f1 := 200})
5854 type myu1 myu4 (myu3.interestingfieldreferencenotcheckedbutpossible)
5855 type myu1 myu5 (myu3, myu4)
5857 const myu2 c_myu1 := {f1 := 1}
5858 const myu5 c_myu2 := {f1 := 1}
5860 // Union subtypes are not checked for templates. We should expect 4 error
5861 // messages instead of 2. It should be fixed later. This applies for
5862 // record, set and union types as well.
5863 template myu2 t_myu1 := {f1 := 1}
5864 template myu5 t_myu2 := {f1 := valueof(t_myu1.f1)}
5867 var template myu2 vt_myu1 := {f1 := 1}
5868 var template myu5 vt_myu2 := {f1 := vt_myu1.f1}
5869 var myu2 v_myu1 := {f1 := 1}
5870 var myu5 v_myu2 := {f1 := v_myu1.f1} // Check?
5875 (?is)\berror: \{ f1 := 1 \} is not a valid value for type `\@module1.myu1' which has subtype \(\{ f1 := 0 \},\{ f2 := "" \}\)
5878 (?is)\berror: Reference to non-existent field `interestingfieldreferencenotcheckedbutpossible' in type `\@module1.myu1'
5886 *---------------------------------------------------------------------*
5887 :h3.Adhoc:: Subtyping - Records
5888 .*---------------------------------------------------------------------*
5890 <TC - Subtyping - Records>
5893 <MODULE TTCN module1 module1.ttcn>
5900 type integer myi1 (11, 22, 33)
5901 type myr1 myr2 ({0, ""}, {0, " "})
5902 type myr1 myr3 ({0.0, ""})
5903 type myr1 myr4 (myr1, myr3)
5904 type myr2 myr5 (myr2, myr2, {0, ""}, {0, ""})
5906 integer f1 (1, 2, 3),
5907 charstring f2 length(3)
5910 // Only the constants are checked regarding subtypes.
5911 const myr2 c_myr1 := {1, ""}
5912 const myr4 c_myr2 := {1, ""}
5914 template myr2 t_myr1 := {1, ""}
5915 template myr4 t_myr2 := {1, ""}
5916 template myr6 t_myr3(in myi1 p1) := {p1, "abc"}
5918 function fr1() return myr2 { return {0, "1"} }
5919 function fr2(in myr2 p1 := {0, "1"}) { }
5922 var template myr2 vt_myr1 := {1, ""}
5923 var template myr5 vt_myr2 := {1, "1"} // No error. Why?
5924 var myr2 v_myr1 := {1, ""}
5925 var myr5 v_myr2 := {1, "1"} // It's an error for all non-templates.
5926 var myr6 v_myr3 := {1, "abcdefghijk"}
5927 if (valueof(vt_myr1) == valueof(vt_myr2)) { }
5928 if (v_myr1 == v_myr2) { }
5933 (?is)\berror: integer value was expected
5936 (?is)\berror: Type referenced by `myr1' does not have a subtype
5939 (?is)\berror: \{ f1 := 1, f2 := "1" \} is not a valid value for type `\@module1.myr1' which has subtype \(\{ f1 := 0, f2 := "" \},\{ f1 := 0, f2 := " " \}\)
5942 (?is)\berror: \{ f1 := 1, f2 := "" \} is not a valid value for type `\@module1.myr1' which has subtype \(\{ f1 := 0, f2 := "" \},\{ f1 := 0, f2 := " " \}\)
5945 (?is)\berror: \{ f1 := 0, f2 := "1" \} is not a valid value for type `\@module1.myr1' which has subtype \(\{ f1 := 0, f2 := "" \},\{ f1 := 0, f2 := " " \}\)
5948 (?is)\berror: Subtype mismatch: subtype \(1..3\) has no common value with subtype \(11,22,33\)
5951 (?is)\berror: \"abcdefghijk\" is not a valid value for type `charstring' which has subtype length\(3\)
5959 *---------------------------------------------------------------------*
5960 :h3.Adhoc:: Subtyping - Sets
5961 .*---------------------------------------------------------------------*
5963 <TC - Subtyping - Sets>
5966 <MODULE TTCN module1 module1.ttcn>
5973 type integer myi1 (11, 22, 33)
5974 type mys1 mys2 ({f1 := 0, f2 := ""}, {f1 := 0, f2 := " "})
5976 integer f1 (1, 2, 3),
5977 charstring f2 length(3)
5979 type mys1 myr4 (mys2)
5980 type mys2 mys5 (mys2, mys2, {f1 := 0, f2 := ""}, {f1 := 0, f2 := ""})
5982 const mys2 c_mys1 := {f1 := 1, f2 := ""}
5983 const myr4 c_mys2 := {f1 := c_mys1.f1, f2 := c_mys1.f2}
5984 const mys5 c_mys3 := {f1 := 1, f2 := ""}
5986 template mys2 t_mys1 := {f1 := 1, f2 := ""}
5987 template mys3 t_mys2(in myi1 p1) := {f1 := p1, f2 := "abc"}
5988 template mys3 t_mys3(in integer p1) modifies t_mys2 := {f1 := 100}
5991 var template mys2 vt_mys1 := {f1 := 1, f2 := ""}
5992 var mys2 v_mys1 := {f1 := 1, f2 := ""}
5993 var mys3 v_mys2 := {f1 := 1, f2 := "itstoolong"}
5995 v_mys2.f2 := "itstoolong"
5996 // `if (v_mys1 == v_mys2) { }' should be an error in both runtimes.
5997 // Currently, there is no error from the function-test runtime.
6002 (?is)\berror: \{ f1 := 1, f2 := "" \} is not a valid value for type `\@module1.mys1' which has subtype \(\{ f1 := 0, f2 := "" \},\{ f1 := 0, f2 := " " \}\)
6005 (?is)\berror: Subtype mismatch: subtype \(1..3\) has no common value with subtype \(11,22,33\)
6008 (?is)\berror: \"itstoolong\" is not a valid value for type `charstring' which has subtype length\(3\)
6011 (?is)\berror: 100 is not a valid value for type `integer' which has subtype \(1..3\)
6019 *---------------------------------------------------------------------*
6020 :h3.Adhoc:: Subtyping - Recordofs
6021 .*---------------------------------------------------------------------*
6023 <TC - Subtyping - Recordofs>
6026 <MODULE TTCN module1 module1.ttcn>
6029 type record length(1) of integer myro1
6030 type record length(4..8) of integer myro2
6031 type record length(5) of record length(5) of record length(5) of record length(5) of integer myro3
6032 type myro3 myro4 ({1}, {2})
6033 type myro1 myro5 (myro1, {1, 2})
6034 type myro1 myro6 (myro1, myro1, {1}, {1}, {2}, {2})
6035 type myro5 myro7 ({1}) // No error for erroneous parent type.
6036 type myro7 myro8 (myro2)
6038 const myro1 c_myro1 := {0, 1}
6039 const myro2 c_myro2 := {0, 1}
6040 const myro6 c_myro3 := {c_myro1[0]}
6042 template myro1 t_myro1 := {0, 1}
6043 template myro2 t_myro2 := {0, 1}
6044 template myro6 t_myro3 := {0}
6046 modulepar myro1 mp1 := {0, 1}
6047 modulepar myro2 mp2 := {0, 1}
6048 modulepar myro6 mp3 := {}
6050 function fro1() return myro1 { return {0, 1} }
6051 function fro2(in myro1 p1 := {0, 1}) { }
6054 var template myro1 vt_myro1 := {0, 1}
6055 var template myro2 vt_myro2 := {0, 1}
6056 var myro1 v_myro1 := {0, 1}
6057 var myro2 v_myro2 := {0, 1}
6058 if (valueof(vt_myro1) == valueof(vt_myro2)) { }
6059 if (v_myro1 == v_myro2) { }
6060 if (match(fro1(), t_myro2)) { }
6065 (?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\)
6068 (?is)\berror: There must not be more than 1 elements in the list
6071 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myro1' which has subtype length\(1\)
6074 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myro2' which has subtype length\(4..8\)
6077 (?is)\berror: At least 4 elements must be present in the list
6080 (?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\)
6083 (?is)\berror: record of value was expected
6086 (?is)\berror: \{ \} is not a valid value for type `\@module1.myro1' which has subtype length\(1\)
6089 (?is)\berror: Type mismatch: `\@module1.myro1' and `\@module1.myro2' are not compatible: Incompatible record of/SEQUENCE OF subtypes
6092 (?is)\berror: Reference `myro2' must refer to a type which has the same root type as this type
6100 *---------------------------------------------------------------------*
6101 :h3.Adhoc:: Subtyping - Setofs
6102 .*---------------------------------------------------------------------*
6104 <TC - Subtyping - Setofs>
6107 <MODULE TTCN module1 module1.ttcn>
6110 type set length(1) of integer myso1
6111 type set length(4..8) of integer myso2
6112 type set of integer myso3 (myso1, myso2)
6113 type myso1 myso4 (myso1, {1, 2})
6114 type myso1 myso5 (myso1, myso1, {1}, {1}, {2}, {2})
6115 type myso4 myso6 ({1}) // No error for erroneous parent type.
6116 type myso6 myso7 (myso2)
6118 template myso1 t_myso1 := {0, 1}
6119 template myso2 t_myso2 := {0, 1}
6120 template myso5 t_myso3 := {0}
6122 const myso1 c_myso1 := {0, 1}
6123 const myso2 c_myso2 := {0, 1}
6124 const myso5 c_myso3 := {c_myso1[0]}
6126 modulepar myso1 mp1 := {0, 1}
6127 modulepar myso2 mp2 := {0, 1}
6128 modulepar myso5 mp3 := {}
6130 function fso1() return myso1 { return {0, 1} }
6131 function fso2(in myso1 p1 := {0, 1}) { }
6134 var template myso1 vt_myso1 := {0, 1}
6135 var template myso2 vt_myso2 := {0, 1}
6136 var myso1 v_myso1 := {0, 1}
6137 var myso2 v_myso2 := {0, 1}
6138 if (valueof(vt_myso1) == valueof(vt_myso2)) { }
6139 if (v_myso1 == v_myso2) { }
6140 if (match(fso1(), t_myso2)) { }
6145 (?is)\berror: Reference `myso1' must refer to a type which has the same root type as this type
6148 (?is)\berror: Reference `myso2' must refer to a type which has the same root type as this type
6151 (?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\)
6154 (?is)\berror: There must not be more than 1 elements in the list
6157 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myso1' which has subtype length\(1\)
6160 (?is)\berror: At least 4 elements must be present in the list
6163 (?is)\berror: \{ 0, 1 \} is not a valid value for type `\@module1.myso2' which has subtype length\(4..8\)
6166 (?is)\berror: \{ \} is not a valid value for type `\@module1.myso1' which has subtype length\(1\)
6169 (?is)\berror: Type mismatch: `\@module1.myso1' and `\@module1.myso2' are not compatible: Incompatible set of/SET OF subtypes
6177 *---------------------------------------------------------------------*
6178 :h3.Adhoc:: Subtyping - Arrays
6179 .*---------------------------------------------------------------------*
6181 <TC - Subtyping - Arrays>
6184 <MODULE TTCN module1 module1.ttcn>
6187 // The length subtyping is not for `integer', it's an `integer[1]' array.
6188 type integer mya1[1] length(2)
6189 type mya1 mya2 (0, 1)
6190 type mya1 mya3 ({0, 1}, {2, 3})
6191 type mya3 mya4 (mya1, mya2, mya3)
6193 template mya1 t_mya1 := {2}
6194 template mya3 t_mya2 := {2, 3}
6196 const mya1 c_mya1 := {2}
6197 const mya3 c_mya2 := {c_mya1[0], 3}
6198 const mya1 c_mya3[1] := {c_mya1} // Shouldn't be allowed.
6201 var template mya1 vt_mya1 := {2}
6202 var template mya3 vt_mya2 := {vt_mya1[0], 3}
6203 var template mya1 vt_mya3[1] := {vt_mya1} // Shouldn't be allowed.
6204 var mya1 v_mya1 := {2}
6205 var mya3 v_mya2 := {2, 3}
6206 var mya1 v_mya3[1] := {v_mya1} // Shouldn't be allowed.
6207 if (valueof(vt_mya1) == valueof(vt_mya2)) { }
6208 if (v_mya1 == v_mya2) { }
6213 (?is)\berror: Length subtyping is not allowed for type `integer'
6216 (?is)\berror: Subtype constraints are not applicable to type `integer\[1\]'
6219 (?is)\berror: Too many elements in the array value: 1 was expected instead of 2
6228 *---------------------------------------------------------------------*
6229 :h3.Adhoc:: Special float values
6230 .*---------------------------------------------------------------------*
6232 <TC - Special float values>
6235 <MODULE TTCN module1 module1.ttcn>
6238 const float cf_pinf := infinity;
6239 const float cf_minf := -infinity;
6240 const float cf_nan := not_a_number;
6242 type float MyFlt (-infinity..infinity);
6243 type float MyFlt2 (not_a_number);
6248 vf1 := not_a_number;
6255 (?is)\berror: NaN is not a valid value for type `float' which has subtype \(-INF..INF\)
6258 (?is)\berror: 1.0e0 is not a valid value for type `float' which has subtype \(NaN\)
6261 (?is)\berror: Subtype mismatch: subtype \(NaN\) has no common value with subtype \(-INF..INF\)
6270 *---------------------------------------------------------------------*
6271 :h3.Adhoc:: Exclusive ranges - integer type
6272 .*---------------------------------------------------------------------*
6274 <TC - Exclusive ranges - integer type>
6277 <MODULE TTCN module1 module1.ttcn>
6280 type integer MyInt1 (!-infinity..!10);
6281 type integer MyInt2 (!-10..!infinity);
6282 type integer MyInt3 (!1..!2);
6283 type integer MyInt4 (!1..!10,!10..!20);
6284 const MyInt4 c_myint4 := 10;
6285 type MyInt4 MyInt5 (2..19);
6286 type integer MyInt6 (MyInt4,10);
6287 const MyInt6 c_myint6a := 10;
6288 const MyInt6 c_myint6b := 20;
6292 (?is)\berror: invalid lower boundary, -infinity cannot be excluded from an integer subtype range
6295 (?is)\berror: invalid upper boundary, infinity cannot be excluded from an integer subtype range
6298 (?is)\berror: lower boundary is bigger than upper boundary in integer subtype range
6301 (?is)\berror: 10 is not a valid value for type `integer' which has subtype \(2..9,11..19\)
6304 (?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\)
6307 (?is)\berror: 20 is not a valid value for type `integer' which has subtype \(2..19\)
6316 *---------------------------------------------------------------------*
6317 :h3.Adhoc:: Exclusive ranges - float type
6318 .*---------------------------------------------------------------------*
6320 <TC - Exclusive ranges - float type>
6323 <MODULE TTCN module1 module1.ttcn>
6326 type float MyFlt1 (!-infinity..!-infinity);
6327 type float MyFlt2 (!infinity..!infinity);
6328 type float MyFlt3 (not_a_number..!infinity);
6329 type float MyFlt4 (!-infinity..!infinity);
6330 const MyFlt4 c_myflt4a := -infinity;
6331 const MyFlt4 c_myflt4b := infinity;
6332 const MyFlt4 c_myflt4c := not_a_number;
6333 type float MyFlt5 (MyFlt4, -infinity, infinity, not_a_number);
6334 type float MyFlt6 (-infinity..!0.0,!0.0..infinity);
6335 const MyFlt6 c_myflt6 := 0.0;
6339 (?is)\berror: !-infinity is not a valid upper boundary
6342 (?is)\berror: !infinity is not a valid lower boundary
6345 (?is)\berror: lower boundary cannot be not_a_number in float subtype range
6348 (?is)\berror: -INF is not a valid value for type `float' which has subtype \(!-INF..!INF\)
6351 (?is)\berror: INF is not a valid value for type `float' which has subtype \(!-INF..!INF\)
6354 (?is)\berror: NaN is not a valid value for type `float' which has subtype \(!-INF..!INF\)
6357 (?is)\bwarning: The subtype of type `float' is a full set, it does not constrain the root type.
6360 (?is)\berror: 0.0e0 is not a valid value for type `float' which has subtype \(-INF..!0.0e0,!0.0e0..INF\)
6369 *---------------------------------------------------------------------*
6370 :h3.Adhoc:: Exclusive ranges - charstring type
6371 .*---------------------------------------------------------------------*
6373 <TC - Exclusive ranges - charstring type>
6376 <MODULE TTCN module1 module1.ttcn>
6379 type charstring MyStr1 (!"a".."a");
6380 type charstring MyStr2 (!"a"..!"b");
6381 type charstring MyStr3 (!"a"..!"c",!"c"..!"z");
6382 const MyStr3 c_mystr3 := "c";
6383 type charstring MyStr4 ("c".."c",!"0".."9");
6384 type charstring MyStr5 (MyStr3, MyStr4);
6385 const MyStr5 c_mystr5a := "c";
6386 const MyStr5 c_mystr5b := "0";
6390 (?is)\berror: lower boundary is bigger than upper boundary in charstring subtype range
6393 (?is)\berror: "c" is not a valid value for type `charstring' which has subtype from\("b","d".."y"\)
6396 (?is)\berror: "0" is not a valid value for type `charstring' which has subtype \(from\("b","d".."y"\) union from\("1".."9","c"\)\)
6404 *---------------------------------------------------------------------*
6405 :h3.Adhoc:: invalid syntax - equality followed by negation
6406 .*---------------------------------------------------------------------*
6408 <TC - invalid syntax - equality followed by negation>
6411 <MODULE TTCN module1 module1.ttcn>
6421 (?is)\berror: The operation `not' is not allowed to be the second operand of operation `!='
6426 .*---------------------------------------------------------------------*
6427 :h3.Adhoc:: special float values
6428 .*---------------------------------------------------------------------*
6430 <TC - special float values>
6433 <MODULE TTCN x x.ttcn>
6435 const float a := infinity;
6436 const float b := not_a_number;
6437 const float c := 0.0 / b;
6439 var float d := rnd( a );
6440 var float e := rnd( b );
6446 <RESULT IF_PASS COUNT 1>
6447 (?im)error: Second operand of operation `/' cannot be NaN, it must be a numeric value
6449 <RESULT IF_PASS COUNT 1>
6450 (?im)error: The operand of operation `rnd \(seed\)' cannot be INF, it must be a numeric value
6452 <RESULT IF_PASS COUNT 1>
6453 (?im)error: The operand of operation `rnd \(seed\)' cannot be NaN, it must be a numeric value
6455 <RESULT IF_PASS COUNT 1>
6456 (?im)error: A non-negative float value was expected as timer duration instead of `INF'
6458 <RESULT IF_PASS COUNT 1>
6459 (?im)error: A non-negative float value was expected as timer duration instead of `NaN'
6461 <RESULT IF_PASS COUNT 5>
6468 .*---------------------------------------------------------------------*
6469 :h3.Adhoc:: template restrictions (TR: HL77646)
6470 .*---------------------------------------------------------------------*
6472 <TC - template restrictions (TR: HL77646)>
6475 <MODULE TTCN Temp Temp.ttcn>
6477 type record of integer MyRecOfInt;
6478 template(value) integer t_MyInt := 1
6479 template(value) MyRecOfInt t_MyRecOfInt := {[2]:= t_MyInt }
6486 type record of C ROF;
6494 var template(value) R tr1;
6495 var template R tr2 := { 1, omit, { {b:=true}, {i:=1}, {b:=(true,false)} } }
6500 <MODULE CFG Temp Temp.cfg>
6503 LogSourceInfo := Yes
6504 Logfile := "Temp%i.log"
6507 DiskFullAction := error
6509 ConsoleMask := WARNING | ERROR | TESTCASE | STATISTICS
6514 (?im)warning: Inadequate restriction on the referenced template variable `tr2', this may cause a dynamic test case error at runtime
6516 <RESULT IF_PASS COUNT 1>
6517 (?im)Dynamic test case error: Restriction `value' on template of type @Temp.R violated.
6524 .*---------------------------------------------------------------------*
6525 :h3.Adhoc:: template restrictions (TR: HL77646) 2
6526 .*---------------------------------------------------------------------*
6528 <TC - template restrictions (TR: HL77646) 2>
6531 <MODULE TTCN Temp Temp.ttcn>
6534 type record of R ROF;
6535 type record of R ROF2;
6543 var template(value) C t1;
6544 var template(present) C t2 := { r := { [2] := {} } }
6546 var template(value) ROF2 t11;
6547 var template(present) ROF2 t21 := { {}, ({},{}) }
6552 <MODULE CFG Temp Temp.cfg>
6555 LogSourceInfo := Yes
6556 Logfile := "Temp%i.log"
6559 DiskFullAction := error
6561 ConsoleMask := WARNING | ERROR | TESTCASE | STATISTICS
6566 (?im)warning: Inadequate restriction on the referenced template variable `.+', this may cause a dynamic test case error at runtime
6568 <RESULT IF_PASS COUNT 1>
6569 (?im)Dynamic test case error: Restriction `value' on template of type @Temp.ROF2 violated.
6575 .*---------------------------------------------------------------------*
6576 :h3.Adhoc:: constant parameter in decvalue function
6577 .*---------------------------------------------------------------------*
6579 <TC - constant parameter in decvalue function>
6582 <MODULE TTCN x x.ttcn>
6584 type integer myint with {encode "RAW"}
6587 } with {encode "XML"};
6589 const bitstring c_bs0 := ''B;
6593 var integer ret := decvalue(c_bs0, v_r);
6598 <RESULT IF_PASS COUNT 1>
6599 (?im)error: Reference to 'constant' cannot be used as the first operand of the 'decvalue' operation
6601 <RESULT IF_PASS COUNT 1>
6607 .*---------------------------------------------------------------------*
6608 :h3.Adhoc:: extra checks for decvalue (HM59355)
6609 .*---------------------------------------------------------------------*
6611 <TC - extra checks for decvalue (HM59355)>
6614 <MODULE TTCN x x.ttcn>
6616 type record MyEmptyRecord { } with { encode "XML" }
6620 var template MyEmptyRecord t
6621 i := decvalue(s, MyEmptyRecord)
6622 // Original error: expected unqualified-id before '.' token
6624 // Original error: 'class x::MyEmptyRecord_template' has no member named 'decode'
6628 <RESULT IF_PASS COUNT 1>
6629 (?im)error: Reference to 'type' cannot be used.
6631 <RESULT IF_PASS COUNT 1>
6632 (?im)error: Reference to 'template variable' cannot be used.
6634 <RESULT IF_PASS COUNT 2>
6640 .*---------------------------------------------------------------------*
6641 :h3.Adhoc:: SIGSEGV on missing modules (HM62166)
6642 .*---------------------------------------------------------------------*
6644 <TC - SIGSEGV on missing modules (HM62166)>
6647 <MODULE TTCN x x.asn>
6648 Example DEFINITIONS ::= BEGIN
6651 MyType FROM Z {itu-t(0)};
6652 EXTENSION ::= CLASS {&id Code}
6653 myExtension EXTENSION ::= {IDENTIFIED BY global : {itu-t(0)}}
6656 <RESULT IF_PASS COUNT 1>
6657 (?im)error: There is no module with identifier \`Y\'
6659 <RESULT IF_PASS COUNT 1>
6660 (?im)error: There is no module with identifier \`Z\'
6662 <RESULT IF_PASS COUNT 1>
6663 (?im)error: There is no assignment or imported symbol with name \`Code\' in module \`Example\'
6665 <RESULT IF_PASS COUNT 1>
6666 (?im)error: Cannot recognize fieldspec
6668 <RESULT IF_PASS COUNT 1>
6669 (?im)error: Unexpected \`\<upperidentifier\>\'
6671 <RESULT IF_PASS COUNT 1>
6672 (?im)error: Superfluous part detected
6674 <RESULT IF_PASS COUNT 1>
6675 (?im)error: Check the syntax of objectclass \(consider using debug messages\)
6677 <RESULT IF_PASS COUNT 7>
6683 *---------------------------------------------------------------------*
6684 :h3.Adhoc:: Subtyping - Octetstring TR (TR:?)
6685 .*---------------------------------------------------------------------*
6687 <TC - Subtyping - Octetstring TR (TR:?)>
6690 <MODULE TTCN module1 module1.ttcn>
6693 const octetstring c_PcapMagic_LittleEndian := 'd4c3b2a1'O;
6694 const octetstring c_PcapMagic_BigEndian := 'a1b2c3d4'O;
6695 type octetstring PcapMagic1 ('d4c3b2a1'O, 'a1b2c3d4'O);
6696 type octetstring PcapMagic2 (c_PcapMagic_BigEndian, c_PcapMagic_LittleEndian);
6707 *---------------------------------------------------------------------*
6708 :h3.Adhoc:: Subtyping - String indexing (TR:?)
6709 .*---------------------------------------------------------------------*
6711 <TC - Subtyping - String indexing (TR:?)>
6714 <MODULE TTCN module1 module1.ttcn>
6717 type octetstring OCT1 length(1);
6718 type octetstring OCT2 length(2);
6720 const OCT2 long_octet := '0102'O;
6721 const OCT1 short_octet := long_octet[0];
6723 type port myport message { inout OCT1; } with { extension "internal" };
6724 type port myport2 message { inout OCT2; } with { extension "internal" };
6725 type component mycomp {
6730 function myfunc() runs on mycomp
6734 p.receive(OCT1:?) -> value o2[0];
6735 p2.receive(OCT2:?) -> value o1;
6736 p2.receive(OCT2:?) -> value o2[0];
6747 o2 := myfunc12(o1,o2);
6749 o2[0] := myfunc12(o1,o2);
6753 o1[0] := myfunc12(o1,o2);
6755 o1 := myfunc12(o2,o1);
6756 o1 := myfunc12in(o2,o1);
6757 o1 := myfunc12out(o2,o1);
6758 o2 := myfunc12(o1,o2);
6761 function myfunc12(inout OCT1 p_o1, inout OCT2 p_o2) return OCT1
6766 function myfunc12in(in OCT1 p_o1, in OCT2 p_o2) return OCT1
6771 function myfunc12out(out OCT1 p_o1, out OCT2 p_o2) return OCT1
6776 function myfunc12err(inout OCT1 p_o1, inout OCT2 p_o2) return OCT2
6782 var OCT2 o2 := 'BABE'O;
6783 var integer i := oct2int(o2[0]); // HQ38022
6787 <RESULT IF_PASS COUNT 3>
6788 (?im)error: Subtype mismatch: subtype length\(2\) has no common value with a string element
6790 <RESULT IF_PASS COUNT 7>
6791 (?im)error: Subtype mismatch: subtype length\(2\) has no common value with subtype length\(1\)
6793 <RESULT IF_PASS COUNT 4>
6794 (?im)error: Subtype mismatch: subtype length\(1\) has no common value with subtype length\(2\)
6796 <RESULT IF_PASS COUNT 1>
6797 (?im)error: Subtype mismatch: string element has no common value with subtype length\(2\)
6799 <RESULT IF_PASS COUNT 2>
6800 (?im)error: Reference to a string element of type `octetstring' cannot be used in this context
6808 *---------------------------------------------------------------------*
6809 :h3.Adhoc:: Subtyping - function references
6810 .*---------------------------------------------------------------------*
6812 <TC - Subtyping - function references>
6815 <MODULE TTCN module1 module1.ttcn>
6818 type octetstring OCT1 length(1);
6819 type octetstring OCT2 length(2);
6821 const OCT2 long_octet := '0102'O;
6822 const OCT1 short_octet := long_octet[0];
6824 type function myfunctype(inout OCT2 p_o1, inout OCT1 p_o2) return OCT2
6826 function myfunc(inout OCT1 p_o1, inout OCT2 p_o2) return OCT1
6832 var myfunctype f := refers(myfunc);
6836 <RESULT IF_PASS COUNT 1>
6837 (?im)error: Subtype mismatch: subtype length\(2\) has no common value with subtype length\(1\)
6839 <RESULT IF_PASS COUNT 1>
6840 (?im)error: Subtype mismatch: subtype length\(1\) has no common value with subtype length\(2\)
6842 <RESULT IF_PASS COUNT 1>
6843 (?im)error: Return type subtype mismatch: subtype length\(2\) has no common value with subtype length\(1\)
6851 *---------------------------------------------------------------------*
6852 :h3.Adhoc:: Values - Valueof TR (TR:HM93087)
6853 .*---------------------------------------------------------------------*
6855 <TC - Values - Valueof TR (TR:HM93087)>
6858 <MODULE TTCN module1 module1.ttcn>
6865 if (valueof(rec:{1}) == {1}) { }
6875 *---------------------------------------------------------------------*
6876 :h3.Adhoc:: Recursion - recursion TR (TR:HM93170)
6877 .*---------------------------------------------------------------------*
6879 <TC - Recursion - recursion TR (TR:HM93170)>
6882 <MODULE TTCN module1 module1.ttcn>
6893 template recT temp1:= { f1:= temp2.f1, f2:= 1.1, f3:= "ERIXON", f4:= 1, f5:= temp1.f1 };
6894 template recT temp2:= { f1:= temp2.f4, f2:= 1.1, f3:= "ERIXON", f4:= temp1.f5, f5:= 2 };
6898 <RESULT IF_PASS COUNT 1>
6899 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.temp2.f4' -> `\@module1.temp1.f5' -> `\@module1.temp1.f1' -> `\@module1.temp2.f1' -> `\@module1.temp2.f4'
6901 <RESULT IF_PASS COUNT 1>
6902 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.temp1.f1' -> `\@module1.temp2.f1' -> `\@module1.temp2.f4' -> `\@module1.temp1.f5' -> `\@module1.temp1.f1'
6904 <RESULT IF_PASS COUNT 1>
6905 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.temp1.f5' -> `\@module1.temp1.f1' -> `\@module1.temp2.f1' -> `\@module1.temp2.f4' -> `\@module1.temp1.f5'
6913 *---------------------------------------------------------------------*
6914 :h3.Adhoc:: Recursion - union TR (TR:HM93077)
6915 .*---------------------------------------------------------------------*
6917 <TC - Recursion - union TR (TR:HM93077)>
6920 <MODULE TTCN module1 module1.ttcn>
6922 type union ValidUnion0 {
6926 type union ValidUnion1 {
6932 type union InvalidUnion0 {
6936 type union InvalidUnion1 {
6940 type union InvalidUnion2 {
6944 type union InvalidUnion3 {
6950 type union InvalidUnion4 {
6954 type record InvalidRecord0 {
6959 <RESULT IF_PASS COUNT 1>
6960 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion0' -> `\@module1.InvalidUnion0.u1' -> `\@module1.InvalidUnion0'
6962 <RESULT IF_PASS COUNT 1>
6963 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion2' -> `\@module1.InvalidUnion2.u1' -> `@\module1.InvalidUnion1' -> `\@module1.InvalidUnion1.u1' -> `\@module1.InvalidUnion2'
6965 <RESULT IF_PASS COUNT 1>
6966 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion3' -> `\@module1.InvalidUnion3.u1' -> `\@module1.InvalidUnion3'
6968 <RESULT IF_PASS COUNT 1>
6969 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion3' -> `\@module1.InvalidUnion3.u2' -> `\@module1.InvalidUnion3'
6971 <RESULT IF_PASS COUNT 1>
6972 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidUnion3' -> `\@module1.InvalidUnion3.u3' -> `\@module1.InvalidUnion3'
6974 <RESULT IF_PASS COUNT 1>
6975 (?is)\berror: While checking embedded recursions: Circular reference: `\@module1.InvalidRecord0' -> `\@module1.InvalidRecord0.r1' -> `\@module1.InvalidRecord0'
6977 <RESULT IF_PASS COUNT 1>
6978 (?im)\bnotify: Errors found in the input module. Code will not be generated.
6983 .*---------------------------------------------------------------------*
6984 :h3.Adhoc:: Negative testing semantic check error messages
6985 .*---------------------------------------------------------------------*
6987 <TC - Negative testing semantic check error messages>
6990 <MODULE ASN Virag Virag.asn>
6991 Virag DEFINITIONS ::=
6994 MySeqOf ::= SEQUENCE OF INTEGER
6995 MySeq ::= SEQUENCE {
6999 MyUnion ::= CHOICE {
7004 MyCharstring1 ::= VisibleString
7005 MyCharstring2 ::= IA5String
7009 <MODULE TTCN virag virag.ttcn>
7012 import from Virag all;
7020 type record of integer MYROFI;
7027 with { encode "TEXT" variant "" }
7028 type record MYREC2 { integer i }
7029 const MYREC c_myrec1 := {i:=1}
7031 erroneous "value := 2"
7032 erroneous (x) "value := 2"
7033 erroneous (i, r.i, r.r.i) "value := 2"
7035 const MYREC c_myrec2 := {i:=1} with { erroneous (b) "after := omit" }
7036 const MYREC c_myrec3 := {i:=1} with { erroneous (b) "before := omit" }
7037 const MYREC c_myrec4 := {i:=1} with { erroneous (b) "value := omit all" }
7038 const MYREC c_myrec5 := {i:=1} with { erroneous (b) "value := 123 all" }
7039 const MYREC c_myrec6 := {i:=1} with { erroneous (b) "value := {1,2,3}" }
7040 const MYREC c_myrec7 := {i:=1} with { erroneous (b) "value := nonexi" }
7041 const MYREC c_myrec8 := {i:=1} with { erroneous (b) "value(raw) := 123" }
7042 const MYREC c_myrec9 := {i:=1} with { erroneous (b) "value := MYROFI:'A'H" }
7043 const MYREC c_myrec10 := {i:=1} with { erroneous (b) "value := MYROFI:{1,2,*}" }
7044 const MYREC c_myrec11 := {i:=1} with {
7045 erroneous (b) "after := omit all"
7046 erroneous (r) "value := 0"
7048 const MYREC c_myrec12 := {i:=1} with {
7049 erroneous (r) "before := omit all"
7050 erroneous (b) "value := 0"
7052 const MYU c_myu13 := {i:=1} with { erroneous (b) "after := omit all" erroneous (r) "value:=12" }
7053 const MYU c_myu14 := {i:=1} with { erroneous (b) "value := omit" }
7054 const MYREC c_myrec15 := {i:=1} with {
7055 erroneous (r) "after := omit all"
7056 erroneous (i) "before := omit all"
7058 const MYREC c_myrec16 := {i:=1} with {
7059 erroneous (b,b) "value := 1"
7060 erroneous (b,b) "after := 1"
7061 erroneous (b,b) "before := 1"
7063 const MYREC c_myrec17 := {i:=1} with {
7064 erroneous (r.b) "value := 1"
7065 erroneous (r) "value := 1"
7067 const MYREC c_myrec18 := {i:=1} with {
7068 erroneous (b) "before := omit all"
7069 erroneous (r) "before := omit all"
7071 const MYREC c_myrec19 := {i:=1} with {
7072 erroneous (b) "value := 1"
7073 erroneous (r) "before := omit all"
7075 const MYREC c_myrec20 := {i:=1} with {
7076 erroneous (b) "after := omit all"
7077 erroneous (i) "after := omit all"
7079 const MYREC c_myrec21 := {i:=1} with {
7080 erroneous (r) "value := 1"
7081 erroneous (b) "after := omit all"
7083 const MYREC c_myrec22 := {i:=1} with {
7084 erroneous (r) "value := omit"
7085 erroneous (r.i) "value := 1"
7087 const MySeq c_myrec23 := {i:=1} with { erroneous (b) "value(raw) := ""proba""" }
7088 const MySeq c_myrec24 := {i:=1} with { erroneous (b) "value(raw) := universal charstring:""proba""" }
7089 const MYREC2 c_myrec25 := {i:=1} with { erroneous (i) "value(raw) := '1010'B" }
7090 const MYREC c_myrec26 := {i:=1} with { erroneous (b) "value := MyCharstring1:""haha""" }
7091 const MYREC c_myrec27 := {i:=1} with { erroneous (b) "value := MYREC2:{i:=1}" }
7092 function fv() {} with{erroneous ""}
7093 control {} with{erroneous ""}
7094 } with{erroneous ""}
7097 <RESULT FTRT COUNT 1>
7098 (?im)\berror: At least one qualifier must be specified for the `erroneous' attribute
7101 <RESULT FTRT COUNT 1>
7102 (?im)\berror: Reference to non-existent field `x' in type `@virag.MYREC'
7105 <RESULT FTRT COUNT 1>
7106 (?im)\berror: Keyword `all' is expected after `omit' when omitting all fields after the specified field
7109 <RESULT FTRT COUNT 1>
7110 (?im)\berror: Keyword `all' is expected after `omit' when omitting all fields before the specified field
7113 <RESULT FTRT COUNT 1>
7114 (?im)\berror: Unexpected `all' keyword after `omit' when omitting one field
7117 <RESULT FTRT COUNT 1>
7118 (?im)\berror: Unexpected `all' keyword after the in-line template
7121 <RESULT FTRT COUNT 1>
7122 (?im)\berror: Cannot determine the type of the in-line template
7125 <RESULT FTRT COUNT 1>
7126 (?im)\berror: There is no local or imported definition with name `nonexi'
7129 <RESULT FTRT COUNT 1>
7130 (?im)\berror: An in-line template of type `integer' cannot be used as a `raw' erroneous value
7133 <RESULT FTRT COUNT 1>
7134 (?im)\berror: record of value was expected
7137 <RESULT FTRT COUNT 1>
7138 (?im)\berror: A specific value without matching symbols was expected
7141 <RESULT FTRT COUNT 1>
7142 (?im)\berror: Field `r' cannot be referenced because all fields after field `b' have been omitted
7145 <RESULT FTRT COUNT 1>
7146 (?im)\berror: Field `b' cannot be referenced because all fields before field `r' have been omitted
7149 <RESULT FTRT COUNT 1>
7150 (?im)\berror: Indicator `after' cannot be used with reference `b' which points to a field of a union type
7153 <RESULT FTRT COUNT 1>
7154 (?im)\berror: There is nothing to omit after the last field \(r\) of a record/set type
7157 <RESULT FTRT COUNT 1>
7158 (?im)\berror: Reference to field `r' with indicator `value' would invalidate previously specified erroneous data
7161 <RESULT FTRT COUNT 1>
7162 (?im)\berror: There is nothing to omit before the first field \(i\)
7165 <RESULT FTRT COUNT 1>
7166 (?im)\berror: Duplicate reference to field `b' with indicator `value'
7169 <RESULT FTRT COUNT 1>
7170 (?im)\berror: Duplicate reference to field `b' with indicator `after'
7173 <RESULT FTRT COUNT 1>
7174 (?im)\berror: Duplicate reference to field `b' with indicator `before'
7177 <RESULT FTRT COUNT 1>
7178 (?im)\berror: Duplicate rule for omitting all fields before the specified field. Used on field `r' but previously already used on field `b'
7181 <RESULT FTRT COUNT 1>
7182 (?im)\berror: Omitting fields before field `r' would invalidate previously specified erroneous data
7185 <RESULT FTRT COUNT 1>
7186 (?im)\berror: Duplicate rule for omitting all fields after the specified field. Used on field `i' but previously already used on field `b'
7189 <RESULT FTRT COUNT 1>
7190 (?im)\berror: Omitting fields after field `b' would invalidate previously specified erroneous data
7193 <RESULT FTRT COUNT 1>
7194 (?im)\berror: Field `r.i' is embedded into a field which was previously overwritten or omitted
7197 <RESULT FTRT COUNT 1>
7198 (?im)\berror: A `raw' charstring value was used for erroneous type `@Virag.MySeq' which has no TEXT or XER encodings.
7201 <RESULT FTRT COUNT 1>
7202 (?im)\berror: A `raw' universal charstring value was used for erroneous type `@Virag.MySeq' which has no XER encoding.
7205 <RESULT FTRT COUNT 1>
7206 (?im)\berror: A `raw' bitstring value was used for erroneous type `@virag.MYREC2' which has no RAW or PER encodings.
7209 <RESULT FTRT COUNT 1>
7210 (?im)\berror: Type `VisibleString' and type `@virag.MYREC' have no common encoding
7213 <RESULT FTRT COUNT 1>
7214 (?im)\berror: Type `@virag.MYREC2' and type `@virag.MYREC' have no common encoding
7218 (?im)\berror: The `erroneous' attribute can be used only on template and constant definitions
7221 <RESULT FTRT COUNT 33>
7226 <RESULT LTRT COUNT 27>
7227 (?im)\berror: `erroneous' attributes can be used only with the Function Test Runtime
7230 <RESULT LTRT COUNT 27>
7231 (?im)\bnote: If you need negative testing use the -R flag when generating the makefile
7234 <RESULT LTRT COUNT 30>
7237 <RESULT LTRT COUNT 27>
7244 .*---------------------------------------------------------------------*
7245 :h3.Adhoc:: Syntax errors in logfiles (TR HN52781)
7246 .*---------------------------------------------------------------------*
7248 <TC - Syntax errors in logfiles (TR HN52781)>
7251 <MODULE TTCN Temp Temp.ttcn>
7256 <MODULE CFG Temp Temp.cfg>
7258 very_unknown_module_parameter := "should be logged normally"
7260 LogSourceInfo := Yes
7261 Logfile := "Temp%i.log"
7263 ConsoleMask := LOG_ALL
7267 <RESULT IF_PASS COUNT 2>
7268 (?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.
7273 .*---------------------------------------------------------------------*
7274 :h3.Adhoc:: testcase.stop
7275 .*---------------------------------------------------------------------*
7277 <TC - testcase.stop>
7280 <MODULE TTCN Temp Temp.ttcn>
7282 type component MyComp {}
7283 testcase TC() runs on MyComp {
7284 testcase.stop("Is it a Bird?! Is it a Plane?! No!! It's a dynamic test case error!!!");
7292 <MODULE CFG Temp Temp.cfg>
7295 LogSourceInfo := Yes
7296 Logfile := "Temp%i.log"
7298 ConsoleMask := LOG_ALL
7302 <RESULT IF_PASS COUNT 1>
7303 (?im)Dynamic test case error: testcase.stop
7305 <RESULT IF_PASS COUNT 1>
7306 (?im)Is it a Bird\?! Is it a Plane\?! No!! It's a dynamic test case error!!!
7311 .*---------------------------------------------------------------------*
7312 :h3.Adhoc:: Indexing of string template variables (CR_TR00018474)
7313 .*---------------------------------------------------------------------*
7315 <TC - Indexing of string template variables (CR_TR00018474)>
7318 <MODULE TTCN Temp Temp.ttcn>
7320 type component MyComp {}
7321 template charstring tcs := "doggee"
7322 template bitstring tbs := '11001100'B
7323 template hexstring ths := 'AABBCCDDEEFF'H
7324 template octetstring tos := 'AABBCCDD'O
7325 template universal charstring tus := char(0, 0, 0, 75) & char(0, 0, 0, 65)
7327 function fsi_charstrings(in template charstring vtc) {}
7328 function fsi_bitstrings(in template bitstring vtb) {}
7329 function fsi_hexstrings(in template hexstring vth) {}
7330 function fsi_octetstrings(in template octetstring vto) {}
7331 function fsi_universal_charstrings(in template universal charstring vtu) {}
7333 testcase TC_charstrings() runs on MyComp {
7334 var template charstring vtc := "fisherman"
7335 vtc[0] := vtc[1] // Compile error, string template variables cannot be indexed on the right hand side.
7336 vtc[0] := tcs[1] // Compile error, string templates cannot be indexed at all.
7337 tcs[0] := "D" // Compile error, string templates cannot be indexed at all.
7338 vtc[0] := * // Compile error, ANY_OR_OMIT can never be assigned to an element of a string template variable.
7339 vtc[0] := ? // Compile error, ANY_VALUE can never be assigned to an element of a string template variable, it would "become" a pattern otherwise.
7340 fsi_charstrings(vtc[0]) // Compile error, string template variables cannot be indexed on the right hand side.
7343 testcase TC_bitstrings() runs on MyComp {
7344 var template bitstring vtb := '0011110000'B
7352 fsi_bitstrings(vtb[0])
7355 testcase TC_hexstrings() runs on MyComp {
7356 var template hexstring vth := 'AABBCCDDEE'H
7364 fsi_hexstrings(vth[0])
7367 testcase TC_octetstrings() runs on MyComp {
7368 var template octetstring vto := 'ABBAABBA'O
7376 fsi_octetstrings(vto[0])
7379 testcase TC_universal_charstrings() runs on MyComp {
7380 var template universal charstring vtu := "fisherman"
7386 fsi_universal_charstrings(vtu[0])
7391 <RESULT IF_PASS COUNT 2>
7392 (?im)error: Reference to template variable `vtc' can not be indexed
7394 <RESULT IF_PASS COUNT 1>
7395 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tcs'
7397 <RESULT IF_PASS COUNT 16>
7398 (?im)error: A template body with matching symbols cannot be assigned to an element of a template variable
7400 <RESULT IF_PASS COUNT 2>
7401 (?im)error: Reference to template variable `vtb' can not be indexed
7403 <RESULT IF_PASS COUNT 1>
7404 (?im)error: Invalid array element reference: type `bitstring' cannot be indexed
7406 <RESULT IF_PASS COUNT 1>
7407 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tbs'
7409 <RESULT IF_PASS COUNT 2>
7410 (?im)error: Reference to template variable `vth' can not be indexed
7412 <RESULT IF_PASS COUNT 2>
7413 (?im)error: Reference to template variable `vto' can not be indexed
7415 <RESULT IF_PASS COUNT 2>
7416 (?im)error: Reference to template variable `vtu' can not be indexed
7418 <RESULT IF_PASS COUNT 1>
7419 (?im)error: Invalid array element reference: type `hexstring' cannot be indexed
7421 <RESULT IF_PASS COUNT 1>
7422 (?im)error: Invalid array element reference: type `octetstring' cannot be indexed
7424 <RESULT IF_PASS COUNT 1>
7425 (?im)error: Invalid array element reference: type `universal charstring' cannot be indexed
7427 <RESULT IF_PASS COUNT 1>
7428 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.ths'
7430 <RESULT IF_PASS COUNT 1>
7431 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tos'
7433 <RESULT IF_PASS COUNT 1>
7434 (?im)error: Reference to a variable or template variable was expected instead of template `@Temp.tus'
7439 .*---------------------------------------------------------------------*
7440 :h3.Adhoc:: Indexing of string template variables DTEs (CR_TR00018474)
7441 .*---------------------------------------------------------------------*
7443 <TC - Indexing of string template variables DTEs (CR_TR00018474)>
7446 <MODULE TTCN Temp Temp.ttcn>
7448 type component MyComp {}
7450 testcase TC_bitstrings() runs on MyComp {
7451 var template bitstring vtb := '0*?1'B // It's a pattern, cannot be indexed, runtime error.
7456 testcase TC_hexstrings() runs on MyComp {
7457 var template hexstring vth := 'AABB?CC'H // It's a pattern, cannot be indexed, runtime error.
7462 testcase TC_octetstrings() runs on MyComp {
7463 var template octetstring vto := 'AABB??*'O // It's a pattern, cannot be indexed, runtime error.
7470 execute(TC_bitstrings());
7471 execute(TC_hexstrings());
7472 execute(TC_octetstrings());
7476 <MODULE CFG Temp Temp.cfg>
7479 LogSourceInfo := Yes
7480 Logfile := "Temp%i.log"
7482 ConsoleMask := LOG_ALL
7486 <RESULT IF_PASS COUNT 1>
7487 (?im)Dynamic test case error: Accessing a bitstring element of a non-specific bitstring template.
7489 <RESULT IF_PASS COUNT 1>
7490 (?im)Dynamic test case error: Accessing a hexstring element of a non-specific hexstring template.
7492 <RESULT IF_PASS COUNT 1>
7493 (?im)Dynamic test case error: Accessing an octetstring element of a non-specific octetstring template.
7498 .*--------------------------------------------------------------------------*
7499 :h3.Adhoc - TR HO69261 Incorrect code generated for create with optional parameters
7500 .*--------------------------------------------------------------------------*
7503 <TC - Adhoc - TR HO69261 Incorrect code generated for create with optional parameters>
7507 <MODULE TTCN Temp Temp.ttcn>
7510 charstring cs optional
7512 type component CT {}
7514 testcase tc() runs on CT
7516 var Rec r := {cs := "12.0.0.1"};
7517 var CT c1 := CT.create(r.cs);
7518 var CT c2 := CT.create(-, r.cs);
7519 var CT c3 := CT.create(r.cs, r.cs);
7523 <RESULT IF_PASS NEGATIVE>
7529 .*--------------------------------------------------------------------------*
7530 :h3.Adhoc - sizeof()/lengthof() DTEs
7531 .*--------------------------------------------------------------------------*
7534 <TC - Adhoc - sizeof()/lengthof() DTEs>
7538 <MODULE TTCN Temp Temp.ttcn>
7540 type component CT {}
7541 type record of integer ROI;
7542 testcase tc_sizeof_lengthof_standard1() runs on CT {
7543 var template ROI tr_roI1 := { 1, permutation(2, 3), ? }
7544 if(lengthof(tr_roI1)==4) { setverdict(pass)}else { setverdict(fail) };
7545 template ROI tr_roI2 := {1, *, (2, 3) }
7546 if(lengthof(tr_roI2)==3){ setverdict(pass)}else { setverdict(fail) }; //DTE!!!!
7549 testcase tc_sizeof_lengthof_standard2() runs on CT {
7550 if(lengthof('1*F'H) ==3){ setverdict(pass)}else { setverdict(fail) }; //DTE???
7554 execute(tc_sizeof_lengthof_standard1())
7555 execute(tc_sizeof_lengthof_standard2())
7559 <MODULE CFG Temp Temp.cfg>
7562 LogSourceInfo := Yes
7563 Logfile := "Temp%i.log"
7565 ConsoleMask := LOG_ALL
7569 <RESULT IF_PASS NEGATIVE>
7570 (?is)\berror: Performing lengthof() operation on a template of type \@Temp.ROI with no exact length.
7572 <RESULT IF_PASS NEGATIVE>
7573 (?is)\berror: Performing lengthof() operation on a hexstring template with no exact length.
7578 .*--------------------------------------------------------------------------*
7579 :h3.Adhoc - sizeof()/lengthof() compilation errors
7580 .*--------------------------------------------------------------------------*
7583 <TC - Adhoc - sizeof()/lengthof() compilation errors>
7587 <MODULE TTCN Temp Temp.ttcn>
7589 type record of integer ROI;
7590 type component CT {}
7591 testcase tc_sizeof_lengthof_standard1() runs on CT {
7592 template ROI tr_roI4 := { 1, 2, 3, * } length(1..2) ; //compilation error
7593 if(lengthof(tr_roI4)==3) { setverdict(fail) };
7597 <RESULT IF_PASS NEGATIVE>
7598 (?is)\berror: There are more (at least 3) elements in the template than it is allowed by the length restriction (at most 2)
7603 .*--------------------------------------------------------------------------*
7604 :h3.Adhoc - Additional RAW attribute checks for LENGTHTO
7605 .*--------------------------------------------------------------------------*
7608 <TC - Additional RAW attribute checks for LENGTHTO>
7612 <MODULE TTCN Temp Temp.ttcn>
7614 type union myu_ok { integer a, integer b }
7615 type union myu_nok { integer a, charstring b }
7616 type record of integer mylist
7622 variant (f2) "LENGTHTO (f3)"
7629 variant (f2) "LENGTHTO (f3)"
7636 variant (f2) "LENGTHTO (f3)"
7643 variant (f2) "LENGTHTO (f3)"
7649 variant (f1) "LENGTHTO (f2)"
7651 } with { encode "RAW" }
7653 <RESULT IF_PASS COUNT 1>
7654 (?is)\berror: The union type LENGTHTO field must contain only integer fields
7656 <RESULT IF_PASS COUNT 1>
7657 (?is)\berror: The LENGTHTO field must be an integer or union type instead of `\@Temp.mylist'
7659 <RESULT IF_PASS COUNT 1>
7660 (?is)\berror: The LENGTHTO field must be an integer or union type instead of `charstring'
7662 <RESULT IF_PASS COUNT 3>
7668 .*--------------------------------------------------------------------------*
7669 :h3.Adhoc - HQ43433 decode parameter check
7670 .*--------------------------------------------------------------------------*
7673 <TC - HQ43433 decode parameter check>
7677 <MODULE TTCN Temp Temp.ttcn>
7681 // type definition incl. RAW attribute
7686 variant (i) "BYTEORDER(last)";
7689 // wrapper functions for encoding/decoding
7690 function enc(S s) return bitstring {
7696 // BUG: TITAN SA does NOT report error when @m.dec.bs is not declared inout
7697 // Instead, the compiler generates erronous C++ code which brakes C++
7698 // compilation at function invocation (line marked below)
7699 function dec(/*inout*/ bitstring bs) return S {
7702 // decvalue 1st par should be inout by standard?
7703 i := decvalue(bs, s);
7707 function dec2(in bitstring bs) return S {
7710 // decvalue 1st par should be inout by standard?
7711 i := decvalue(bs, s);
7715 function dec3(out bitstring bs) return S {
7718 var bitstring vl_bs:=bs;
7719 // decvalue 1st par should be inout by standard?
7720 i := decvalue(bs, s);
7725 function dec_inout(inout bitstring bs) return S {
7728 // decvalue 1st par should be inout by standard?
7729 i := decvalue(bs, s);
7733 type component MyComp {}
7735 testcase tc_default() runs on MyComp {
7736 var S s := { i := 2 };
7743 log("decoded:",s_mod);
7744 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7748 testcase tc_in() runs on MyComp {
7749 var S s := { i := 2 };
7756 log("decoded:",s_mod);
7757 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7760 /* debate: out fv can use out param!! TR???
7761 testcase tc_out() runs on MyComp {
7762 var S s := { i := 2 };
7769 log("decoded:",s_mod);
7770 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7774 testcase tc_inout() runs on MyComp {
7775 var S s := { i := 2 };
7781 s_mod := dec_inout(bs);
7782 log("decoded:",s_mod);
7783 if(match(s,s_mod)) {setverdict(pass);} else {setverdict(fail)}
7787 //======Another example=====
7790 const MyType c_MyType := 42;
7791 const bitstring c_encoded := '00110011'B;
7793 function f_decvalue_inpar( bitstring p_bit) {
7794 var MyType v_MyType;
7795 var bitstring vl_original:=p_bit;
7796 log( "Original input:",p_bit);
7797 log ("errCode: ",decvalue (p_bit,v_MyType)," ", vl_original, " is decodedTo: ",v_MyType, " remained:",
7799 if(v_MyType==51 and p_bit==''B) { setverdict(pass)} else {setverdict(fail)}
7803 function f_decvalue_inoutpar( inout bitstring p_bit) {
7804 var MyType v_MyType;
7805 var bitstring vl_original:=p_bit;
7806 log( "Original input:",p_bit);
7807 log ("errCode: ",decvalue (p_bit,v_MyType)," ", vl_original, " is decodedTo: ",v_MyType, " remained:",
7809 if(v_MyType==51 and p_bit==''B) { setverdict(pass)} else {setverdict(fail)}
7812 testcase tc_2() runs on MyComp {
7813 var bitstring v_bit := c_encoded;
7814 f_decvalue_inoutpar(v_bit);
7815 f_decvalue_inpar(c_encoded);
7820 execute(tc_default());
7822 //execute(tc_out());
7823 execute(tc_inout());
7834 <MODULE CFG Temp Temp.cfg>
7838 LogSourceInfo := Yes
7839 Logfile := "Temp%i.log"
7841 ConsoleMask := LOG_ALL
7847 Overall verdict: pass
7854 .*--------------------------------------------------------------------------*
7855 :h3.Adhoc - @try @catch blocks no errors
7856 .*--------------------------------------------------------------------------*
7859 <TC - @try @catch blocks no errors>
7863 <MODULE TTCN Temp Temp.ttcn>
7865 type component MyComp {}
7870 function fv2() return integer {
7886 testcase tc() runs on MyComp {
7901 <RESULT IF_PASS COUNT 0>
7907 .*--------------------------------------------------------------------------*
7908 :h3.Adhoc - @try @catch blocks semantic errors
7909 .*--------------------------------------------------------------------------*
7912 <TC - @try @catch blocks semantic errors>
7916 <MODULE TTCN Temp Temp.ttcn>
7918 type component MyComp {}
7924 function fv2() return integer {
7941 testcase tc() runs on MyComp {
7953 const charstring dte_str := "";
7958 <RESULT IF_PASS COUNT 2>
7959 (?is)\berror: Definition with identifier `e' is not unique in the scope hierarchy
7961 <RESULT IF_PASS COUNT 2>
7962 (?is)\berror: `try' statement block must be followed by a `catch' block
7964 <RESULT IF_PASS COUNT 2>
7965 (?is)\berror: `catch' statement block must be preceded by a `try' block
7967 <RESULT IF_PASS COUNT 1>
7968 (?is)\berror: The function has return type, but control might leave it without reaching a return statement
7970 <RESULT IF_PASS COUNT 1>
7971 (?is)\berror: Duplicate definition with identifier `dte_str'
7973 <RESULT IF_PASS COUNT 1>
7974 (?is)\berror: Type mismatch: a value of type `integer' was expected instead of `charstring'
7976 <RESULT IF_PASS COUNT 9>
7982 .*---------------------------------------------------------------------*
7983 :h3.Adhoc:: @try @catch blocks catching DTEs
7984 .*---------------------------------------------------------------------*
7986 <TC - @try @catch blocks catching DTEs>
7989 <MODULE TTCN Temp Temp.ttcn>
7991 type component MyComp {}
7992 function safe_str2int(in charstring int_str, in integer defval) return integer {
7994 return str2int(int_str);
8000 testcase TC1() runs on MyComp {
8001 if (safe_str2int("bread", -1)==-1) { setverdict(pass); }
8002 else { setverdict(fail); }
8004 testcase TC2() runs on MyComp {
8005 var integer myEvilUnboundVariable;
8007 myEvilUnboundVariable := myEvilUnboundVariable + 1;
8014 testcase TC3() runs on MyComp {
8021 if (match(e, pattern "*division by zero*")) { setverdict(pass); }
8022 else { setverdict(fail); }
8033 <MODULE CFG Temp Temp.cfg>
8036 LogSourceInfo := Yes
8037 Logfile := "Temp%i.log"
8039 ConsoleMask := LOG_ALL
8043 <RESULT IF_PASS COUNT 0>
8044 (?im)Dynamic test case error:
8046 <RESULT IF_PASS COUNT 1>
8047 (?im)Overall verdict: pass
8052 .*---------------------------------------------------------------------*
8053 :h3.Adhoc:: @lazy parameters - no errors
8054 .*---------------------------------------------------------------------*
8056 <TC - @lazy parameters - no errors>
8059 <MODULE TTCN Temp Temp.ttcn>
8062 type component MyComp {}
8063 const charstring c := "c";
8064 testcase TC() runs on MyComp {
8065 var charstring a := "a";
8066 var charstring b := "b";
8067 var integer i1 := 100;
8068 var integer i2 := 20;
8069 var integer i3 := 3;
8070 MyFunc2(a&b&c&log2str(i1+i2+i3));
8073 function MyFunc(in @lazy charstring str) {
8078 function MyFunc2(in @lazy charstring sz) {
8081 function MyFn1(in @lazy charstring str) return charstring {
8084 function MyFn2(in @lazy charstring s) return charstring {
8085 return MyFn2(s&MyFn1(s));
8087 function MyFuncNormalEval(in charstring str, boolean b) {
8089 var charstring s := str;
8090 if (s=="") { log(s); }
8093 function MyFuncLazyEval(in @lazy charstring str, boolean b) {
8095 var charstring s := str;
8096 if (s=="") { log(s); }
8099 function Fdefaultpar( @lazy integer pi := 123 ) { log(pi); }
8100 function FuncTemplate(in template @lazy charstring tp) {
8104 function FuncTempl(in template @lazy charstring tp) {
8112 template REC trec(template @lazy integer pi) := {
8116 function usingRECfield(@lazy integer pi) {
8119 type record of integer RECOFINT;
8120 type record RECINT {
8121 RECOFINT ints optional,
8122 RECINT next optional
8124 function usingRECINTfield(@lazy integer pi) {
8125 var integer ii := pi + 100;
8129 var template REC vrec := trec(?);
8130 var REC r := { rec:={ rec:={ rec:=omit, i:=3 }, i:=2 }, i:=1 }
8131 usingRECfield(r.rec.rec.i);
8132 var integer idx1 := 2;
8133 var integer idx2 := 4;
8134 var RECINT vrecint := { ints:=omit, next:={ ints:={1,2,3,4,5}, next:=omit} }
8135 usingRECINTfield(vrecint.next.ints[idx1+idx2-3]);
8143 <RESULT IF_PASS COUNT 0>
8149 .*---------------------------------------------------------------------*
8150 :h3.Adhoc:: @lazy parameters - no runtime error
8151 .*---------------------------------------------------------------------*
8153 <TC - @lazy parameters - no runtime error>
8156 <MODULE TTCN Temp Temp.ttcn>
8158 type component MyComp {}
8159 function DTEfunc(in charstring s) return charstring {
8163 function LazyFunc(in boolean b, in @lazy charstring s) return charstring {
8170 testcase LazyTC() runs on MyComp {
8171 log(LazyFunc(true, DTEfunc("x")));
8179 <MODULE CFG Temp Temp.cfg>
8182 LogSourceInfo := Yes
8183 Logfile := "Temp%i.log"
8185 ConsoleMask := LOG_ALL
8189 <RESULT IF_PASS COUNT 0>
8190 (?im)Dynamic test case error:
8192 <RESULT IF_PASS COUNT 1>
8193 (?im)Overall verdict: pass
8198 .*--------------------------------------------------------------------------*
8199 :h3.Adhoc - @lazy parameters - semantic errors
8200 .*--------------------------------------------------------------------------*
8203 <TC - @lazy parameters - semantic errors>
8207 <MODULE TTCN Temp Temp.ttcn>
8209 type function FT(in charstring str);
8210 function FTinst(in @lazy charstring str) {}
8211 type function FT2(in @lazy charstring str);
8213 var FT ft1 := refers(FTinst);
8218 <RESULT IF_PASS COUNT 1>
8219 (?is)\berror: Formal parameter `str' cannot be \@lazy, not supported in this case.
8221 <RESULT IF_PASS COUNT 1>
8222 (?is)\berror: Parameter \@lazy-ness mismatch
8224 <RESULT IF_PASS COUNT 2>
8230 .*---------------------------------------------------------------------*
8231 :h3.Adhoc:: @lazy parameters - correct lazy evaluation
8232 .*---------------------------------------------------------------------*
8234 <TC - @lazy parameters - correct lazy evaluation>
8237 <MODULE TTCN Temp Temp.ttcn>
8239 type component MyComp2 {
8240 var integer ci := 0;
8242 function FN2() runs on MyComp2 return integer {
8243 if (ci==0) { testcase.stop("ci==0 error!"); }
8246 function Lazy2(in @lazy integer pi) runs on MyComp2 {
8248 var integer vi := pi; // evaluated: 3*11 = 33
8249 if (vi!=33) { setverdict(fail); }
8251 vi := pi; // not evaled -> 33
8252 if (vi!=33) { setverdict(fail); }
8254 testcase TC2() runs on MyComp2 {
8263 <MODULE CFG Temp Temp.cfg>
8266 LogSourceInfo := Yes
8267 Logfile := "Temp%i.log"
8269 ConsoleMask := LOG_ALL
8273 <RESULT IF_PASS COUNT 0>
8274 (?im)Dynamic test case error:
8276 <RESULT IF_PASS COUNT 1>
8277 (?im)Overall verdict: pass
8282 .*---------------------------------------------------------------------*
8283 :h3.Adhoc:: modulepar invalid simple type: port
8284 .*---------------------------------------------------------------------*
8286 <TC - Adhoc::modulepar invalid type - port>
8289 <MODULE TTCN Temp Temp.ttcn>
8291 modulepar comp_CT tsp_Comp;
8292 modulepar port_PT tsp_Port;
8293 modulepar default_DT tsp_Def;
8294 type component comp_CT {
8295 var integer v_int := 0;
8297 type port port_PT message {
8300 type default default_DT;
8303 <RESULT IF_FAIL COUNT 1>
8306 <RESULT IF_FAIL POSITIVE>
8307 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
8308 <END_RESULT><END_TC>
8311 .*-----------------------------------------------------------*
8312 :h3.Adhoc:: modulepar invalid type: circular type definition
8313 .*-----------------------------------------------------------*
8315 <TC - Adhoc::modulepar invalid type - circular type definition>
8318 <MODULE TTCN Temp Temp.ttcn>
8320 modulepar invalidRec tsp_Rec;
8321 type record invalidRec {
8326 type set invalidSet {
8331 type component comp_CT {
8332 var integer v_int := 0;
8336 <RESULT IF_FAIL COUNT 1>
8337 (?im)\bcircular\b.+?\breference\b
8339 <RESULT IF_FAIL COUNT 1>
8342 <RESULT IF_FAIL POSITIVE>
8343 (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
8344 <END_RESULT><END_TC>
8347 .*-----------------------------------------------------------*
8348 :h3.Adhoc:: record of [-] in type reference
8349 .*-----------------------------------------------------------*
8351 <TC - record of [-] in type reference>
8354 <MODULE TTCN Temp Temp.ttcn>
8356 type record GetResponseX {
8362 type record MyRecord {
8363 GetResponseX.pcB_list[-] field1
8365 type record of GetResponseX.pcB_list[-] MyPcB_list;
8366 type GetResponseX.pcB_list[-].pcB MyCharType;
8367 type port PCOType message {
8369 } with {extension "internal"}
8370 type component MTCType {
8371 const GetResponseX.pcB_list[-] cl_myRecord := cg_RecofElem;
8372 const GetResponseX.pcB_list[-].pcB cl_myChar := "O";
8373 var GetResponseX.pcB_list[-] vl_myRecValue;
8374 var GetResponseX.pcB_list[-].pcB vl_myCharValue1;
8375 var template GetResponseX.pcB_list[-] vl_myRecTempl1;
8376 var template GetResponseX.pcB_list[-].pcB vl_myCharTempl;
8377 port PCOType MyPCO_PT;
8379 const GetResponseX.pcB_list[-] cg_RecofElem := {
8383 modulepar GetResponseX.pcB_list[-] tsp_RecofElem := {
8387 template GetResponseX.pcB_list[-] t_RecofElem := {
8391 function x (GetResponseX.pcB_list[-] pl_elem, template GetResponseX.pcB_list[-] plt_elem) {
8392 const GetResponseX.pcB_list[-] cl_myRecord1 := cg_RecofElem;
8393 const GetResponseX.pcB_list[-].pcB cl_myChar1 := "O";
8394 var GetResponseX.pcB_list[-] vl_myRecValue1;
8395 var GetResponseX.pcB_list[-].pcB vl_myCharValue2;
8396 var template GetResponseX.pcB_list[-] vl_myRecTempl2;
8397 var template GetResponseX.pcB_list[-].pcB vl_myCharTempl;
8399 testcase tc(GetResponseX.pcB_list[-] pl_elem) runs on MTCType {
8400 const GetResponseX.pcB_list[-] cl_myRecord2 := cg_RecofElem;
8401 const GetResponseX.pcB_list[-].pcB cl_myChar2 := "O";
8402 var GetResponseX.pcB_list[-] vl_myRecValue2;
8403 var GetResponseX.pcB_list[-].pcB vl_myCharValue;
8404 var template GetResponseX.pcB_list[-] vl_myRecTempl3;
8405 var template GetResponseX.pcB_list[-].pcB vl_myCharTempl3;
8406 if (pl_elem.pcB == "0") { setverdict(pass)}
8407 else { setverdict (fail);}
8409 altstep as_x (GetResponseX.pcB_list[-] pl_elem, template GetResponseX.pcB_list[-] plt_elem) runs on MTCType {
8410 const GetResponseX.pcB_list[-] cl_myRecord3 := cg_RecofElem;
8411 const GetResponseX.pcB_list[-].pcB cl_myChar3 := "O";
8412 var GetResponseX.pcB_list[-] vl_myRecValue3;
8413 var GetResponseX.pcB_list[-].pcB vl_myCharValue;
8414 var template GetResponseX.pcB_list[-] vl_myRecTempl4;
8415 var template GetResponseX.pcB_list[-].pcB vl_myCharTempl4;
8416 [] MyPCO_PT.receive { }
8420 const GetResponseX.pcB_list[-] cl_myRecord4 := cg_RecofElem;
8421 const GetResponseX.pcB_list[-].pcB cl_myChar4 := "O";
8422 var GetResponseX.pcB_list[-] vl_myRecValue2;
8423 var GetResponseX.pcB_list[-].pcB vl_myCharValue;
8424 var template GetResponseX.pcB_list[-] vl_myRecTempl2;
8425 var template GetResponseX.pcB_list[-].pcB vl_myCharTempl2;
8426 var GetResponseX.pcB_list[-] v_RecofElem := {
8430 execute (tc(v_RecofElem));
8434 <MODULE CFG Temp Temp.cfg>
8437 LogSourceInfo := Yes
8438 Logfile := "Temp%i.log"
8440 ConsoleMask := LOG_ALL
8444 <RESULT IF_PASS COUNT 0>
8445 (?im)Dynamic test case error:
8447 <RESULT IF_PASS COUNT 1>
8448 (?im)Overall verdict: pass
8453 .*-----------------------------------------------------------*
8454 :h3.Adhoc:: HP36129: Check for component name correctness
8455 .*-----------------------------------------------------------*
8457 <TC - HP36129: Check for component name correctness>
8460 <MODULE TTCN Temp Temp.ttcn>
8462 type port PT message {
8464 } with { extension "internal" }
8468 function f1() runs on C{
8471 testcase tc() runs on C {
8472 var C comp := C.create("Alma-a.!ta");
8482 <MODULE CFG Temp Temp.cfg>
8485 LogSourceInfo := Yes
8486 "Alma-a.!ta".FileMask := WARNING
8487 ConsoleMask := LOG_ALL
8491 <RESULT IF_PASS COUNT 0>
8492 (?im)Dynamic test case error:
8494 <RESULT IF_PASS COUNT 1>
8495 (?im)Overall verdict: pass
8500 *-----------------------------------------------------------*
8501 :h3.Adhoc:: HT23335: Type Infinity is not a valid value for type `integer' which as subtype (-1..65535)
8502 .*-----------------------------------------------------------*
8504 <TC - HT23335: Type Infinity is not a valid value for type `integer' which as subtype (-1..65535)>
8508 <MODULE TTCN Temp Temp.ttcn>
8510 const integer limes_i := 65535;
8511 const float limes_f2 := 65535.0;
8512 const float limes_f1 := -1.0;
8513 type record MyRecI {
8514 integer inum (-1..limes_i)
8516 type record MyRecF {
8517 float fnum (limes_f1..limes_f2)
8520 template MyRecI t1 := { inum := (0..infinity) };
8521 template MyRecF t2 := { fnum := (-infinity..0.0) };
8525 <RESULT IF_FAIL COUNT 2>
8526 (?im)\Infinity is not a valid value for type\b