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