Sync with 5.3.0
[deliverable/titan.core.git] / function_test / Semantic_Analyser / TTCN3_SA_7_TD.script
CommitLineData
970ed795
EL
1.******************************************************************************
2.* Copyright (c) 2000-2014 Ericsson Telecom AB
3.* All rights reserved. This program and the accompanying materials
4.* are made available under the terms of the Eclipse Public License v1.0
5.* which accompanies this distribution, and is available at
6.* http://www.eclipse.org/legal/epl-v10.html
7.******************************************************************************/
8:text.
9:lang eng.
10
11.* EDML webpage: http://cpi.ericsson.se/dwaxe/
12.* EDML2PDF converter: http://dwaxe.ericsson.se/x2pdf
13.* EDML user guide: http://www.lmc.ericsson.se/~lmcmarg/isit/edml_ug.html
14
15.* Document header information
16:docname.Test Description
a38c6d4c 17:docno.18/152 91-CRL 113 200/5 Uen
970ed795 18:rev.A
a38c6d4c 19:date.2015-04-27
970ed795
EL
20
21:prep.ETH/XZR Krisztian Pandi
22:appr.ETH/XZ (Gyula Koos)
23:checked.ETHGRY
24
25:title.Test description of the TTCN-3 Semantic Analyzer: Location of Language Elements
26:contents level=2.
27.*---------------------------------------------------------------------*
28:h1.Introduction
29.*---------------------------------------------------------------------*
30.*---------------------------------------------------------------------*
31:h2.Revision history
32.*---------------------------------------------------------------------*
33:xmp tab=2.
34REV DATE PREPARED CHANGE
35__________________________________________________
36PA1 2005-02-17 ESNDPAL New document for TITAN R6
37A 2005-03-18 ESNDPAL Approved after review
38B 2006-07-31 EKRISZA Updates for TITAN R6E
39C 2007-03-06 EJNOSZA Updates for TITAN R7A (expected error messages)
40D 2009-06-11 EKRISZA Name correction
41A 2011-12-12 EKRISZA Updated for release
42A 2012-06-27 EFERKOV Updated for release
43A 2013-01-17 EKRIPND Updated for release
44:exmp.
45.*---------------------------------------------------------------------*
46:h2.Purpose
47.*---------------------------------------------------------------------*
48The purpose of this Test Description is to define and describe the function
49test activity for the Semantic Analyser functionality of the TTCN-3 compiler:
50:nl.SA-7/x: Location of Language Elements
51:p.The specification of the test cases can be found in this document.
52.*---------------------------------------------------------------------*
53:h1.Test environment
54.*---------------------------------------------------------------------*
55.*---------------------------------------------------------------------*
56:h2.Hardware
57.*---------------------------------------------------------------------*
58No specific hardware requirement.
59.*---------------------------------------------------------------------*
60:h2.Software
61.*---------------------------------------------------------------------*
62Tests shall be carried out on the following platforms:
63:list.
64:li D='1.'.Solaris 8 (Sun OS 5.8) (gcc 3.0.4)
65:li D='2.'.SUSE Linux Enterprise server 8 (2.4.19-4GB) (gcc 3.2)
66:li D='3.'.CYGWIN_NT-5.0 (Cygwin DLL: 1.5.12) on Windows 2000 (gcc 3.3.3)
67:elist.
68.*---------------------------------------------------------------------*
69:h2.Configuration
70.*---------------------------------------------------------------------*
71The test environment had been setup in CVS. The tester program is stored in:
72:nl.TTCNv3/function_test/Tools/SAtester.pl
73:nl.Test cases are stored with extension .script in the directory:
74:nl.TTCNv3/function_test/Semantic_Analyser/
75.*---------------------------------------------------------------------*
76:h2.Installation
77.*---------------------------------------------------------------------*
78Install proper TITAN binaries on the used platforms and make sure that
79your environment settings are correct:
80:list.
81:li D='1.'.TTCN3_DIR is set
82:li D='2.'.$TTCN3_DIR/bin is added to the PATH variable
83:li D='3.'.$TTCN3_DIR/lib is added to the LD_LIBRARY_PATH variable
84:li D='4.'.Perl 5.6.0 or higher is available on the platform
85:li D='5.'.Create a symlink to your Perl binary into the directory where the
86test cases are stored:
87:nl.ln -s <your Perl> perl
88:elist.
89.*---------------------------------------------------------------------*
90:h2.Test Tools
91.*---------------------------------------------------------------------*
92A tester program had been written in Perl especially for the Semantic Analyser
93tests. For the list of command line parameters, type 'SAtester.pl -help', for the
94complete documentation, type 'SAtester.pl -doc'.
95:p.Test cases are specified in the Test Description documents in EDML format.
96The tester program parses these files and generates the TTCN-3/ASN.1 modules, then
97calls the compiler to compile them. The result printout is then matched against
98different patterns to be able to set the verdict. Test cases contain not only
99the source modules, but the patterns as well.
100:p.The tester program allows one-by-one execution of test cases and batched
101execution as well.
102:p.NOTE: the tester program requires Perl 5.6.0 or higher.
103.*---------------------------------------------------------------------*
104:h1.Test cases
105.*---------------------------------------------------------------------*
106Ref [1]: SA-7/x: Values, Location of Language Elements
107.*---------------------------------------------------------------------*
108:h2.Location of language elements
109.*---------------------------------------------------------------------*
110.*---------------------------------------------------------------------*
111:h3.A declaration/statement/operation is used where it is not supposed to be used
112.*---------------------------------------------------------------------*
113
114This test case group covers the requirement SA-7/1.
115
116Strategy: See table 'Overview of TTCN-3 statements and operations' (table 11 on page 84).
117 We also test the "port" and "component" keywords.
118 Return can be used only in functions.
119
120NOTE:
121:list.
122:li D='-'.the "repeat" cannot be tested, because other errors hide its error
123:li D='-'.the "interleave" structure is not supported in the TITAN
124:li D='-'."deactivate" cannot be tested, because the error of the "activate" covers its error
125:li D='-'."mtc" and "system" are integers in TITAN, so we won't negative test it
126:elist.
127
128.*---------------------------------------------------------------------*
129:h4.A declaration/statement/operation is used where it is not supposed to be used - alt (receive)
130.*---------------------------------------------------------------------*
131:xmp tab=0.
132
133<TC - A declaration/statement/operation is used where it is not supposed to be used - alt (receive)>
134
135<COMPILE>
136<VERDICT_LEAF PASS>
137<MODULE TTCN x x.ttcn>
138module x {
139
140type port portT message {
141 in integer
142} with {extension "internal"}
143
144type component comp {
145 port portT myPort;
146}
147
148control {
149
150 timer T1 := 5.0;
151 T1.start;
152
153 alt{
154 [] T1.timeout{
155 repeat
156 }
157 [] myPort.receive(?){
158
159 }
160 }
161}
162
163}
164<END_MODULE>
165<RESULT IF_PASS COUNT 1>
166(?im)error.+?Port.+?operation.+?not.+?allowed.+?in.+?control.+?part
167<END_RESULT>
168<RESULT IF_PASS COUNT 1>
169(?im)error.+?no.+?imported.+?definition
170<END_RESULT>
171<RESULT IF_PASS COUNT 2>
172(?is)\berror:
173<END_RESULT>
174<END_TC>
175
176:exmp.
177
178.*---------------------------------------------------------------------*
179:h4.A declaration/statement/operation is used where it is not supposed to be used - return (in control part)
180.*---------------------------------------------------------------------*
181:xmp tab=0.
182
183<TC - A declaration/statement/operation is used where it is not supposed to be used - return (in control part) >
184
185<COMPILE>
186<VERDICT_LEAF PASS>
187<MODULE TTCN x x.ttcn>
188module x {
189
190control {
191
192 timer T1 := 5.0;
193 T1.start;
194
195 return
196}
197
198}
199<END_MODULE>
200<RESULT IF_PASS COUNT 1>
201(?im)error.+?Return.+?statement.+?not.+?used.+?in.+?control.+?part
202<END_RESULT>
203<RESULT IF_PASS COUNT 1>
204(?is)\berror:
205<END_RESULT>
206<END_TC>
207
208:exmp.
209
210.*---------------------------------------------------------------------*
211:h4.A declaration/statement/operation is used where it is not supposed to be used - return (in altstep)
212.*---------------------------------------------------------------------*
213:xmp tab=0.
214
215<TC - A declaration/statement/operation is used where it is not supposed to be used - return (in altstep) >
216
217<COMPILE>
218<VERDICT_LEAF PASS>
219<MODULE TTCN x x.ttcn>
220module x {
221
222type port portT message {
223 in integer
224} with {extension "internal"}
225
226type component myComp {
227 port portT myPort;
228}
229
230altstep myAltStep ( timer T1) runs on myComp{
231
232 [] T1.timeout{
233 // TR 643: return statement in altsteps
234 return
235} }
236
237}
238<END_MODULE>
239<RESULT IF_PASS COUNT 0>
240(?im)error.+?Return.+?statement.+?not.+?used.+?in.+?altstep
241<END_RESULT>
242<RESULT IF_PASS COUNT 0>
243(?is)\berror:
244<END_RESULT>
245<END_TC>
246
247:exmp.
248
249.*---------------------------------------------------------------------*
250:h4.A declaration/statement/operation is used where it is not supposed to be used - return (in testcase)
251.*---------------------------------------------------------------------*
252:xmp tab=0.
253
254<TC - A declaration/statement/operation is used where it is not supposed to be used - return (in testcase) >
255
256<COMPILE>
257<VERDICT_LEAF PASS>
258<MODULE TTCN x x.ttcn>
259module x {
260
261type port portT message {
262 in integer
263} with {extension "internal"}
264
265type component myComp {
266 port portT myPort;
267}
268
269testcase myTestCase() runs on myComp{
270
271 timer T1 := 5.0;
272 T1.start;
273
274 return
275}
276
277}
278<END_MODULE>
279<RESULT IF_PASS COUNT 1>
280(?im)error.+?Return.+?statement.+?not.+?used.+?in.+?testcase
281<END_RESULT>
282<RESULT IF_PASS COUNT 1>
283(?is)\berror:
284<END_RESULT>
285<END_TC>
286
287:exmp.
288
289.*---------------------------------------------------------------------*
290:h4.A declaration/statement/operation is used where it is not supposed to be used - activate
291.*---------------------------------------------------------------------*
292:xmp tab=0.
293
294<TC - A declaration/statement/operation is used where it is not supposed to be used - activate >
295
296<COMPILE>
297<VERDICT_LEAF PASS>
298<MODULE TTCN x x.ttcn>
299module x {
300
301type port portT message {
302 in integer
303} with {extension "internal"}
304
305type component myComp {
306 port portT myPort;
307}
308
309
310altstep myAltStep ( ) runs on myComp{
311 [] myPort.receive(?){
312 log("YY");
313 }
314}
315
316
317
318control {
319
320 timer T1 := 5.0;
321 T1.start;
322 timer T2 := 3.0;
323 T2.start;
324
325 var default myDefVar := activate(myAltStep( ));
326
327 alt{
328 [] T1.timeout{
329 log("XX");
330 }
331 }
332}
333
334}
335<END_MODULE>
336<RESULT IF_PASS COUNT 1>
337(?im)error.+?definition.+?without.+?runs.+?on.+?clause.+?cannot.+?activate.+?altstep
338<END_RESULT>
339<RESULT IF_PASS COUNT 1>
340(?is)\berror:
341<END_RESULT>
342<END_TC>
343
344:exmp.
345
346.*---------------------------------------------------------------------*
347:h4.A declaration/statement/operation is used where it is not supposed to be used - create
348.*---------------------------------------------------------------------*
349:xmp tab=0.
350
351<TC - A declaration/statement/operation is used where it is not supposed to be used - create >
352
353<COMPILE>
354<VERDICT_LEAF PASS>
355<MODULE TTCN x x.ttcn>
356module x {
357
358type port portT message {
359 in integer
360} with {extension "internal"}
361
362type component myComp {
363 port portT myPort;
364}
365
366control {
367
368 var myComp myPTC;
369 myPTC := myComp.create;
370
371}
372
373}
374<END_MODULE>
375<RESULT IF_PASS COUNT 1>
376(?im)error.+?Operation.+?create.+?not.+?allowed.+?in.+?control.+?part
377<END_RESULT>
378<RESULT IF_PASS COUNT 1>
379(?is)\berror:
380<END_RESULT>
381<END_TC>
382
383:exmp.
384
385.*---------------------------------------------------------------------*
386:h4.A declaration/statement/operation is used where it is not supposed to be used - connect
387.*---------------------------------------------------------------------*
388:xmp tab=0.
389
390<TC - A declaration/statement/operation is used where it is not supposed to be used - connect >
391
392<COMPILE>
393<VERDICT_LEAF FAIL>
394<MODULE TTCN x x.ttcn>
395module x {
396
397type port portT message {
398 in integer
399} with {extension "internal"}
400
401type component myComp {
402 port portT myPort;
403}
404
405control {
406
407 var myComp myPTC;
408
409 connect( myPTC:Port1, mtc:Port2);
410
411}
412
413}
414<END_MODULE>
415<RESULT IF_FAIL COUNT 1>
416(?im)\berror\b.+?syntax.+?error.+?unexpected.+?connect
417<END_RESULT>
418<RESULT IF_FAIL COUNT 1>
419(?is)\berror:
420<END_RESULT>
421<END_TC>
422
423:exmp.
424
425.*---------------------------------------------------------------------*
426:h4.A declaration/statement/operation is used where it is not supposed to be used - disconnect
427.*---------------------------------------------------------------------*
428:xmp tab=0.
429
430<TC - A declaration/statement/operation is used where it is not supposed to be used - disconnect >
431
432<COMPILE>
433<VERDICT_LEAF FAIL>
434<MODULE TTCN x x.ttcn>
435module x {
436
437type port portT message {
438 in integer
439} with {extension "internal"}
440
441type component myComp {
442 port portT myPort;
443}
444
445control {
446
447 var myComp myPTC;
448
449 disconnect( myPTC:Port1, mtc:Port2);
450
451}
452
453}
454<END_MODULE>
455<RESULT IF_FAIL COUNT 1>
456(?im)\berror\b.+?syntax.+?error.+?unexpected.+?disconnect
457<END_RESULT>
458<RESULT IF_FAIL COUNT 1>
459(?is)\berror:
460<END_RESULT>
461<END_TC>
462
463:exmp.
464
465.*---------------------------------------------------------------------*
466:h4.A declaration/statement/operation is used where it is not supposed to be used - map
467.*---------------------------------------------------------------------*
468:xmp tab=0.
469
470<TC - A declaration/statement/operation is used where it is not supposed to be used - map >
471
472<COMPILE>
473<VERDICT_LEAF FAIL>
474<MODULE TTCN x x.ttcn>
475module x {
476
477type port portT message {
478 in integer
479} with {extension "internal"}
480
481type component myComp {
482 port portT myPort;
483}
484
485control {
486
487 var myComp myPTC;
488
489 map( myPTC:Port1, system:Port2);
490
491}
492
493}
494<END_MODULE>
495<RESULT IF_FAIL COUNT 1>
496(?im)\berror\b.+?syntax.+?error.+?unexpected.+?map
497<END_RESULT>
498<RESULT IF_FAIL COUNT 1>
499(?is)\berror:
500<END_RESULT>
501<END_TC>
502
503:exmp.
504
505.*---------------------------------------------------------------------*
506:h4.A declaration/statement/operation is used where it is not supposed to be used - unmap
507.*---------------------------------------------------------------------*
508:xmp tab=0.
509
510<TC - A declaration/statement/operation is used where it is not supposed to be used - unmap >
511
512<COMPILE>
513<VERDICT_LEAF FAIL>
514<MODULE TTCN x x.ttcn>
515module x {
516
517type port portT message {
518 in integer
519} with {extension "internal"}
520
521type component myComp {
522 port portT myPort;
523}
524
525control {
526
527 var myComp myPTC;
528
529 unmap( myPTC:Port1, system:Port2);
530
531}
532
533}
534<END_MODULE>
535<RESULT IF_FAIL COUNT 1>
536(?im)\berror\b.+?syntax.+?error.+?unexpected.+?unmap
537<END_RESULT>
538<RESULT IF_FAIL COUNT 1>
539(?is)\berror:
540<END_RESULT>
541<END_TC>
542
543:exmp.
544
545.*---------------------------------------------------------------------*
546:h4.A declaration/statement/operation is used where it is not supposed to be used - self
547.*---------------------------------------------------------------------*
548:xmp tab=0.
549
550<TC - A declaration/statement/operation is used where it is not supposed to be used - self >
551
552<COMPILE>
553<VERDICT_LEAF PASS>
554<MODULE TTCN x x.ttcn>
555module x {
556
557type port portT message {
558 in integer
559} with {extension "internal"}
560
561type component myComp {
562 port portT myPort;
563}
564
565control {
566
567 var myComp myPTC;
568 myPTC := self;
569}
570
571}
572<END_MODULE>
573<RESULT IF_PASS COUNT 1>
574(?im)error.+?Operation.+?self.+?not.+?allowed.+?in.+?control.+?part
575<END_RESULT>
576<RESULT IF_PASS COUNT 1>
577(?is)\berror:
578<END_RESULT>
579<END_TC>
580
581:exmp.
582
583.*---------------------------------------------------------------------*
584:h4.A declaration/statement/operation is used where it is not supposed to be used - component start
585.*---------------------------------------------------------------------*
586:xmp tab=0.
587
588<TC - A declaration/statement/operation is used where it is not supposed to be used - component start >
589
590<COMPILE>
591<VERDICT_LEAF PASS>
592<MODULE TTCN x x.ttcn>
593module x {
594
595function myFunct() runs on myComp{
596
597 log("PFF");
598}
599
600type port portT message {
601 in integer
602} with {extension "internal"}
603
604type component myComp {
605 port portT myPort;
606}
607
608control {
609
610 var myComp myPTC;
611
612 myPTC.start( myFunct());
613
614}
615
616}
617<END_MODULE>
618<RESULT IF_PASS COUNT 1>
619(?im)\berror\b.+?component.+?operation.+?not.+?allowed.+?control.+?part
620<END_RESULT>
621<RESULT IF_PASS COUNT 1>
622(?is)\berror:
623<END_RESULT>
624<END_TC>
625
626:exmp.
627
628.*---------------------------------------------------------------------*
629:h4.A declaration/statement/operation is used where it is not supposed to be used - component stop
630.*---------------------------------------------------------------------*
631:xmp tab=0.
632
633<TC - A declaration/statement/operation is used where it is not supposed to be used - component stop >
634
635<COMPILE>
636<VERDICT_LEAF PASS>
637<MODULE TTCN x x.ttcn>
638module x {
639
640type port portT message {
641 in integer
642} with {extension "internal"}
643
644type component myComp {
645 port portT myPort;
646}
647
648control {
649
650 var myComp myPTC;
651
652 myPTC.stop;
653}
654
655}
656<END_MODULE>
657<RESULT IF_PASS COUNT 1>
658(?im)error.+?Component.+?operation.+?not.+?allowed.+?in.+?control.+?part
659<END_RESULT>
660<RESULT IF_PASS COUNT 1>
661(?is)\berror:
662<END_RESULT>
663<END_TC>
664
665:exmp.
666
667.*---------------------------------------------------------------------*
668:h4.A declaration/statement/operation is used where it is not supposed to be used - running
669.*---------------------------------------------------------------------*
670:xmp tab=0.
671
672<TC - A declaration/statement/operation is used where it is not supposed to be used - running >
673
674<COMPILE>
675<VERDICT_LEAF PASS>
676<MODULE TTCN x x.ttcn>
677module x {
678
679type port portT message {
680 in integer
681} with {extension "internal"}
682
683type component myComp {
684 port portT myPort;
685}
686
687control {
688
689 var myComp myPTC;
690
691 if ( myPTC.running){
692 log("JEAH");
693 }
694}
695
696}
697<END_MODULE>
698<RESULT IF_PASS COUNT 1>
699(?im)error.+?Operation.+?component.+?running.+?not.+?allowed.+?in.+?control.+?part
700<END_RESULT>
701<RESULT IF_PASS COUNT 1>
702(?is)\berror:
703<END_RESULT>
704<END_TC>
705
706:exmp.
707
708.*---------------------------------------------------------------------*
709:h4.A declaration/statement/operation is used where it is not supposed to be used - done
710.*---------------------------------------------------------------------*
711:xmp tab=0.
712
713<TC - A declaration/statement/operation is used where it is not supposed to be used - done >
714
715<COMPILE>
716<VERDICT_LEAF FAIL>
717<MODULE TTCN x x.ttcn>
718module x {
719
720type port portT message {
721 in integer
722} with {extension "internal"}
723
724type component myComp {
725 port portT myPort;
726}
727
728control {
729
730 var myComp myPTC;
731
732 myPTC.done;
733}
734
735}
736<END_MODULE>
737<RESULT IF_FAIL COUNT 1>
738(?im)\berror\b.+?syntax.+?error.+?unexpected.+?done
739<END_RESULT>
740<RESULT IF_FAIL COUNT 1>
741(?is)\berror:
742<END_RESULT>
743<END_TC>
744
745:exmp.
746
747.*---------------------------------------------------------------------*
748:h4.A declaration/statement/operation is used where it is not supposed to be used - send
749.*---------------------------------------------------------------------*
750:xmp tab=0.
751
752<TC - A declaration/statement/operation is used where it is not supposed to be used - send >
753
754<COMPILE>
755<VERDICT_LEAF FAIL>
756<MODULE TTCN x x.ttcn>
757module x {
758
759type port portT message {
760 inout integer
761} with {extension "internal"}
762
763type component myComp {
764 port portT myPort;
765}
766
767control {
768
769 myPort.send( 12);
770}
771
772}
773<END_MODULE>
774<RESULT IF_FAIL COUNT 1>
775(?im)\berror\b.+?syntax.+?error.+?unexpected.+?send
776<END_RESULT>
777<RESULT IF_FAIL COUNT 1>
778(?is)\berror:
779<END_RESULT>
780<END_TC>
781
782:exmp.
783
784.*---------------------------------------------------------------------*
785:h4.A declaration/statement/operation is used where it is not supposed to be used - receive
786.*---------------------------------------------------------------------*
787:xmp tab=0.
788
789<TC - A declaration/statement/operation is used where it is not supposed to be used - receive >
790
791<COMPILE>
792<VERDICT_LEAF FAIL>
793<MODULE TTCN x x.ttcn>
794module x {
795
796type port portT message {
797 in integer
798} with {extension "internal"}
799
800type component myComp {
801 port portT myPort;
802}
803
804control {
805
806 myPort.receive;
807}
808
809}
810<END_MODULE>
811<RESULT IF_FAIL COUNT 1>
812(?im)\berror\b.+?syntax.+?error.+?unexpected.+?receive
813<END_RESULT>
814<RESULT IF_FAIL COUNT 1>
815(?is)\berror:
816<END_RESULT>
817<END_TC>
818
819:exmp.
820
821.*---------------------------------------------------------------------*
822:h4.A declaration/statement/operation is used where it is not supposed to be used - trigger
823.*---------------------------------------------------------------------*
824:xmp tab=0.
825
826<TC - A declaration/statement/operation is used where it is not supposed to be used - trigger >
827
828<COMPILE>
829<VERDICT_LEAF FAIL>
830<MODULE TTCN x x.ttcn>
831module x {
832
833type port portT message {
834 in integer
835} with {extension "internal"}
836
837type component myComp {
838 port portT myPort;
839}
840
841control {
842
843 myPort.trigger;
844}
845
846}
847<END_MODULE>
848<RESULT IF_FAIL COUNT 1>
849(?im)\berror\b.+?syntax.+?error.+?unexpected.+?trigger
850<END_RESULT>
851<RESULT IF_FAIL COUNT 1>
852(?is)\berror:
853<END_RESULT>
854<END_TC>
855
856:exmp.
857
858.*---------------------------------------------------------------------*
859:h4.A declaration/statement/operation is used where it is not supposed to be used - call
860.*---------------------------------------------------------------------*
861:xmp tab=0.
862
863<TC - A declaration/statement/operation is used where it is not supposed to be used - call >
864
865<COMPILE>
866<VERDICT_LEAF FAIL>
867<MODULE TTCN x x.ttcn>
868module x {
869
870signature myP1( inout integer my1);
871
872type port portT procedure {
873 inout myP1
874} with {extension "internal"}
875
876type component myComp {
877 port portT myPort;
878}
879
880control {
881
882 myPort.call( myP1: 12);
883}
884
885}
886<END_MODULE>
887<RESULT IF_FAIL COUNT 1>
888(?im)\berror\b.+?syntax.+?error.+?unexpected.+?call
889<END_RESULT>
890<RESULT IF_FAIL COUNT 1>
891(?is)\berror:
892<END_RESULT>
893<END_TC>
894
895:exmp.
896
897.*---------------------------------------------------------------------*
898:h4.A declaration/statement/operation is used where it is not supposed to be used - getcall
899.*---------------------------------------------------------------------*
900:xmp tab=0.
901
902<TC - A declaration/statement/operation is used where it is not supposed to be used - getcall >
903
904<COMPILE>
905<VERDICT_LEAF FAIL>
906<MODULE TTCN x x.ttcn>
907module x {
908
909signature myP1( inout integer my1);
910
911type port portT procedure {
912 inout myP1
913} with {extension "internal"}
914
915type component myComp {
916 port portT myPort;
917}
918
919control {
920
921 myPort.getcall( myP1: ?);
922}
923
924}
925<END_MODULE>
926<RESULT IF_FAIL COUNT 1>
927(?im)\berror\b.+?syntax.+?error.+?unexpected.+?getcall
928<END_RESULT>
929<RESULT IF_FAIL COUNT 1>
930(?is)\berror:
931<END_RESULT>
932<END_TC>
933
934:exmp.
935
936.*---------------------------------------------------------------------*
937:h4.A declaration/statement/operation is used where it is not supposed to be used - reply
938.*---------------------------------------------------------------------*
939:xmp tab=0.
940
941<TC - A declaration/statement/operation is used where it is not supposed to be used - reply >
942
943<COMPILE>
944<VERDICT_LEAF FAIL>
945<MODULE TTCN x x.ttcn>
946module x {
947
948signature myP1( inout integer my1);
949
950type port portT procedure {
951 inout myP1
952} with {extension "internal"}
953
954type component myComp {
955 port portT myPort;
956}
957
958control {
959
960 myPort.reply( myP1: 5);
961}
962
963}
964<END_MODULE>
965<RESULT IF_FAIL COUNT 1>
966(?im)\berror\b.+?syntax.+?error.+?unexpected.+?reply
967<END_RESULT>
968<RESULT IF_FAIL COUNT 1>
969(?is)\berror:
970<END_RESULT>
971<END_TC>
972
973:exmp.
974
975.*---------------------------------------------------------------------*
976:h4.A declaration/statement/operation is used where it is not supposed to be used - getreply
977.*---------------------------------------------------------------------*
978:xmp tab=0.
979
980<TC - A declaration/statement/operation is used where it is not supposed to be used - getreply >
981
982<COMPILE>
983<VERDICT_LEAF FAIL>
984<MODULE TTCN x x.ttcn>
985module x {
986
987signature myP1( inout integer my1);
988
989type port portT procedure {
990 inout myP1
991} with {extension "internal"}
992
993type component myComp {
994 port portT myPort;
995}
996
997control {
998
999 myPort.getreply( myP1: 5);
1000}
1001
1002}
1003<END_MODULE>
1004<RESULT IF_FAIL COUNT 1>
1005(?im)\berror\b.+?syntax.+?error.+?unexpected.+?getreply
1006<END_RESULT>
1007<RESULT IF_FAIL COUNT 1>
1008(?is)\berror:
1009<END_RESULT>
1010<END_TC>
1011
1012:exmp.
1013
1014.*---------------------------------------------------------------------*
1015:h4.A declaration/statement/operation is used where it is not supposed to be used - raise
1016.*---------------------------------------------------------------------*
1017:xmp tab=0.
1018
1019<TC - A declaration/statement/operation is used where it is not supposed to be used - raise >
1020
1021<COMPILE>
1022<VERDICT_LEAF FAIL>
1023<MODULE TTCN x x.ttcn>
1024module x {
1025
1026signature myP1( inout integer my1);
1027
1028type port portT procedure {
1029 inout myP1
1030} with {extension "internal"}
1031
1032type component myComp {
1033 port portT myPort;
1034}
1035
1036control {
1037
1038 myPort.raise( myP1, integer:5);
1039}
1040
1041}
1042<END_MODULE>
1043<RESULT IF_FAIL COUNT 1>
1044(?im)\berror\b.+?syntax.+?error.+?unexpected.+?raise
1045<END_RESULT>
1046<RESULT IF_FAIL COUNT 1>
1047(?is)\berror:
1048<END_RESULT>
1049<END_TC>
1050
1051:exmp.
1052
1053.*---------------------------------------------------------------------*
1054:h4.A declaration/statement/operation is used where it is not supposed to be used - catch
1055.*---------------------------------------------------------------------*
1056:xmp tab=0.
1057
1058<TC - A declaration/statement/operation is used where it is not supposed to be used - catch >
1059
1060<COMPILE>
1061<VERDICT_LEAF FAIL>
1062<MODULE TTCN x x.ttcn>
1063module x {
1064
1065signature myP1( inout integer my1) exception( boolean);
1066
1067type port portT procedure {
1068 inout myP1
1069} with {extension "internal"}
1070
1071type component myComp {
1072 port portT myPort;
1073}
1074
1075control {
1076
1077 myPort.catch( myP1, 5>3);
1078}
1079
1080}
1081<END_MODULE>
1082<RESULT IF_FAIL COUNT 1>
1083(?im)\berror\b.+?syntax.+?error.+?unexpected.+?catch
1084<END_RESULT>
1085<RESULT IF_FAIL COUNT 1>
1086(?is)\berror:
1087<END_RESULT>
1088<END_TC>
1089
1090:exmp.
1091
1092.*---------------------------------------------------------------------*
1093:h4.A declaration/statement/operation is used where it is not supposed to be used - check
1094.*---------------------------------------------------------------------*
1095:xmp tab=0.
1096
1097<TC - A declaration/statement/operation is used where it is not supposed to be used - check >
1098
1099<COMPILE>
1100<VERDICT_LEAF FAIL>
1101<MODULE TTCN x x.ttcn>
1102module x {
1103
1104signature myP1( inout integer my1);
1105
1106type port portT procedure {
1107 inout myP1
1108} with {extension "internal"}
1109
1110type component myComp {
1111 port portT myPort;
1112}
1113
1114control {
1115
1116 myPort.check( catch( myP1, 5>3));
1117}
1118
1119}
1120<END_MODULE>
1121<RESULT IF_FAIL COUNT 1>
1122(?im)\berror\b.+?syntax.+?error.+?unexpected.+?check
1123<END_RESULT>
1124<RESULT IF_FAIL COUNT 1>
1125(?is)\berror:
1126<END_RESULT>
1127<END_TC>
1128
1129:exmp.
1130
1131.*---------------------------------------------------------------------*
1132:h4.A declaration/statement/operation is used where it is not supposed to be used - clear
1133.*---------------------------------------------------------------------*
1134:xmp tab=0.
1135
1136<TC - A declaration/statement/operation is used where it is not supposed to be used - clear >
1137
1138<COMPILE>
1139<VERDICT_LEAF FAIL>
1140<MODULE TTCN x x.ttcn>
1141module x {
1142
1143type port portT message {
1144 in integer
1145} with {extension "internal"}
1146
1147type component myComp {
1148 port portT myPort;
1149}
1150
1151control {
1152
1153 myPort.clear;
1154}
1155
1156}
1157<END_MODULE>
1158<RESULT IF_FAIL COUNT 1>
1159(?im)\berror\b.+?syntax.+?error.+?unexpected.+?clear
1160<END_RESULT>
1161<RESULT IF_FAIL COUNT 1>
1162(?is)\berror:
1163<END_RESULT>
1164<END_TC>
1165
1166:exmp.
1167
1168.*---------------------------------------------------------------------*
1169:h4.A declaration/statement/operation is used where it is not supposed to be used - port start
1170.*---------------------------------------------------------------------*
1171:xmp tab=0.
1172
1173<TC - A declaration/statement/operation is used where it is not supposed to be used - port start >
1174
1175<COMPILE>
1176<VERDICT_LEAF PASS>
1177<MODULE TTCN x x.ttcn>
1178module x {
1179
1180type port portT message {
1181 in integer
1182} with {extension "internal"}
1183
1184type component myComp {
1185 port portT myPort;
1186}
1187
1188control {
1189
1190 myPort.start;
1191
1192}
1193
1194}
1195<END_MODULE>
1196<RESULT IF_PASS COUNT 1>
1197(?im)error.+?no.+?local.+?or.+?imported.+?definition
1198<END_RESULT>
1199<RESULT IF_PASS COUNT 1>
1200(?is)\berror:
1201<END_RESULT>
1202<END_TC>
1203
1204:exmp.
1205
1206.*---------------------------------------------------------------------*
1207:h4.A declaration/statement/operation is used where it is not supposed to be used - port stop
1208.*---------------------------------------------------------------------*
1209:xmp tab=0.
1210
1211<TC - A declaration/statement/operation is used where it is not supposed to be used - port stop >
1212
1213<COMPILE>
1214<VERDICT_LEAF PASS>
1215<MODULE TTCN x x.ttcn>
1216module x {
1217
1218type port portT message {
1219 in integer
1220} with {extension "internal"}
1221
1222type component myComp {
1223 port portT myPort;
1224}
1225
1226control {
1227
1228 myPort.stop;
1229
1230}
1231
1232}
1233<END_MODULE>
1234<RESULT IF_PASS COUNT 1>
1235(?im)error.+?no.+?local.+?or.+?imported.+?definition
1236<END_RESULT>
1237<RESULT IF_PASS COUNT 1>
1238(?is)\berror:
1239<END_RESULT>
1240<END_TC>
1241
1242:exmp.
1243
1244.*---------------------------------------------------------------------*
1245:h4.A declaration/statement/operation is used where it is not supposed to be used - setverdict
1246.*---------------------------------------------------------------------*
1247:xmp tab=0.
1248
1249<TC - A declaration/statement/operation is used where it is not supposed to be used - setverdict >
1250
1251<COMPILE>
1252<VERDICT_LEAF FAIL>
1253<MODULE TTCN x x.ttcn>
1254module x {
1255
1256control {
1257
1258 setverdict(pass);
1259}
1260
1261}
1262<END_MODULE>
1263<RESULT IF_FAIL COUNT 1>
1264(?im)\berror\b.+?syntax.+?error.+?unexpected.+?setverdict
1265<END_RESULT>
1266<RESULT IF_FAIL COUNT 1>
1267(?is)\berror:
1268<END_RESULT>
1269<END_TC>
1270
1271:exmp.
1272
1273.*---------------------------------------------------------------------*
1274:h4.A declaration/statement/operation is used where it is not supposed to be used - getverdict
1275.*---------------------------------------------------------------------*
1276:xmp tab=0.
1277
1278<TC - A declaration/statement/operation is used where it is not supposed to be used - getverdict >
1279
1280<COMPILE>
1281<VERDICT_LEAF PASS>
1282<MODULE TTCN x x.ttcn>
1283module x {
1284
1285control {
1286
1287 // TR 685: getverdict in control part
1288 var verdicttype veri:= getverdict;
1289}
1290
1291}
1292<END_MODULE>
1293<RESULT IF_PASS COUNT 1>
1294(?im)error.+?Operation.+?getverdict().+?not.+?allowed.+?in.+?control.+?part
1295<END_RESULT>
1296<RESULT IF_PASS COUNT 1>
1297(?is)\berror:
1298<END_RESULT>
1299<END_TC>
1300
1301:exmp.
1302
1303.*---------------------------------------------------------------------*
1304:h4.A declaration/statement/operation is used where it is not supposed to be used - port
1305.*---------------------------------------------------------------------*
1306:xmp tab=0.
1307
1308<TC - A declaration/statement/operation is used where it is not supposed to be used - port >
1309
1310<COMPILE>
1311<VERDICT_LEAF PASS>
1312<MODULE TTCN x x.ttcn>
1313module x {
1314
1315type port portT message {
1316 in integer
1317} with {extension "internal"}
1318
1319type component comp {
1320 port portT myPort;
1321}
1322
1323control {
1324
1325 timer T1 := 5.0;
1326 T1.start;
1327
1328 alt{
1329 [] T1.timeout{
1330 repeat
1331 }
1332 [] any port.receive{
1333
1334 }
1335 }
1336}
1337
1338}
1339<END_MODULE>
1340<RESULT IF_PASS COUNT 1>
1341(?im)error.+?Port.+?operation.+?not.+?allowed.+?in.+?control.+?part
1342<END_RESULT>
1343<RESULT IF_PASS COUNT 1>
1344(?is)\berror:
1345<END_RESULT>
1346<END_TC>
1347
1348:exmp.
1349
1350.*---------------------------------------------------------------------*
1351:h4.A declaration/statement/operation is used where it is not supposed to be used - component
1352.*---------------------------------------------------------------------*
1353:xmp tab=0.
1354
1355<TC - A declaration/statement/operation is used where it is not supposed to be used - component >
1356
1357<COMPILE>
1358<VERDICT_LEAF PASS>
1359<MODULE TTCN x x.ttcn>
1360module x {
1361
1362type port portT message {
1363 in integer
1364} with {extension "internal"}
1365
1366type component comp {
1367 port portT myPort;
1368}
1369
1370control {
1371
1372 timer T1 := 5.0;
1373 T1.start;
1374
1375 alt{
1376 [] T1.timeout{
1377 repeat
1378 }
1379 [] all component.done{
1380
1381 }
1382 }
1383}
1384
1385}
1386<END_MODULE>
1387<RESULT IF_PASS COUNT 1>
1388(?im)error.+?Component.+?operation.+?not.+?allowed.+?in.+?control.+?part
1389<END_RESULT>
1390<RESULT IF_PASS COUNT 1>
1391(?is)\berror:
1392<END_RESULT>
1393<END_TC>
1394
1395:exmp.
1396
1397.*---------------------------------------------------------------------*
1398:h3.Forward references
1399.*---------------------------------------------------------------------*
1400
1401This test case group covers the requirement SA-7/2.
1402
1403Strategy: Declaration in the module definition part may be made in any order. Howerver inside the module control part, test
1404case definitions, functions and alt steps, all required declarations must be given beforehand. This means in particulat, local
1405variables, local timers, and local constants shall never be used before they are declared. The only exception to this rule
1406are labels.
1407Forward references for local definitions, except variables are allowed within component type.
1408
1409.*---------------------------------------------------------------------*
1410:h4.Forward references - constant (in component type)
1411.*---------------------------------------------------------------------*
1412:xmp tab=0.
1413
1414<TC - Forward references - constant (in component type)>
1415
1416<COMPILE>
1417<VERDICT_LEAF PASS>
1418<MODULE TTCN x x.ttcn>
1419module x {
1420
1421type component myComp {
1422
1423
1424 const integer c1:= c2;
1425 const integer c2:= 5;
1426}
1427
1428}
1429<END_MODULE>
1430<RESULT IF_PASS NEGATIVE>
1431(?is)\berror:
1432<END_RESULT>
1433<END_TC>
1434
1435:exmp.
1436
1437.*---------------------------------------------------------------------*
1438:h4.Forward references - variable (in component type)
1439.*---------------------------------------------------------------------*
1440:xmp tab=0.
1441
1442<TC - Forward references - variable (in component type)>
1443
1444<COMPILE>
1445<VERDICT_LEAF PASS>
1446<MODULE TTCN x x.ttcn>
1447module x {
1448
1449type component myComp {
1450
1451
1452 var integer c1:= c2;
1453 var integer c2:= 5;
1454}
1455
1456}
1457<END_MODULE>
1458<RESULT IF_PASS COUNT 1>
1459(?im)error.+?Reference.+?to.+?static.+?value.+?expected
1460<END_RESULT>
1461<RESULT IF_PASS COUNT 1>
1462(?is)\berror:
1463<END_RESULT>
1464<END_TC>
1465
1466:exmp.
1467
1468.*---------------------------------------------------------------------*
1469:h4.Forward references - variable (in control part)
1470.*---------------------------------------------------------------------*
1471:xmp tab=0.
1472
1473<TC - Forward references - variable (in control part)>
1474
1475<COMPILE>
1476<VERDICT_LEAF PASS>
1477<MODULE TTCN x x.ttcn>
1478module x {
1479
1480control {
1481
1482 var integer i:= c;
1483 var integer c:= 5;
1484}
1485
1486}
1487<END_MODULE>
1488<RESULT IF_PASS COUNT 1>
1489(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition
1490<END_RESULT>
1491<RESULT IF_PASS COUNT 1>
1492(?is)\berror:
1493<END_RESULT>
1494<END_TC>
1495
1496:exmp.
1497
1498.*---------------------------------------------------------------------*
1499:h4.Forward references - constant (in control part)
1500.*---------------------------------------------------------------------*
1501:xmp tab=0.
1502
1503<TC - Forward references - constant (in control part)>
1504
1505<COMPILE>
1506<VERDICT_LEAF PASS>
1507<MODULE TTCN x x.ttcn>
1508module x {
1509
1510control {
1511
1512 const integer i:= c;
1513 const integer c:= 5;
1514}
1515
1516}
1517<END_MODULE>
1518<RESULT IF_PASS COUNT 1>
1519(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition
1520<END_RESULT>
1521<RESULT IF_PASS COUNT 1>
1522(?is)\berror:
1523<END_RESULT>
1524<END_TC>
1525
1526:exmp.
1527
1528.*---------------------------------------------------------------------*
1529:h4.Forward references - timer (in control part)
1530.*---------------------------------------------------------------------*
1531:xmp tab=0.
1532
1533<TC - Forward references - timer (in control part)>
1534
1535<COMPILE>
1536<VERDICT_LEAF PASS>
1537<MODULE TTCN x x.ttcn>
1538module x {
1539
1540control {
1541
1542 timer T1;
1543
1544 T1.start( T2.read)
1545
1546 timer T2:= 6.0;
1547}
1548
1549}
1550<END_MODULE>
1551<RESULT IF_PASS COUNT 1>
1552(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition.+?T2
1553<END_RESULT>
1554<RESULT IF_PASS COUNT 1>
1555(?is)\berror:
1556<END_RESULT>
1557<END_TC>
1558
1559:exmp.
1560
1561.*---------------------------------------------------------------------*
1562:h4.Forward references - variable (in testcase)
1563.*---------------------------------------------------------------------*
1564:xmp tab=0.
1565
1566<TC - Forward references - variable (in testcase)>
1567
1568<COMPILE>
1569<VERDICT_LEAF PASS>
1570<MODULE TTCN x x.ttcn>
1571module x {
1572
1573type component myComp {}
1574
1575testcase myTestCase() runs on myComp{
1576
1577 var integer i:= c;
1578 var integer c:= 5;
1579}
1580
1581}
1582<END_MODULE>
1583<RESULT IF_PASS COUNT 1>
1584(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition
1585<END_RESULT>
1586<RESULT IF_PASS COUNT 1>
1587(?is)\berror:
1588<END_RESULT>
1589<END_TC>
1590
1591:exmp.
1592
1593.*---------------------------------------------------------------------*
1594:h4.Forward references - constant (in testcase)
1595.*---------------------------------------------------------------------*
1596:xmp tab=0.
1597
1598<TC - Forward references - constant (in testcase)>
1599
1600<COMPILE>
1601<VERDICT_LEAF PASS>
1602<MODULE TTCN x x.ttcn>
1603module x {
1604
1605type component myComp {}
1606
1607testcase myTestCase() runs on myComp{
1608
1609 const integer i:= c;
1610 const integer c:= 5;
1611}
1612
1613}
1614<END_MODULE>
1615<RESULT IF_PASS COUNT 1>
1616(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition
1617<END_RESULT>
1618<RESULT IF_PASS COUNT 1>
1619(?is)\berror:
1620<END_RESULT>
1621<END_TC>
1622
1623:exmp.
1624
1625.*---------------------------------------------------------------------*
1626:h4.Forward references - timer (in testcase)
1627.*---------------------------------------------------------------------*
1628:xmp tab=0.
1629
1630<TC - Forward references - timer (in testcase)>
1631
1632<COMPILE>
1633<VERDICT_LEAF PASS>
1634<MODULE TTCN x x.ttcn>
1635module x {
1636
1637type component myComp {}
1638
1639testcase myTestCase() runs on myComp{
1640
1641 timer T1;
1642
1643 T1.start( T2.read)
1644
1645 timer T2:= 6.0;
1646}
1647
1648}
1649<END_MODULE>
1650<RESULT IF_PASS COUNT 1>
1651(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition
1652<END_RESULT>
1653<RESULT IF_PASS COUNT 1>
1654(?is)\berror:
1655<END_RESULT>
1656<END_TC>
1657
1658:exmp.
1659
1660.*---------------------------------------------------------------------*
1661:h4.Forward references - variable (in function)
1662.*---------------------------------------------------------------------*
1663:xmp tab=0.
1664
1665<TC - Forward references - variable (in function)>
1666
1667<COMPILE>
1668<VERDICT_LEAF PASS>
1669<MODULE TTCN x x.ttcn>
1670module x {
1671
1672function myFunct(){
1673
1674 var integer i:= c;
1675 var integer c:= 5;
1676}
1677
1678}
1679<END_MODULE>
1680<RESULT IF_PASS COUNT 1>
1681(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition
1682<END_RESULT>
1683<RESULT IF_PASS COUNT 1>
1684(?is)\berror:
1685<END_RESULT>
1686<END_TC>
1687
1688:exmp.
1689
1690.*---------------------------------------------------------------------*
1691:h4.Forward references - constant (in function)
1692.*---------------------------------------------------------------------*
1693:xmp tab=0.
1694
1695<TC - Forward references - constant (in function)>
1696
1697<COMPILE>
1698<VERDICT_LEAF PASS>
1699<MODULE TTCN x x.ttcn>
1700module x {
1701
1702function myFunct(){
1703
1704 const integer i:= c;
1705 const integer c:= 5;
1706}
1707
1708}
1709<END_MODULE>
1710<RESULT IF_PASS COUNT 1>
1711(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition
1712<END_RESULT>
1713<RESULT IF_PASS COUNT 1>
1714(?is)\berror:
1715<END_RESULT>
1716<END_TC>
1717
1718:exmp.
1719
1720.*---------------------------------------------------------------------*
1721:h4.Forward references - timer (in function)
1722.*---------------------------------------------------------------------*
1723:xmp tab=0.
1724
1725<TC - Forward references - timer (in function)>
1726
1727<COMPILE>
1728<VERDICT_LEAF PASS>
1729<MODULE TTCN x x.ttcn>
1730module x {
1731
1732function myFunct(){
1733
1734 timer T1;
1735
1736 T1.start( T2.read)
1737
1738 timer T2:= 6.0;
1739}
1740
1741}
1742<END_MODULE>
1743<RESULT IF_PASS COUNT 1>
1744(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition
1745<END_RESULT>
1746<RESULT IF_PASS COUNT 1>
1747(?is)\berror:
1748<END_RESULT>
1749<END_TC>
1750
1751:exmp.
1752
1753.*---------------------------------------------------------------------*
1754:h4.Forward references - variable (in altstep)
1755.*---------------------------------------------------------------------*
1756:xmp tab=0.
1757
1758<TC - Forward references - variable (in altstep)>
1759
1760<COMPILE>
1761<VERDICT_LEAF PASS>
1762<MODULE TTCN x x.ttcn>
1763module x {
1764
1765type port portT message {
1766 in integer
1767} with {extension "internal"}
1768
1769type component myComp {
1770 port portT myPort;
1771}
1772
1773altstep myAltStep() runs on myComp{
1774
1775 [] myPort.receive(?){
1776
1777 var integer i:= c;
1778 var integer c:= 5;
1779 }
1780}
1781
1782}
1783<END_MODULE>
1784<RESULT IF_PASS COUNT 1>
1785(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition
1786<END_RESULT>
1787<RESULT IF_PASS COUNT 1>
1788(?is)\berror:
1789<END_RESULT>
1790<END_TC>
1791
1792:exmp.
1793
1794.*---------------------------------------------------------------------*
1795:h4.Forward references - constant (in altstep)
1796.*---------------------------------------------------------------------*
1797:xmp tab=0.
1798
1799<TC - Forward references - constant (in altstep)>
1800
1801<COMPILE>
1802<VERDICT_LEAF PASS>
1803<MODULE TTCN x x.ttcn>
1804module x {
1805
1806type port portT message {
1807 in integer
1808} with {extension "internal"}
1809
1810type component myComp {
1811 port portT myPort;
1812}
1813
1814altstep myAltStep() runs on myComp{
1815
1816 [] myPort.receive(?){
1817
1818 const integer i:= c;
1819 const integer c:= 5;
1820 }
1821}
1822
1823}
1824<END_MODULE>
1825<RESULT IF_PASS COUNT 1>
1826(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition
1827<END_RESULT>
1828<RESULT IF_PASS COUNT 1>
1829(?is)\berror:
1830<END_RESULT>
1831<END_TC>
1832
1833:exmp.
1834
1835.*---------------------------------------------------------------------*
1836:h4.Forward references - timer (in altstep)
1837.*---------------------------------------------------------------------*
1838:xmp tab=0.
1839
1840<TC - Forward references - timer (in altstep)>
1841
1842<COMPILE>
1843<VERDICT_LEAF PASS>
1844<MODULE TTCN x x.ttcn>
1845module x {
1846
1847type port portT message {
1848 in integer
1849} with {extension "internal"}
1850
1851type component myComp {
1852 port portT myPort;
1853}
1854
1855altstep myAltStep() runs on myComp{
1856
1857 [] myPort.receive(?){
1858
1859 timer T1;
1860
1861 T1.start( T2.read)
1862
1863 timer T2:= 6.0;
1864 }
1865}
1866
1867}
1868<END_MODULE>
1869<RESULT IF_PASS COUNT 1>
1870(?im)error.+?There.+?is.+?no.+?local.+?or.+?imported.+?definition
1871<END_RESULT>
1872<RESULT IF_PASS COUNT 1>
1873(?is)\berror:
1874<END_RESULT>
1875<END_TC>
1876
1877:exmp.
1878
1879
1880.*---------------------------------------------------------------------*
1881:h3. A group is used where it is not supposed to be used - record
1882.*---------------------------------------------------------------------*
1883:xmp tab=0.
1884<TC - A group is used where it is not supposed to be used - record>
1885<COMPILE>
1886<VERDICT_LEAF FAIL>
1887<MODULE TTCN ModuleA ModuleA.ttcn>
1888module ModuleA {
1889 type record myrec {
1890 integer i1,
1891 group grp1 {
1892 integer i2
1893 }
1894 charstring c1
1895 }
1896}
1897<END_MODULE>
1898<RESULT IF_FAIL COUNT 1>
1899(?im)\berror\b.+syntax error, unexpected GroupKeyword
1900<END_RESULT>
1901<END_TC>
1902:exmp.
1903
1904.*---------------------------------------------------------------------*
1905:h3. A group is used where it is not supposed to be used - component
1906.*---------------------------------------------------------------------*
1907:xmp tab=0.
1908<TC - A group is used where it is not supposed to be used - component>
1909<COMPILE>
1910<VERDICT_LEAF FAIL>
1911<MODULE TTCN ModuleA ModuleA.ttcn>
1912module ModuleA {
1913 type component comp {
1914 group grp
1915 {
1916 integer i1
1917 }
1918 }
1919}
1920<END_MODULE>
1921<RESULT IF_FAIL COUNT 1>
1922(?im)\berror\b.+syntax error, unexpected GroupKeyword
1923<END_RESULT>
1924<END_TC>
1925:exmp.
1926
1927.*---------------------------------------------------------------------*
1928:h3. A group is used where it is not supposed to be used - port
1929.*---------------------------------------------------------------------*
1930:xmp tab=0.
1931<TC - A group is used where it is not supposed to be used - port>
1932<COMPILE>
1933<VERDICT_LEAF FAIL>
1934<MODULE TTCN ModuleA ModuleA.ttcn>
1935module ModuleA {
1936 type port portT message {
1937 group grp
1938 {
1939 in integer
1940 }
1941 } with {extension "internal"}
1942}
1943<END_MODULE>
1944<RESULT IF_FAIL COUNT 1>
1945(?im)\berror\b.+syntax error, unexpected GroupKeyword
1946<END_RESULT>
1947<END_TC>
1948:exmp.
1949
1950.*---------------------------------------------------------------------*
1951:h3. A group is used where it is not supposed to be used - function
1952.*---------------------------------------------------------------------*
1953:xmp tab=0.
1954<TC - A group is used where it is not supposed to be used - function>
1955<COMPILE>
1956<VERDICT_LEAF FAIL>
1957<MODULE TTCN ModuleA ModuleA.ttcn>
1958module ModuleA {
1959 function f_testfn()
1960 {
1961 group grp
1962 {
1963 var integer i1;
1964 }
1965 }
1966}
1967<END_MODULE>
1968<RESULT IF_FAIL COUNT 1>
1969(?im)\berror\b.+syntax error, unexpected GroupKeyword
1970<END_RESULT>
1971<END_TC>
1972:exmp.
1973
1974.*---------------------------------------------------------------------*
1975:h3. A group is used where it is not supposed to be used - control part
1976.*---------------------------------------------------------------------*
1977:xmp tab=0.
1978<TC - A group is used where it is not supposed to be used - control part>
1979<COMPILE>
1980<VERDICT_LEAF FAIL>
1981<MODULE TTCN ModuleA ModuleA.ttcn>
1982module ModuleA {
1983 control
1984 {
1985 group grp
1986 {
1987 var integer i1;
1988 }
1989 }
1990}
1991<END_MODULE>
1992<RESULT IF_FAIL COUNT 1>
1993(?im)\berror\b.+syntax error, unexpected GroupKeyword
1994<END_RESULT>
1995<END_TC>
1996:exmp.
1997
1998.*---------------------------------------------------------------------*
1999:h3. A group is used where it is not supposed to be used - template
2000.*---------------------------------------------------------------------*
2001:xmp tab=0.
2002<TC - A group is used where it is not supposed to be used - template>
2003<COMPILE>
2004<VERDICT_LEAF FAIL>
2005<MODULE TTCN ModuleA ModuleA.ttcn>
2006module ModuleA {
2007 type record myrec
2008 {
2009 integer i,
2010 charstring c
2011 }
2012 template myrec tmpl :=
2013 {
2014 i := ?,
2015 group grp
2016 {
2017 c := ?
2018 }
2019 }
2020}
2021<END_MODULE>
2022<RESULT IF_FAIL COUNT 1>
2023(?im)\berror\b.+syntax error, unexpected GroupKeyword
2024<END_RESULT>
2025<END_TC>
2026:exmp.
2027
2028.*---------------------------------------------------------------------*
2029:h4.Function reference - derefers used where it is not supposed to be used - function
2030.*---------------------------------------------------------------------*
2031:xmp tab=0.
2032<TC - Function reference - derefers used where it is not supposed to be used - function>
2033<COMPILE>
2034<VERDICT_LEAF FAIL>
2035<MODULE TTCN x x.ttcn>
2036module x {
2037 type function ft();
2038 function f() { }
2039 function ff()
2040 {
2041 var ft vf := refers(f);
2042 derefers(vf)();
2043 }
2044}
2045<END_MODULE>
2046<RESULT IF_FAIL COUNT 1>
2047(?is)\berror:
2048<END_RESULT>
2049<RESULT IF_FAIL POSITIVE>
2050(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2051<END_RESULT>
2052<END_TC>
2053:exmp.
2054
2055.*---------------------------------------------------------------------*
2056:h4.Function reference - derefers used where it is not supposed to be used - testcase
2057.*---------------------------------------------------------------------*
2058:xmp tab=0.
2059<TC - Function reference - derefers used where it is not supposed to be used - testcase>
2060<COMPILE>
2061<VERDICT_LEAF FAIL>
2062<MODULE TTCN x x.ttcn>
2063module x {
2064 type function ft();
2065 function f() { }
2066 type component ct { }
2067 testcase tc() runs on ct
2068 {
2069 var ft vf := refers(f);
2070 derefers(vf)();
2071 }
2072}
2073<END_MODULE>
2074<RESULT IF_FAIL COUNT 1>
2075(?is)\berror:
2076<END_RESULT>
2077<RESULT IF_FAIL POSITIVE>
2078(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2079<END_RESULT>
2080<END_TC>
2081:exmp.
2082
2083.*---------------------------------------------------------------------*
2084:h4.Function reference - refers().apply()
2085.*---------------------------------------------------------------------*
2086:xmp tab=0.
2087<TC - Function reference - refers().apply()>
2088<COMPILE>
2089<VERDICT_LEAF FAIL>
2090<MODULE TTCN x x.ttcn>
2091module x {
2092 type function ft();
2093 function f() { }
2094 type component ct { }
2095 testcase tc() runs on ct
2096 {
2097 refers(f).apply();
2098 }
2099}
2100<END_MODULE>
2101<RESULT IF_FAIL COUNT 1>
2102(?is)\berror:
2103<END_RESULT>
2104<RESULT IF_FAIL POSITIVE>
2105(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
2106<END_RESULT>
2107<END_TC>
2108:exmp.
2109
2110.*---------------------------------------------------------------------*
2111:h4.non-Mandatory parameters - function call used where it is not supposed to be used - function non-mandatory paramter
2112.*---------------------------------------------------------------------*
2113:xmp tab=0.
2114<TC - non-Mandatory parameters - function call used where it is not supposed to be used - function non-mandatory paramter>
2115<COMPILE>
2116<VERDICT_LEAF PASS>
2117<MODULE TTCN x x.ttcn>
2118module x {
2119 function f1(in integer i := f1()) { }
2120 function f2(inout integer i := f1()) {}
2121}
2122<END_MODULE>
2123<RESULT IF_PASS COUNT 2>
2124(?im)\berror\b.+?Reference.+?value.+?expected.+?instead.+?function
2125<END_RESULT>
2126<RESULT IF_PASS COUNT 2>
2127(?is)\berror:
2128<END_RESULT>
2129<END_TC>
2130:exmp.
2131
2132.*---------------------------------------------------------------------*
2133:h4.non-Mandatory parameters - function call used where it is not supposed to be used - testcase non-mandatory paramter
2134.*---------------------------------------------------------------------*
2135:xmp tab=0.
2136<TC - non-Mandatory parameters - function call used where it is not supposed to be used - testcase non-mandatory paramter>
2137<COMPILE>
2138<VERDICT_LEAF PASS>
2139<MODULE TTCN x x.ttcn>
2140module x {
2141 type component ct { }
2142 function f(){}
2143 testcase f1(in integer i := f()) runs on ct{ }
2144 testcase f2(inout integer i := f()) runs on ct{}
2145}
2146<END_MODULE>
2147<RESULT IF_PASS COUNT 2>
2148(?im)\berror\b.+?Reference.+?value.+?expected.+?instead.+?function
2149<END_RESULT>
2150<RESULT IF_PASS COUNT 2>
2151(?is)\berror:
2152<END_RESULT>
2153<END_TC>
2154:exmp.
2155
2156.*---------------------------------------------------------------------*
2157:h3.Misplaced local variable, constant, timer declaration in statement block
2158.*---------------------------------------------------------------------*
2159
2160This test case group covers the requirement SA-7/3.
2161
2162Strategy: All local variable, constant or timer declaration must stay in the beginning of the statement block.
2163
2164NOTE: In TITAN this opportunity is a feature, so we won't negative test it.
2165
2166.*---------------------------------------------------------------------*
2167:h1.Abbreviations
2168.*---------------------------------------------------------------------*
2169:list.
2170:li D='ASN.1'.Abstract Syntax Notation 1
2171:li D='EDML'.Ericsson Document Markup Language
2172:li D='SA'.Semantic Analyser
2173:li D='TTCN-3'.Test and Test Control Notation version 3
2174:elist.
2175
2176.*---------------------------------------------------------------------*
2177:h1.References
2178.*---------------------------------------------------------------------*
2179:list.
2180:li D='[1]'.3/ETH/RUS-2003:0087 Uen
2181:nl.Requirement Specification for TITAN's TTCN-3 Semantic Analyser
2182:li D='[2]'.1/174 02-FCPCA 101 22 Uen
2183:nl.Statement of Compliance for TITAN project
2184:li D='[3]'.ETSI ES 201 873-1, v3.0.0 Mockup v1 (2004-03):
2185:nl.Testing and Test Control Notation version 3.,
2186:nl.Part 1: TTCN-3 Core Language
2187:elist.
2188
2189.*---------------------------------------------------------------------*
2190:h1.Terminology
2191.*---------------------------------------------------------------------*
2192:list.
2193:li D='TITAN'.Ericsson's TTCN-3 Test Environment
2194:elist.
2195
2196:etext.
This page took 0.100798 seconds and 5 git commands to generate.