Commit | Line | Data |
---|---|---|
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.xx/152 91-CRL 113 200/5 Uen |
970ed795 | 18 | :rev.A |
a38c6d4c | 19 | :date.2015-04-27 |
970ed795 | 20 | |
a38c6d4c | 21 | :prep.ETH/XZ Jeno Balasko |
970ed795 EL |
22 | :appr.ETH/XZ (Gyula Koos) |
23 | :checked.ETHGRY | |
24 | ||
25 | :title.Test description of the TTCN-3 Semantic Analyzer: Other requirements | |
26 | :contents level=2. | |
27 | .*---------------------------------------------------------------------* | |
28 | :h1.Introduction | |
29 | .*---------------------------------------------------------------------* | |
30 | .*---------------------------------------------------------------------* | |
31 | :h2.Revision history | |
32 | .*---------------------------------------------------------------------* | |
33 | :xmp tab=2. | |
34 | REV DATE PREPARED CHANGE | |
35 | __________________________________________________ | |
36 | PA1 2005-02-19 ETHGASZ New document for TITAN R6 | |
37 | A 2005-03-18 ETHGASZ Approved after review | |
38 | B 2005-08-16 ETIBHRA New req. added (SA-9/18,19,20) | |
39 | C 2007-03-06 EJNOSZA Updates for TITAN R7A (expected error messages for identifier overloading) | |
40 | D 2007-06-08 EJNOSZA Updates for TITAN R7B (expected error messages for identifier overloading) | |
41 | E 2008-10-01 EKRISZA Updates for TITAN R7E | |
42 | F 2010-01-18 EKRISZA Updated for TITAN R8C | |
43 | K 2011-10-10 EKRISZA Updated for TITAN R8H | |
a38c6d4c | 44 | A 2011-12-12 EKRISZA Updated for release |
45 | A 2012-06-27 EFERKOV Updated for release | |
46 | A 2013-01-17 EKRIPND Updated for release | |
47 | A 2015-04-27 ETHBAAT Updated for release | |
970ed795 EL |
48 | :exmp. |
49 | ||
50 | .*---------------------------------------------------------------------* | |
51 | :h2.Purpose | |
52 | .*---------------------------------------------------------------------* | |
53 | The purpose of this Test Description is to define and describe the function | |
54 | test activity for the Semantic Analyser functionality of the TTCN-3 compiler: | |
55 | :nl.SA-9/x: Other requirements. | |
56 | :p.The specification of the test cases can be found in this document. | |
57 | .*---------------------------------------------------------------------* | |
58 | :h1.Test environment | |
59 | .*---------------------------------------------------------------------* | |
60 | .*---------------------------------------------------------------------* | |
61 | :h2.Hardware | |
62 | .*---------------------------------------------------------------------* | |
63 | No specific hardware requirement. | |
64 | .*---------------------------------------------------------------------* | |
65 | :h2.Software | |
66 | .*---------------------------------------------------------------------* | |
67 | Tests shall be carried out on the following platforms: | |
68 | :list. | |
69 | :li D='1.'.Solaris 8 (Sun OS 5.8) (gcc 3.0.4) | |
70 | :li D='2.'.SUSE Linux Enterprise server 8 (2.4.19-4GB) (gcc 3.2) | |
71 | :li D='3.'.CYGWIN_NT-5.0 (Cygwin DLL: 1.5.12) on Windows 2000 (gcc 3.3.3) | |
72 | :elist. | |
73 | .*---------------------------------------------------------------------* | |
74 | :h2.Configuration | |
75 | .*---------------------------------------------------------------------* | |
76 | The test environment had been setup in CVS. The tester program is stored in: | |
77 | :nl.TTCNv3/function_test/Tools/SAtester.pl | |
78 | :nl.Test cases are stored with extension .script in the directory: | |
79 | :nl.TTCNv3/function_test/Semantic_Analyser/ | |
80 | .*---------------------------------------------------------------------* | |
81 | :h2.Installation | |
82 | .*---------------------------------------------------------------------* | |
83 | Install proper TITAN binaries on the used platforms and make sure that | |
84 | your environment settings are correct: | |
85 | :list. | |
86 | :li D='1.'.TTCN3_DIR is set | |
87 | :li D='2.'.$TTCN3_DIR/bin is added to the PATH variable | |
88 | :li D='3.'.$TTCN3_DIR/lib is added to the LD_LIBRARY_PATH variable | |
89 | :li D='4.'.Perl 5.6.0 or higher is available on the platform | |
90 | :li D='5.'.Create a symlink to your Perl binary into the directory where the | |
91 | test cases are stored: | |
92 | :nl.ln -s <your Perl> perl | |
93 | :elist. | |
94 | .*---------------------------------------------------------------------* | |
95 | :h2.Test Tools | |
96 | .*---------------------------------------------------------------------* | |
97 | A tester program had been written in Perl especially for the Semantic Analyser | |
98 | tests. For the list of command line parameters, type 'SAtester.pl -help', for the | |
99 | complete documentation, type 'SAtester.pl -doc'. | |
100 | :p.Test cases are specified in the Test Description documents in EDML format. | |
101 | The tester program parses these files and generates the TTCN-3/ASN.1 modules, then | |
102 | calls the compiler to compile them. The result printout is then matched against | |
103 | different patterns to be able to set the verdict. Test cases contain not only | |
104 | the source modules, but the patterns as well. | |
105 | :p.The tester program allows one-by-one execution of test cases and batched | |
106 | execution as well. | |
107 | :p.NOTE: the tester program requires Perl 5.6.0 or higher. | |
108 | .*---------------------------------------------------------------------* | |
109 | :h2.Test cases | |
110 | .*---------------------------------------------------------------------* | |
111 | .*---------------------------------------------------------------------* | |
112 | :h3.Module Parameters->Redeclaration of a module parameter SA-9/1 | |
113 | .*---------------------------------------------------------------------* | |
114 | Requirement: Redeclaration of a module parameter. | |
115 | :nl.Explanation: | |
116 | :nl.Redefinition of the module parameter is not allowed. | |
117 | :nl. | |
118 | .*---------------------------------------------------------------------* | |
119 | :h4.Module Parameters->Redeclaration of a module parameter with a different type | |
120 | .*---------------------------------------------------------------------* | |
121 | :xmp tab=0. | |
122 | <TC - Module Parameters->Redeclaration of a module parameter with a different type> | |
123 | ||
124 | <COMPILE> | |
125 | <VERDICT_LEAF PASS> | |
126 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
127 | module ModuleA { | |
128 | modulepar { | |
129 | integer MyTSP1; | |
130 | integer MyTSP2 := 10; | |
131 | boolean MyTSP1 := false; | |
132 | boolean MyTSP2 | |
133 | } | |
134 | } | |
135 | <END_MODULE> | |
136 | <RESULT IF_PASS COUNT 2> | |
137 | (?im)\berror\b.+?duplicate.+?definition.+?MyTSP | |
138 | <END_RESULT> | |
139 | <RESULT IF_PASS COUNT 2> | |
140 | (?im)\bnote\b.+?previous.+?definition | |
141 | <END_RESULT> | |
142 | <RESULT IF_PASS COUNT 2> | |
143 | (?is)\berror: | |
144 | <END_RESULT> | |
145 | <RESULT IF_PASS POSITIVE> | |
146 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
147 | <END_RESULT> | |
148 | <END_TC> | |
149 | :exmp. | |
150 | .*---------------------------------------------------------------------* | |
151 | :h4.Module Parameters->Redeclaration of a module parameter in a different group | |
152 | .*---------------------------------------------------------------------* | |
153 | :xmp tab=0. | |
154 | ||
155 | <TC - Module Parameters->Redeclaration of a module parameter in a different group> | |
156 | ||
157 | <COMPILE> | |
158 | <VERDICT_LEAF PASS> | |
159 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
160 | module ModuleA { | |
161 | modulepar { | |
162 | integer MyTSP1; | |
163 | integer MyTSP2 := 10; | |
164 | } | |
165 | modulepar { | |
166 | boolean MyTSP1 := false; | |
167 | boolean MyTSP2 | |
168 | } | |
169 | } | |
170 | <END_MODULE> | |
171 | <RESULT IF_PASS COUNT 2> | |
172 | (?im)\berror\b.+?duplicate.+?definition.+?MyTSP | |
173 | <END_RESULT> | |
174 | <RESULT IF_PASS COUNT 2> | |
175 | (?im)\bnote\b.+?previous.+?definition | |
176 | <END_RESULT> | |
177 | <RESULT IF_PASS COUNT 2> | |
178 | (?is)\berror: | |
179 | <END_RESULT> | |
180 | <RESULT IF_PASS POSITIVE> | |
181 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
182 | <END_RESULT> | |
183 | <END_TC> | |
184 | ||
185 | :exmp. | |
186 | .*---------------------------------------------------------------------* | |
187 | :h3.Signatures->Duplicate exception type in a signature SA-9/2 | |
188 | .*---------------------------------------------------------------------* | |
189 | Requirement: Duplicate exception type in a signature. | |
190 | :nl.Explanation: | |
191 | :nl.One or more exception type is listed in a signature more than once. | |
192 | .*---------------------------------------------------------------------* | |
193 | :h4.Signatures->Duplicate exception type in a signature | |
194 | .*---------------------------------------------------------------------* | |
195 | :xmp tab=0. | |
196 | ||
197 | <TC - Signatures->Duplicate exception type in a signature> | |
198 | ||
199 | <COMPILE> | |
200 | <VERDICT_LEAF PASS> | |
201 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
202 | module ModuleA { | |
203 | signature s() noblock | |
204 | exception ( | |
205 | bitstring, boolean, charstring, universal charstring, | |
206 | integer, octetstring, objid, hexstring, verdicttype, float, | |
207 | bitstring, boolean, charstring, universal charstring, | |
208 | integer, octetstring, objid, hexstring, verdicttype, float); | |
209 | } | |
210 | <END_MODULE> | |
211 | <RESULT IF_PASS COUNT 10> | |
212 | (?im)\berror\b.+?duplicate.+?type | |
213 | <END_RESULT> | |
214 | <RESULT IF_PASS COUNT 10> | |
215 | (?im)\bnote\b.+?already.+?here | |
216 | <END_RESULT> | |
217 | <RESULT IF_PASS COUNT 10> | |
218 | (?is)\berror: | |
219 | <END_RESULT> | |
220 | <RESULT IF_PASS POSITIVE> | |
221 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
222 | <END_RESULT> | |
223 | <END_TC> | |
224 | ||
225 | :exmp. | |
226 | ||
227 | .*---------------------------------------------------------------------* | |
228 | :h3.Signatures-> 'all' shall not be mixed with additional names SA-9/2 | |
229 | .*---------------------------------------------------------------------* | |
230 | Requirement: 'all' shall not be mixed with additional names in one list. | |
231 | :nl.Explanation: | |
232 | :nl.Becasue the 'all' is not supported currently, it can not be tested. | |
233 | .*---------------------------------------------------------------------* | |
234 | :h3.Import-> Duplicated module reference in import statements SA-9/3 | |
235 | .*---------------------------------------------------------------------* | |
236 | Requirement: Duplicated module reference in import statements. | |
237 | :nl.Explanation: | |
238 | :nl.A module name is listed more than once to import from. | |
239 | .*---------------------------------------------------------------------* | |
240 | :h4.Import->Duplicated module reference in import statements | |
241 | .*---------------------------------------------------------------------* | |
242 | :xmp tab=0. | |
243 | ||
244 | <TC - Import->Duplicated module reference in import statements> | |
245 | ||
246 | <COMPILE> | |
247 | <VERDICT_LEAF PASS> | |
248 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
249 | module ModuleA { | |
250 | import from ModuleB all; | |
251 | import from ModuleB all; | |
252 | } | |
253 | <END_MODULE> | |
254 | <MODULE TTCN ModuleB ModuleB.ttcn> | |
255 | module ModuleB { | |
256 | type integer Myint; | |
257 | } | |
258 | <END_MODULE> | |
259 | <RESULT IF_PASS NEGATIVE> | |
260 | (?is)\berror: | |
261 | <END_RESULT> | |
262 | <RESULT IF_PASS POSITIVE> | |
263 | (?im)Notify: File `ModuleA.hh' was generated. | |
264 | <END_RESULT> | |
265 | <END_TC> | |
266 | ||
267 | :exmp. | |
268 | .*---------------------------------------------------------------------* | |
269 | :h3.No signatures in the test suite when using 'all' in port definition SA-9/4 | |
270 | .*---------------------------------------------------------------------* | |
271 | Requirement: No signatures in the test suite when using 'all' in port | |
272 | definition. | |
273 | :nl.Explanation:Using the all keyword in one of the lists associated to a | |
274 | :nl.port type allows all of signatures defined in the module to be | |
275 | :nl.received and sent over port. SA shall detect the cases when no | |
276 | :nl.signatures are defined in the test suite, but receive-like port | |
277 | :nl.operations (e.g. getcall, getreply, catch) are used. | |
278 | :nl.NOTE:Because the 'all' is not supported currently, it can not be tested. | |
279 | :nl.NOTE:TR698 | |
280 | .*---------------------------------------------------------------------* | |
281 | :h4.No signatures in the test suite when using 'all' in port definition | |
282 | .*---------------------------------------------------------------------* | |
283 | :xmp tab=0. | |
284 | <TC - No signatures in the test suite when using 'all' in port definition> | |
285 | ||
286 | <COMPILE> | |
287 | <VERDICT_LEAF PASS> | |
288 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
289 | module ModuleA { | |
290 | type port MyPortType1 procedure { inout all} | |
291 | type component MyComp { | |
292 | port MyPortType1 MyPort1; | |
293 | } | |
294 | } | |
295 | <END_MODULE> | |
296 | <RESULT IF_FAIL COUNT 1> | |
297 | (?is)\berror: | |
298 | <END_RESULT> | |
299 | <RESULT IF_FAIL POSITIVE> | |
300 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
301 | <END_RESULT> | |
302 | <END_TC> | |
303 | ||
304 | :exmp. | |
305 | .*---------------------------------------------------------------------* | |
306 | :h3.Communication operations->Port operation when no ports defined 9/5 | |
307 | .*---------------------------------------------------------------------* | |
308 | Requirement: Port operation when no ports defined. | |
309 | :nl.Explanation: | |
310 | :nl.Port operations on a component that has no ports defined shall be | |
311 | :nl.detected. | |
312 | .*---------------------------------------------------------------------* | |
313 | :h4.Communication operations->Port operation when no ports defined | |
314 | .*---------------------------------------------------------------------* | |
315 | :xmp tab=0. | |
316 | <TC - Communication operations->Port operation when no ports defined> | |
317 | ||
318 | <COMPILEGCC> | |
319 | <VERDICT_LEAF PASS> | |
320 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
321 | module ModuleA { | |
322 | signature MySig() noblock; | |
323 | type component MyComp { | |
324 | var integer MyVar; | |
325 | var MyComp MyWar1; | |
326 | } | |
327 | // TR 699: Port and timer operation when no ports or timer defined | |
328 | altstep MyAltstep() runs on MyComp { | |
329 | [] any port.receive { setverdict(fail); } | |
330 | [] any port.trigger { setverdict(fail); } | |
331 | [] any port.getcall { setverdict(fail); } | |
332 | [] any port.getreply { setverdict(fail); } | |
333 | [] any port.catch { setverdict(fail); } | |
334 | [] any port.check(-> sender MyWar1) { setverdict(fail); } | |
335 | [] any port.check(receive) { setverdict(fail); } | |
336 | [] any port.check(getcall) { setverdict(fail); } | |
337 | [] any port.check(getreply) { setverdict(fail); } | |
338 | [] any port.check(catch) { setverdict(fail); } | |
339 | [else] { | |
340 | all port.stop; | |
341 | all port.start; | |
342 | all port.clear; | |
343 | all timer.stop; | |
344 | } | |
345 | } | |
346 | } | |
347 | <END_MODULE> | |
348 | <RESULT IF_FAIL COUNT 1> | |
349 | (?is)\berror: | |
350 | <END_RESULT> | |
351 | <RESULT IF_FAIL POSITIVE> | |
352 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
353 | <END_RESULT> | |
354 | <END_TC> | |
355 | ||
356 | :exmp. | |
357 | .*---------------------------------------------------------------------* | |
358 | :h3.Timer operations when no timers defined SA-9/6 | |
359 | .*---------------------------------------------------------------------* | |
360 | Requirement: Timer operations when no timers defined. | |
361 | :nl.Explanation: | |
362 | :nl.Timer operations shall be handled correctly if no timers are defined. | |
363 | .*---------------------------------------------------------------------* | |
364 | :h4.Timer operations when no timers defined | |
365 | .*---------------------------------------------------------------------* | |
366 | :xmp tab=0. | |
367 | ||
368 | <TC - Timer operations when no timers defined> | |
369 | ||
370 | <COMPILEGCC> | |
371 | <VERDICT_LEAF PASS> | |
372 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
373 | module ModuleA { | |
374 | type component MyComp {} | |
375 | function MyFunc1() runs on MyComp { | |
376 | // valid | |
377 | all timer.stop; | |
378 | // TR 699: Port and timer operation when no ports or timer defined | |
379 | // would block forever | |
380 | any timer.timeout; | |
381 | if (any timer.running) { setverdict(fail); } | |
382 | else { setverdict(pass); } | |
383 | } | |
384 | testcase MyTC() runs on MyComp { | |
385 | MyFunc1(); | |
386 | } | |
387 | } | |
388 | <END_MODULE> | |
389 | <RESULT IF_FAIL COUNT 3> | |
390 | (?is)\berror: | |
391 | <END_RESULT> | |
392 | <RESULT IF_FAIL POSITIVE> | |
393 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
394 | <END_RESULT> | |
395 | <END_TC> | |
396 | ||
397 | :exmp. | |
398 | ||
399 | .*---------------------------------------------------------------------* | |
400 | :h3.Import-> Import from the same module SA-9/7 | |
401 | .*---------------------------------------------------------------------* | |
402 | Requirement: Import from the same module. | |
403 | :nl.Explanation: | |
404 | :nl.A module cannot import from itself. | |
405 | .*---------------------------------------------------------------------* | |
406 | :h4.Import->Import from the same module | |
407 | .*---------------------------------------------------------------------* | |
408 | :xmp tab=0. | |
409 | ||
410 | <TC - Import->Import from the same module> | |
411 | ||
412 | <COMPILE> | |
413 | <VERDICT_LEAF PASS> | |
414 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
415 | module ModuleA { | |
416 | import from ModuleA all; | |
417 | } | |
418 | <END_MODULE> | |
419 | <RESULT IF_PASS COUNT 1> | |
420 | (?im)\berror\b.+?\bimport\b.+?\bitself\b | |
421 | <END_RESULT> | |
422 | <END_RESULT> | |
423 | <RESULT IF_PASS COUNT 1> | |
424 | (?is)\berror: | |
425 | <END_RESULT> | |
426 | <RESULT IF_PASS POSITIVE> | |
427 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
428 | <END_RESULT> | |
429 | <END_TC> | |
430 | ||
431 | :exmp. | |
432 | ||
433 | .*---------------------------------------------------------------------* | |
434 | :h3.Functions->Return value SA-9/8 | |
435 | .*---------------------------------------------------------------------* | |
436 | Requirement: Functions->Return value. | |
437 | :nl.Explanation: | |
438 | :nl.The keyword return, when used in the body of the function with a | |
439 | :nl.return type defined in its header, always shall be followed by a value, | |
440 | :nl.a constant or variable reference or an expression presenting the return | |
441 | :nl.value. | |
442 | .*---------------------------------------------------------------------* | |
443 | :h4.Functions->Return value if no return type defined | |
444 | .*---------------------------------------------------------------------* | |
445 | :xmp tab=0. | |
446 | <TC - Functions->Return value if no return type defined> | |
447 | ||
448 | <COMPILE> | |
449 | <VERDICT_LEAF PASS> | |
450 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
451 | module ModuleA { | |
452 | // no return value, but try to return an actual value | |
453 | // catched by the parser curently | |
454 | function MyFunc1() { if(true) {return '11A7'O;}} | |
455 | } | |
456 | <END_MODULE> | |
457 | <RESULT IF_PASS COUNT 1> | |
458 | (?im)\berror\b.+?function.+?not.+?have.+?return.+?type | |
459 | <END_RESULT> | |
460 | <RESULT IF_PASS COUNT 1> | |
461 | (?is)\berror: | |
462 | <END_RESULT> | |
463 | <RESULT IF_PASS POSITIVE> | |
464 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
465 | <END_RESULT> | |
466 | <END_TC> | |
467 | :exmp. | |
468 | .*---------------------------------------------------------------------* | |
469 | :h4.Functions->Missing return value, but return type defined | |
470 | .*---------------------------------------------------------------------* | |
471 | :xmp tab=0. | |
472 | <TC - Functions->Missing return value, but return type defined> | |
473 | ||
474 | <COMPILE> | |
475 | <VERDICT_LEAF PASS> | |
476 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
477 | module ModuleA { | |
478 | // missing return value | |
479 | // catched by the parser | |
480 | function MyFunc1() return float {if(true) {return;}} | |
481 | } | |
482 | <END_MODULE> | |
483 | <RESULT IF_PASS COUNT 1> | |
484 | (?im)\berror\b.+?missing.+?return.+?value | |
485 | <END_RESULT> | |
486 | <RESULT IF_PASS COUNT 1> | |
487 | (?is)\berror.+?control.+?might.+?leave.+?without.+?reaching.+?return.+?statement | |
488 | <END_RESULT> | |
489 | <RESULT IF_PASS POSITIVE> | |
490 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
491 | <END_RESULT> | |
492 | <END_TC> | |
493 | :exmp. | |
494 | .*---------------------------------------------------------------------* | |
495 | :h4.Functions->Missing return value, but return type defined indirect case 1 | |
496 | .*---------------------------------------------------------------------* | |
497 | :xmp tab=0. | |
498 | ||
499 | <TC - Functions->Missing return value, but return type defined indirect case 1> | |
500 | ||
501 | <COMPILE> | |
502 | <VERDICT_LEAF PASS> | |
503 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
504 | module ModuleA { | |
505 | function MyFunc1() {return;} | |
506 | function MyFunc2(integer par) return integer {return (par + 10);} | |
507 | function MyFunc3() return float { | |
508 | if(true) {return MyFunc1();} | |
509 | } | |
510 | } | |
511 | <END_MODULE> | |
512 | <RESULT IF_PASS COUNT 1> | |
513 | (?is)\berror.+?control.+?might.+?leave.+?without.+?reaching.+?return.+?statement | |
514 | <END_RESULT> | |
515 | <RESULT IF_PASS COUNT 1> | |
516 | (?is)\bexpected\b.+?\bfunction\b | |
517 | <END_RESULT> | |
518 | <RESULT IF_PASS POSITIVE> | |
519 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
520 | <END_RESULT> | |
521 | <END_TC> | |
522 | :exmp. | |
523 | .*---------------------------------------------------------------------* | |
524 | :h4.Functions->Missing return value, but return type defined indirect case 2 | |
525 | .*---------------------------------------------------------------------* | |
526 | :xmp tab=0. | |
527 | ||
528 | <TC - Functions->Missing return value, but return type defined indirect case 2> | |
529 | ||
530 | <COMPILE> | |
531 | <VERDICT_LEAF PASS> | |
532 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
533 | module ModuleA { | |
534 | function MyFunc1() {return;} | |
535 | function MyFunc2(integer par) return integer {return (par + 10);} | |
536 | function MyFunc4() return float { | |
537 | if(true) {return int2float( MyFunc2(MyFunc1() ));} | |
538 | } | |
539 | } | |
540 | <END_MODULE> | |
541 | <RESULT IF_PASS COUNT 1> | |
542 | (?is)\berror.+?control.+?might.+?leave.+?without.+?reaching.+?return.+?statement | |
543 | <END_RESULT> | |
544 | <RESULT IF_PASS COUNT 1> | |
545 | (?is)\bexpected\b.+?\bfunction\b | |
546 | <END_RESULT> | |
547 | <RESULT IF_PASS POSITIVE> | |
548 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
549 | <END_RESULT> | |
550 | <END_TC> | |
551 | ||
552 | :exmp. | |
553 | .*---------------------------------------------------------------------* | |
554 | :h4.Functions->Missing return value, but return type defined indirect case 3 | |
555 | .*---------------------------------------------------------------------* | |
556 | :xmp tab=0. | |
557 | <TC - Functions->Missing return value, but return type defined indirect case 3> | |
558 | ||
559 | <COMPILE> | |
560 | <VERDICT_LEAF PASS> | |
561 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
562 | module ModuleA { | |
563 | function MyFunc1() {return;} | |
564 | control { | |
565 | // void return value is not allowed in expression | |
566 | var integer MyVar := 666 + MyFunc1() - 666; | |
567 | } | |
568 | } | |
569 | <END_MODULE> | |
570 | <RESULT IF_PASS COUNT 1> | |
571 | (?is)\berror: | |
572 | <END_RESULT> | |
573 | <RESULT IF_PASS COUNT 1> | |
574 | (?is)\bexpected\b.+?\bfunction\b | |
575 | <END_RESULT> | |
576 | <RESULT IF_PASS POSITIVE> | |
577 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
578 | <END_RESULT> | |
579 | <END_TC> | |
580 | ||
581 | :exmp. | |
582 | .*---------------------------------------------------------------------* | |
583 | :h3.Functions->runs on clause SA-9/9 | |
584 | .*---------------------------------------------------------------------* | |
585 | Requirement: Functions->runs on clause. | |
586 | :nl.Explanation: | |
587 | :nl.A function without runs on clause shall never invoke a function or | |
588 | :nl.altstep or activate an altstep as default with a runs on clause locally. | |
589 | :nl.Functions started by using the start test component operation shall | |
590 | :nl.always have a runs on clause. | |
591 | :nl.Functions used in the control part of a TTCN-3 module shall have no | |
592 | :nl.runs on clause. | |
593 | .*---------------------------------------------------------------------* | |
594 | :h4.Functions->runs on clause, referencing to a functions with runs on | |
595 | .*---------------------------------------------------------------------* | |
596 | :xmp tab=0. | |
597 | ||
598 | <TC - Functions->runs on clause, referencing to a functions with runs on> | |
599 | ||
600 | <COMPILE> | |
601 | <VERDICT_LEAF PASS> | |
602 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
603 | module ModuleA { | |
604 | type port MyPortType message { inout integer } | |
605 | type component MyComp { port MyPortType MyPort } | |
606 | function MyFunc_comp() runs on MyComp {return;} | |
607 | function NastyFunc01() { | |
608 | if (true) { MyFunc_comp(); } | |
609 | } | |
610 | } | |
611 | <END_MODULE> | |
612 | <RESULT IF_PASS COUNT 1> | |
613 | (?is)\berror: | |
614 | <END_RESULT> | |
615 | <RESULT IF_PASS COUNT 1> | |
616 | (?is)\bcannot\b.+?\bcall\b | |
617 | <END_RESULT> | |
618 | <RESULT IF_PASS POSITIVE> | |
619 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
620 | <END_RESULT> | |
621 | <END_TC> | |
622 | ||
623 | :exmp. | |
624 | .*---------------------------------------------------------------------* | |
625 | :h4.Functions->runs on clause, referencing to an altstep with runs on | |
626 | .*---------------------------------------------------------------------* | |
627 | :xmp tab=0. | |
628 | <TC - Functions->runs on clause, referencing to an altstep with runs on> | |
629 | ||
630 | <COMPILE> | |
631 | <VERDICT_LEAF PASS> | |
632 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
633 | module ModuleA { | |
634 | type port MyPortType message { inout integer } | |
635 | type component MyComp { port MyPortType MyPort } | |
636 | altstep MyAltstep_comp() runs on MyComp { [] MyPort.trigger {} } | |
637 | function NastyFunc02(inout MyPortType loc_port) { | |
638 | if (true) { | |
639 | alt { | |
640 | [] loc_port.trigger {} | |
641 | [] MyAltstep_comp(); | |
642 | } | |
643 | } | |
644 | } | |
645 | } | |
646 | <END_MODULE> | |
647 | <RESULT IF_PASS COUNT 1> | |
648 | (?is)\berror: | |
649 | <END_RESULT> | |
650 | <RESULT IF_PASS COUNT 1> | |
651 | (?is)\bcannot\b.+?\bcall\b | |
652 | <END_RESULT> | |
653 | <RESULT IF_PASS POSITIVE> | |
654 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
655 | <END_RESULT> | |
656 | <END_TC> | |
657 | :exmp. | |
658 | .*---------------------------------------------------------------------* | |
659 | :h4.Functions->runs on clause, referencing to a func with runs on,indirect call | |
660 | .*---------------------------------------------------------------------* | |
661 | :xmp tab=0. | |
662 | ||
663 | <TC - Functions->runs on clause, referencing to a func with runs on,indirect call> | |
664 | ||
665 | <COMPILE> | |
666 | <VERDICT_LEAF PASS> | |
667 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
668 | module ModuleA { | |
669 | type port MyPortType message { inout integer } | |
670 | type component MyComp { port MyPortType MyPort } | |
671 | function MyFunc_comp2() runs on MyComp return integer {return 0;} | |
672 | function MyCoolFunction1 (integer par) return integer {return par;} | |
673 | function NastyFunc03() return float { | |
674 | if (true) { return int2float( MyCoolFunction1(MyFunc_comp2()) ); } | |
675 | } | |
676 | } | |
677 | <END_MODULE> | |
678 | <RESULT IF_PASS COUNT 1> | |
679 | (?is)\berror.+?control.+?might.+?leave.+?without.+?reaching.+?return.+?statement | |
680 | <END_RESULT> | |
681 | <RESULT IF_PASS COUNT 1> | |
682 | (?is)\bcannot\b.+?\bcall\b | |
683 | <END_RESULT> | |
684 | <RESULT IF_PASS POSITIVE> | |
685 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
686 | <END_RESULT> | |
687 | <END_TC> | |
688 | :exmp. | |
689 | .*---------------------------------------------------------------------* | |
690 | :h4.Functions->runs on clause, default activation/deactivation | |
691 | .*---------------------------------------------------------------------* | |
692 | :xmp tab=0. | |
693 | ||
694 | <TC - Functions->runs on clause, default activation/deactivation> | |
695 | ||
696 | <COMPILE> | |
697 | <VERDICT_LEAF PASS> | |
698 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
699 | module ModuleA { | |
700 | type port MyPortType message { inout integer } | |
701 | type component MyComp { port MyPortType MyPort } | |
702 | altstep MyAltstep_comp() runs on MyComp { [] MyPort.trigger {} } | |
703 | function NastyFunc04() { | |
704 | var default MyDef := activate(MyAltstep_comp()); | |
705 | deactivate(MyDef); | |
706 | } | |
707 | } | |
708 | <END_MODULE> | |
709 | <RESULT IF_PASS COUNT 1> | |
710 | (?is)\berror: | |
711 | <END_RESULT> | |
712 | <RESULT IF_PASS COUNT 1> | |
713 | (?is)\bcannot\b.+?\bactivate\b | |
714 | <END_RESULT> | |
715 | <RESULT IF_PASS POSITIVE> | |
716 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
717 | <END_RESULT> | |
718 | <END_TC> | |
719 | :exmp. | |
720 | .*---------------------------------------------------------------------* | |
721 | :h4.Functions->runs on clause, start operations | |
722 | .*---------------------------------------------------------------------* | |
723 | :xmp tab=0. | |
724 | ||
725 | <TC - Functions->runs on clause, start operations> | |
726 | ||
727 | <COMPILE> | |
728 | <VERDICT_LEAF PASS> | |
729 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
730 | module ModuleA { | |
731 | type port MyPortType message { inout integer } | |
732 | type component MyComp { port MyPortType MyPort } | |
733 | function MyFunc_comp3(integer par) runs on MyComp {} | |
734 | function MyFunc_nocomp() {} | |
735 | function MyFunc_nocomp2(integer par) return integer { return 0; } | |
736 | function MyFunc1() { | |
737 | var MyComp MyComponent := MyComp.create; | |
738 | var MyComp MyComponent2 := MyComp.create; | |
739 | MyComponent.start(MyFunc_nocomp()); | |
740 | // this should be ok however | |
741 | MyComponent2.start(MyFunc_comp3(MyFunc_nocomp2(666))); | |
742 | } | |
743 | } | |
744 | <END_MODULE> | |
745 | <RESULT IF_PASS COUNT 1> | |
746 | (?is)\berror: | |
747 | <END_RESULT> | |
748 | <RESULT IF_PASS COUNT 1> | |
749 | (?is)\bcannot\b.+?\bstarted\b | |
750 | <END_RESULT> | |
751 | <RESULT IF_PASS POSITIVE> | |
752 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
753 | <END_RESULT> | |
754 | <END_TC> | |
755 | ||
756 | :exmp. | |
757 | .*---------------------------------------------------------------------* | |
758 | :h4.Functions->runs on clause, function called from a template | |
759 | .*---------------------------------------------------------------------* | |
760 | :xmp tab=0. | |
761 | <TC - Functions->runs on clause, function called from a template> | |
762 | ||
763 | <COMPILE> | |
764 | <VERDICT_LEAF PASS> | |
765 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
766 | module ModuleA { | |
767 | type port MyPortType message { inout integer } | |
768 | type component MyComp { port MyPortType MyPort } | |
769 | function MyFunc_comp2() runs on MyComp return integer {return 0;} | |
770 | template integer MyTemplate := MyFunc_comp2(); | |
771 | } | |
772 | <END_MODULE> | |
773 | <RESULT IF_PASS COUNT 1> | |
774 | (?is)\berror: | |
775 | <END_RESULT> | |
776 | <RESULT IF_PASS COUNT 1> | |
777 | (?is)\bcannot\b.+?\bcall\b | |
778 | <END_RESULT> | |
779 | <RESULT IF_PASS POSITIVE> | |
780 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
781 | <END_RESULT> | |
782 | <END_TC> | |
783 | :exmp. | |
784 | .*---------------------------------------------------------------------* | |
785 | :h4.Functions->runs on clause, functions in the control part | |
786 | .*---------------------------------------------------------------------* | |
787 | :xmp tab=0. | |
788 | ||
789 | <TC - Functions->runs on clause, functions in the control part> | |
790 | ||
791 | <COMPILE> | |
792 | <VERDICT_LEAF PASS> | |
793 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
794 | module ModuleA { | |
795 | type port MyPortType message { inout integer } | |
796 | type component MyComp { port MyPortType MyPort } | |
797 | function MyFunc_comp() runs on MyComp {return;} | |
798 | function MyFunc_comp2() runs on MyComp return integer {return 0;} | |
799 | function MyCoolFunction1 (integer par) return integer {return par;} | |
800 | control { | |
801 | var integer MyVar; | |
802 | if (true) { | |
803 | MyFunc_comp(); | |
804 | MyVar := MyCoolFunction1(MyFunc_comp2()); | |
805 | } | |
806 | } | |
807 | } | |
808 | <END_MODULE> | |
809 | <RESULT IF_PASS COUNT 2> | |
810 | (?is)\berror: | |
811 | <END_RESULT> | |
812 | <RESULT IF_PASS COUNT 2> | |
813 | (?is)\bcannot\b.+?\bcall\b | |
814 | <END_RESULT> | |
815 | <RESULT IF_PASS POSITIVE> | |
816 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
817 | <END_RESULT> | |
818 | <END_TC> | |
819 | :exmp. | |
820 | ||
821 | .*---------------------------------------------------------------------* | |
822 | :h3.Altsteps->runs on clause SA-9/9 | |
823 | .*---------------------------------------------------------------------* | |
824 | Requirement: Altsteps->runs on clause (16.1.0). | |
825 | :nl.Explanation: | |
826 | :nl.An altstep without runs on clause shall never invoke a function or | |
827 | :nl.altstep or activate an altstep as default with a runs on clause locally. | |
828 | .*---------------------------------------------------------------------* | |
829 | :h4.Altsteps->runs on clause, referencing to an altstep() with runs on | |
830 | .*---------------------------------------------------------------------* | |
831 | :xmp tab=0. | |
832 | ||
833 | <TC - Altsteps->runs on clause, referencing to an altstep() with runs on> | |
834 | ||
835 | <COMPILE> | |
836 | <VERDICT_LEAF PASS> | |
837 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
838 | module ModuleA { | |
839 | type port MyPortType message { inout integer } | |
840 | type component MyComp { port MyPortType MyPort } | |
841 | altstep MyAltstep_comp() runs on MyComp { [] MyPort.trigger {} } | |
842 | ||
843 | altstep NastyAltstep01(inout MyPortType loc_port) { | |
844 | [] loc_port.trigger {} | |
845 | [] MyAltstep_comp(); | |
846 | } | |
847 | } | |
848 | <END_MODULE> | |
849 | <RESULT IF_PASS COUNT 1> | |
850 | (?is)\berror: | |
851 | <END_RESULT> | |
852 | <RESULT IF_PASS COUNT 1> | |
853 | (?is)\bcannot\b.+?\bcall\b | |
854 | <END_RESULT> | |
855 | <RESULT IF_PASS POSITIVE> | |
856 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
857 | <END_RESULT> | |
858 | <END_TC> | |
859 | :exmp. | |
860 | .*---------------------------------------------------------------------* | |
861 | :h4.Altsteps->runs on clause, referencing to a function() with runs on | |
862 | .*---------------------------------------------------------------------* | |
863 | :xmp tab=0. | |
864 | ||
865 | <TC - Altsteps->runs on clause, referencing to a function() with runs on> | |
866 | ||
867 | <COMPILE> | |
868 | <VERDICT_LEAF PASS> | |
869 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
870 | module ModuleA { | |
871 | type port MyPortType message { inout integer } | |
872 | type component MyComp { port MyPortType MyPort } | |
873 | function MyFunc_comp() runs on MyComp {} | |
874 | ||
875 | altstep NastyAltstep02(inout MyPortType loc_port) { | |
876 | [] loc_port.trigger { MyFunc_comp(); } | |
877 | } | |
878 | } | |
879 | <END_MODULE> | |
880 | <RESULT IF_PASS COUNT 1> | |
881 | (?is)\berror: | |
882 | <END_RESULT> | |
883 | <RESULT IF_PASS COUNT 1> | |
884 | (?is)\bcannot\b.+?\bcall\b | |
885 | <END_RESULT> | |
886 | <RESULT IF_PASS POSITIVE> | |
887 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
888 | <END_RESULT> | |
889 | <END_TC> | |
890 | :exmp. | |
891 | .*---------------------------------------------------------------------* | |
892 | :h4.Altsteps->runs on clause, default activation/deactivation | |
893 | .*---------------------------------------------------------------------* | |
894 | :xmp tab=0. | |
895 | ||
896 | <TC - Altsteps->runs on clause, default activation/deactivation> | |
897 | ||
898 | <COMPILE> | |
899 | <VERDICT_LEAF PASS> | |
900 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
901 | module ModuleA { | |
902 | type port MyPortType message { inout integer } | |
903 | type component MyComp { port MyPortType MyPort } | |
904 | altstep MyAltstep_comp() runs on MyComp { [] MyPort.trigger {} } | |
905 | ||
906 | altstep NastyAltstep03(inout MyPortType loc_port) { | |
907 | var default MyDef := activate(MyAltstep_comp()); | |
908 | [] loc_port.trigger { deactivate(MyDef); } | |
909 | } | |
910 | } | |
911 | <END_MODULE> | |
912 | <RESULT IF_PASS COUNT 1> | |
913 | (?is)\berror: | |
914 | <END_RESULT> | |
915 | <RESULT IF_PASS COUNT 1> | |
916 | (?is)\bcannot\b.+?\bactivate\b | |
917 | <END_RESULT> | |
918 | <RESULT IF_PASS POSITIVE> | |
919 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
920 | <END_RESULT> | |
921 | <END_TC> | |
922 | ||
923 | :exmp. | |
924 | ||
925 | .*---------------------------------------------------------------------* | |
926 | :h3.Goto statement SA-9/10 | |
927 | .*---------------------------------------------------------------------* | |
928 | Requirement: Goto statement. | |
929 | :nl.Explanation: | |
930 | :nl. - It is not allowed to jump out of or into functions, test cases, | |
931 | :nl. altsteps and the control part of a TTCN-3 module | |
932 | :nl. - It is not allowed to jump into a sequence of statements defined in | |
933 | :nl. a compound statement (i.e. alt statement, while loop, for loop, | |
934 | :nl. if-else statement, do- while loop and the interleave statement) | |
935 | :nl. - It is not allowed to use the goto statement within an interleave | |
936 | :nl. statement (see the SA-9/20) | |
937 | :nl. NOTE: the first is covered by scopes implicitly | |
938 | .*---------------------------------------------------------------------* | |
939 | :h4.Goto statement, jump into alt statement | |
940 | .*---------------------------------------------------------------------* | |
941 | :xmp tab=0. | |
942 | ||
943 | <TC - Goto statement, jump into alt statement> | |
944 | ||
945 | <COMPILE> | |
946 | <VERDICT_LEAF PASS> | |
947 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
948 | module ModuleA { | |
949 | ||
950 | control { | |
951 | timer Timy; | |
952 | var float b; | |
953 | var integer locpar; | |
954 | Timy.start(1.0); | |
955 | alt { | |
956 | [b<1.0] Timy.timeout { | |
957 | label Label01; | |
958 | locpar := locpar + 1; } | |
959 | } | |
960 | goto Label01; | |
961 | } | |
962 | } | |
963 | <END_MODULE> | |
964 | <RESULT IF_PASS COUNT 1> | |
965 | (?is)\berror: | |
966 | <END_RESULT> | |
967 | <RESULT IF_PASS COUNT 1> | |
968 | (?is)\bnot\b.+?\bdefined\b | |
969 | <END_RESULT> | |
970 | <RESULT IF_PASS POSITIVE> | |
971 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
972 | <END_RESULT> | |
973 | <END_TC> | |
974 | :exmp. | |
975 | .*---------------------------------------------------------------------* | |
976 | :h4.Goto statement, jump into if-else statement | |
977 | .*---------------------------------------------------------------------* | |
978 | :xmp tab=0. | |
979 | ||
980 | <TC - Goto statement, jump into if-else statement> | |
981 | ||
982 | <COMPILE> | |
983 | <VERDICT_LEAF PASS> | |
984 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
985 | module ModuleA { | |
986 | ||
987 | control { | |
988 | var integer locpar; | |
989 | if (true) { label Label04; locpar := 666; } | |
990 | else { label Label05; locpar := -666; } | |
991 | goto Label04; | |
992 | goto Label05; | |
993 | } | |
994 | } | |
995 | <END_MODULE> | |
996 | <RESULT IF_PASS COUNT 2> | |
997 | (?is)\berror: | |
998 | <END_RESULT> | |
999 | <RESULT IF_PASS COUNT 2> | |
1000 | (?is)\blabel\b.+?\bused\b.+?\bnot\b.+?\bdefined\b | |
1001 | <END_RESULT> | |
1002 | <RESULT IF_PASS POSITIVE> | |
1003 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1004 | <END_RESULT> | |
1005 | <END_TC> | |
1006 | :exmp. | |
1007 | .*---------------------------------------------------------------------* | |
1008 | :h4.Goto statement, jump into while statement | |
1009 | .*---------------------------------------------------------------------* | |
1010 | :xmp tab=0. | |
1011 | ||
1012 | <TC - Goto statement, jump into while statement> | |
1013 | ||
1014 | <COMPILE> | |
1015 | <VERDICT_LEAF PASS> | |
1016 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1017 | module ModuleA { | |
1018 | ||
1019 | control { | |
1020 | var integer locpar; | |
1021 | while (false) { | |
1022 | label Label02; | |
1023 | locpar := 0; | |
1024 | } | |
1025 | goto Label02; | |
1026 | } | |
1027 | } | |
1028 | <END_MODULE> | |
1029 | <RESULT IF_PASS COUNT 1> | |
1030 | (?is)\berror: | |
1031 | <END_RESULT> | |
1032 | <RESULT IF_PASS COUNT 1> | |
1033 | (?is)\bnot\b.+?\bdefined\b | |
1034 | <END_RESULT> | |
1035 | <RESULT IF_PASS POSITIVE> | |
1036 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1037 | <END_RESULT> | |
1038 | <END_TC> | |
1039 | :exmp. | |
1040 | .*---------------------------------------------------------------------* | |
1041 | :h4.Goto statement, jump into do-while statement | |
1042 | .*---------------------------------------------------------------------* | |
1043 | :xmp tab=0. | |
1044 | ||
1045 | <TC - Goto statement, jump into do-while statement> | |
1046 | ||
1047 | <COMPILE> | |
1048 | <VERDICT_LEAF PASS> | |
1049 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1050 | module ModuleA { | |
1051 | ||
1052 | control { | |
1053 | var integer locpar; | |
1054 | do { | |
1055 | label Label02; | |
1056 | locpar := 0; | |
1057 | } while (false) | |
1058 | goto Label02; | |
1059 | } | |
1060 | } | |
1061 | <END_MODULE> | |
1062 | <RESULT IF_PASS COUNT 1> | |
1063 | (?is)\berror: | |
1064 | <END_RESULT> | |
1065 | <RESULT IF_PASS COUNT 1> | |
1066 | (?is)\bnot\b.+?\bdefined\b | |
1067 | <END_RESULT> | |
1068 | <RESULT IF_PASS POSITIVE> | |
1069 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1070 | <END_RESULT> | |
1071 | <END_TC> | |
1072 | :exmp. | |
1073 | .*---------------------------------------------------------------------* | |
1074 | :h4.Goto statement, jump into for statement | |
1075 | .*---------------------------------------------------------------------* | |
1076 | :xmp tab=0. | |
1077 | ||
1078 | <TC - Goto statement, jump into for statement> | |
1079 | ||
1080 | <COMPILE> | |
1081 | <VERDICT_LEAF PASS> | |
1082 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1083 | module ModuleA { | |
1084 | ||
1085 | control { | |
1086 | var integer locpar; | |
1087 | for(var integer j:=1; j<10; j:=j+1) { | |
1088 | label Label02; | |
1089 | locpar := 0; | |
1090 | } | |
1091 | goto Label02; | |
1092 | } | |
1093 | } | |
1094 | <END_MODULE> | |
1095 | <RESULT IF_PASS COUNT 1> | |
1096 | (?is)\berror: | |
1097 | <END_RESULT> | |
1098 | <RESULT IF_PASS COUNT 1> | |
1099 | (?is)\bnot\b.+?\bdefined\b | |
1100 | <END_RESULT> | |
1101 | <RESULT IF_PASS POSITIVE> | |
1102 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1103 | <END_RESULT> | |
1104 | <END_TC> | |
1105 | ||
1106 | :exmp. | |
1107 | .*---------------------------------------------------------------------* | |
1108 | :h4.Goto statement, jump over the variable definition case 1 | |
1109 | .*---------------------------------------------------------------------* | |
1110 | :xmp tab=0. | |
1111 | ||
1112 | <TC - Goto statement, jump over the variable definition case 1> | |
1113 | ||
1114 | <COMPILE> | |
1115 | <VERDICT_LEAF PASS> | |
1116 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1117 | module ModuleA { | |
1118 | function myFunc() | |
1119 | { | |
1120 | goto L; | |
1121 | var integer i := 0; | |
1122 | label L; | |
1123 | i := i + 1; | |
1124 | } | |
1125 | ||
1126 | } | |
1127 | <END_MODULE> | |
1128 | <RESULT IF_PASS COUNT 1> | |
1129 | (?im)\berror\b.+?\bJump\b.+?\bcrosses\b | |
1130 | <END_RESULT> | |
1131 | <END_RESULT> | |
1132 | <RESULT IF_PASS COUNT 1> | |
1133 | (?is)\berror: | |
1134 | <END_RESULT> | |
1135 | <RESULT IF_PASS POSITIVE> | |
1136 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1137 | <END_RESULT> | |
1138 | <END_TC> | |
1139 | ||
1140 | :exmp. | |
1141 | ||
1142 | .*---------------------------------------------------------------------* | |
1143 | :h4.Goto statement, jump over the variable definition case 2 | |
1144 | .*---------------------------------------------------------------------* | |
1145 | :xmp tab=0. | |
1146 | ||
1147 | <TC - Goto statement, jump over the variable definition case 2> | |
1148 | ||
1149 | <COMPILE> | |
1150 | <VERDICT_LEAF PASS> | |
1151 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1152 | module ModuleA { | |
1153 | function myFunc(integer par) | |
1154 | { | |
1155 | for (var integer i := 0; i < 10; i := i + 1) { | |
1156 | if (i + par > 10) { | |
1157 | goto L; | |
1158 | var integer myint1; | |
1159 | } | |
1160 | var integer myint2; | |
1161 | } | |
1162 | var integer myint3; | |
1163 | label L; | |
1164 | } | |
1165 | ||
1166 | ||
1167 | } | |
1168 | <END_MODULE> | |
1169 | <RESULT IF_PASS COUNT 1> | |
1170 | (?im)\berror\b.+?\bJump\b.+?\bcrosses\b | |
1171 | <END_RESULT> | |
1172 | <END_RESULT> | |
1173 | <RESULT IF_PASS COUNT 1> | |
1174 | (?is)\berror: | |
1175 | <END_RESULT> | |
1176 | <RESULT IF_PASS POSITIVE> | |
1177 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1178 | <END_RESULT> | |
1179 | <END_TC> | |
1180 | ||
1181 | :exmp. | |
1182 | .*---------------------------------------------------------------------* | |
1183 | :h3.Stop operation SA-9/11 | |
1184 | .*---------------------------------------------------------------------* | |
1185 | Requirement: Stop operation. | |
1186 | :nl.Explanation: | |
1187 | :nl.The stop statement terminates execution in different ways depending | |
1188 | :nl.on the context in which it is used. When used in the control part of | |
1189 | :nl.a module or in a function used by the control part of a module, it | |
1190 | :nl.terminates the execution of the module control part. | |
1191 | :nl.NOTE: therefore, self.stop shall be detected in the control part or | |
1192 | :nl.function/altstep without runs on clause. | |
1193 | .*---------------------------------------------------------------------* | |
1194 | :h4.Stop operation in altstep without runs on clause | |
1195 | .*---------------------------------------------------------------------* | |
1196 | :xmp tab=0. | |
1197 | ||
1198 | <TC - Stop operation in altstep without runs on clause> | |
1199 | ||
1200 | <COMPILEGCC> | |
1201 | <VERDICT_LEAF PASS> | |
1202 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1203 | module ModuleA { | |
1204 | altstep MyAltstep(inout timer T) { | |
1205 | [] T.timeout { self.stop; } | |
1206 | } | |
1207 | } | |
1208 | <END_MODULE> | |
1209 | ||
1210 | <RESULT IF_PASS NEGATIVE> | |
1211 | (?is)\berror: | |
1212 | <END_RESULT> | |
1213 | <END_TC> | |
1214 | ||
1215 | :exmp. | |
1216 | .*---------------------------------------------------------------------* | |
1217 | :h4.Stop operation in function without runs on clause | |
1218 | .*---------------------------------------------------------------------* | |
1219 | :xmp tab=0. | |
1220 | ||
1221 | <TC - Stop operation in function without runs on clause> | |
1222 | ||
1223 | <COMPILEGCC> | |
1224 | <VERDICT_LEAF PASS> | |
1225 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1226 | module ModuleA { | |
1227 | function MyFunc() { | |
1228 | log("Dummy"); | |
1229 | self.stop; | |
1230 | } | |
1231 | } | |
1232 | <END_MODULE> | |
1233 | <RESULT IF_PASS NEGATIVE> | |
1234 | (?is)\berror: | |
1235 | <END_RESULT> | |
1236 | <END_TC> | |
1237 | ||
1238 | :exmp. | |
1239 | .*---------------------------------------------------------------------* | |
1240 | :h4.Stop operation in control part | |
1241 | .*---------------------------------------------------------------------* | |
1242 | :xmp tab=0. | |
1243 | ||
1244 | <TC - Stop operation in control part> | |
1245 | ||
1246 | <COMPILE> | |
1247 | <VERDICT_LEAF PASS> | |
1248 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1249 | module ModuleA { | |
1250 | control { | |
1251 | if (false) { stop; } | |
1252 | else { self.stop; } | |
1253 | } | |
1254 | } | |
1255 | <END_MODULE> | |
1256 | <RESULT IF_PASS COUNT 2> | |
1257 | (?is)\berror: | |
1258 | <END_RESULT> | |
1259 | <RESULT IF_PASS COUNT 1> | |
1260 | (?is)\bself\b | |
1261 | <END_RESULT> | |
1262 | <RESULT IF_PASS COUNT 1> | |
1263 | (?is)\bComponent\b.+?\boperation\b | |
1264 | <END_RESULT> | |
1265 | <RESULT IF_PASS POSITIVE> | |
1266 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1267 | <END_RESULT> | |
1268 | <END_TC> | |
1269 | ||
1270 | :exmp. | |
1271 | ||
1272 | .*---------------------------------------------------------------------* | |
1273 | :h3.Sending/receiving local component definitions SA-9/12 | |
1274 | .*---------------------------------------------------------------------* | |
1275 | Requirement: Sending/receiving local component definitions. | |
1276 | :nl.Explanation: | |
1277 | :nl.Data types containing information that is only valid within the same | |
1278 | :nl.component type (e.g. default references) are called local data types. | |
1279 | :nl.These types cannot be sent or received via ports. | |
1280 | .*---------------------------------------------------------------------* | |
1281 | :h4.Sending local component definitions | |
1282 | .*---------------------------------------------------------------------* | |
1283 | :xmp tab=0. | |
1284 | ||
1285 | <TC - Sending local component definitions> | |
1286 | ||
1287 | <COMPILE> | |
1288 | <VERDICT_LEAF PASS> | |
1289 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1290 | module ModuleA { | |
1291 | type record MyStruct { integer field1, default field2 } | |
1292 | type port MyPortType message { inout MyStruct } | |
1293 | type component MyComp1 { port MyPortType MyPort; } | |
1294 | ||
1295 | altstep MyDefault(inout MyPortType loc_port) { | |
1296 | [] loc_port.trigger { } | |
1297 | [else] {} | |
1298 | } | |
1299 | function MyFunc1() runs on MyComp1 { | |
1300 | var MyStruct MyWar := { field1 := 0, field2 := activate(MyDefault(MyPort)) } | |
1301 | MyPort.send(MyWar); | |
1302 | } | |
1303 | } | |
1304 | <END_MODULE> | |
1305 | <RESULT IF_FAIL COUNT 1> | |
1306 | (?is)\berror: | |
1307 | <END_RESULT> | |
1308 | <RESULT IF_FAIL POSITIVE> | |
1309 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1310 | <END_RESULT> | |
1311 | <END_TC> | |
1312 | :exmp. | |
1313 | .*---------------------------------------------------------------------* | |
1314 | :h4.Receiving local component definitions | |
1315 | .*---------------------------------------------------------------------* | |
1316 | :xmp tab=0. | |
1317 | ||
1318 | <TC - Receiving local component definitions> | |
1319 | ||
1320 | <COMPILE> | |
1321 | <VERDICT_LEAF PASS> | |
1322 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1323 | module ModuleA { | |
1324 | type record MyStruct { integer field1, default field2 } | |
1325 | type port MyPortType message { inout MyStruct } | |
1326 | type component MyComp2 { port MyPortType MyPort; } | |
1327 | ||
1328 | altstep MyDefault(inout MyPortType loc_port) { | |
1329 | [] loc_port.trigger { } | |
1330 | [else] {} | |
1331 | } | |
1332 | function MyFunc2() runs on MyComp2 { | |
1333 | var MyStruct MyWar := { field1 := 0, field2 := activate(MyDefault(MyPort)) } | |
1334 | alt { | |
1335 | [] MyPort.receive(?) -> value MyWar { deactivate(MyWar.field2); } | |
1336 | } | |
1337 | } | |
1338 | } | |
1339 | <END_MODULE> | |
1340 | <RESULT IF_FAIL COUNT 1> | |
1341 | (?is)\berror: | |
1342 | <END_RESULT> | |
1343 | <RESULT IF_FAIL POSITIVE> | |
1344 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1345 | <END_RESULT> | |
1346 | <END_TC> | |
1347 | ||
1348 | :exmp. | |
1349 | .*---------------------------------------------------------------------* | |
1350 | :h3.Activate->Timers in the parameter list of an activated altstep SA-9/13 | |
1351 | .*---------------------------------------------------------------------* | |
1352 | Requirement: Timers in the parameter list of an activated altstep. | |
1353 | :nl.Explanation: | |
1354 | :nl.All timer instances in the actual parameter list shall be declared as | |
1355 | :nl.component type local timers. | |
1356 | .*---------------------------------------------------------------------* | |
1357 | :h4.Activate->Timers in the parameter list of an activated altstep with runs on | |
1358 | .*---------------------------------------------------------------------* | |
1359 | :xmp tab=0. | |
1360 | ||
1361 | <TC - Activate->Timers in the parameter list of an activated altstep with runs on> | |
1362 | ||
1363 | <COMPILE> | |
1364 | <VERDICT_LEAF FAIL> | |
1365 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1366 | module ModuleA { | |
1367 | type port MyPortType message { inout integer } | |
1368 | type component MyComp { port MyPortType MyPort; } | |
1369 | ||
1370 | altstep MyAltstep1(inout MyPortType loc_port, inout timer loc_timer) | |
1371 | runs on MyComp { | |
1372 | [] loc_port.trigger { } | |
1373 | [] loc_timer.timeout { } | |
1374 | [else] { } | |
1375 | } | |
1376 | function MyFunc() runs on MyComp { | |
1377 | timer loc_timer; | |
1378 | // TR 700: SA-1.69Timers and variables passed by reference in the parameter list of an activated altstep | |
1379 | activate(MyAltstep1(MyPort, loc_timer)); | |
1380 | } | |
1381 | } | |
1382 | <END_MODULE> | |
1383 | <RESULT IF_FAIL COUNT 1> | |
1384 | (?is)\berror: | |
1385 | <END_RESULT> | |
1386 | <RESULT IF_PASS COUNT 1> | |
1387 | (?is)\bParameter\b.+?\brefers\b.+?\blocal\b | |
1388 | <END_RESULT> | |
1389 | <RESULT IF_FAIL POSITIVE> | |
1390 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1391 | <END_RESULT> | |
1392 | ||
1393 | <END_TC> | |
1394 | ||
1395 | :exmp. | |
1396 | .*---------------------------------------------------------------------* | |
1397 | :h4.Activate->Timers in the parameter list of an activated altstep without runs on | |
1398 | .*---------------------------------------------------------------------* | |
1399 | :xmp tab=0. | |
1400 | ||
1401 | <TC - Activate->Timers in the parameter list of an activated altstep without runs on> | |
1402 | ||
1403 | <COMPILE> | |
1404 | <VERDICT_LEAF FAIL> | |
1405 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1406 | module ModuleA { | |
1407 | type port MyPortType message { inout integer } | |
1408 | type component MyComp { port MyPortType MyPort; } | |
1409 | ||
1410 | altstep MyAltstep2(inout MyPortType loc_port, inout timer loc_timer) { | |
1411 | [] loc_port.trigger { } | |
1412 | [] loc_timer.timeout { } | |
1413 | [else] { } | |
1414 | } | |
1415 | function MyFunc() runs on MyComp { | |
1416 | timer loc_timer; | |
1417 | // TR 700: SA-1.69Timers and variables passed by reference in the parameter list of an activated altstep | |
1418 | activate(MyAltstep2(MyPort, loc_timer)); | |
1419 | } | |
1420 | } | |
1421 | <END_MODULE> | |
1422 | <RESULT IF_FAIL COUNT 1> | |
1423 | (?is)\berror: | |
1424 | <END_RESULT> | |
1425 | <RESULT IF_PASS COUNT 1> | |
1426 | (?is)\bParameter\b.+?\brefers\b.+?\blocal\b | |
1427 | <END_RESULT> | |
1428 | <RESULT IF_FAIL POSITIVE> | |
1429 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1430 | <END_RESULT> | |
1431 | ||
1432 | <END_TC> | |
1433 | ||
1434 | :exmp. | |
1435 | ||
1436 | .*---------------------------------------------------------------------* | |
1437 | :h3.Communication operations->Exceptions timeout SA-9/14 | |
1438 | .*---------------------------------------------------------------------* | |
1439 | Requirement: Exceptions. | |
1440 | :nl.Explanation: | |
1441 | :nl. Catching timeout exceptions shall be restricted to the exception | |
1442 | :nl.handling part of a call. No further matching criteria (including a | |
1443 | :nl.from part) and no assignment part is allowed for a catch operation | |
1444 | :nl.that handles a timeout exception. | |
1445 | .*---------------------------------------------------------------------* | |
1446 | :h4.Communication operations->Exceptions->Timeout with assignment | |
1447 | .*---------------------------------------------------------------------* | |
1448 | :xmp tab=0. | |
1449 | ||
1450 | <TC - Communication operations->Exceptions->Timeout with assignment> | |
1451 | ||
1452 | <COMPILE> | |
1453 | <VERDICT_LEAF FAIL> | |
1454 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1455 | module ModuleA { | |
1456 | signature MySig_block(); | |
1457 | type port MyPortType1 procedure { inout MySig_block} | |
1458 | type component MyComp { | |
1459 | port MyPortType1 MyPort1; | |
1460 | } | |
1461 | function MyAltstep1(MyComp loc_par) runs on MyComp { | |
1462 | var MyComp MyWar1; | |
1463 | MyPort1.call(MySig_block:{},20E-3) { | |
1464 | [] MyPort1.catch(timeout) -> sender MyWar1 {} | |
1465 | } | |
1466 | } | |
1467 | } | |
1468 | <END_MODULE> | |
1469 | <RESULT IF_PASS COUNT 1> | |
1470 | (?is)\berror: | |
1471 | <END_RESULT> | |
1472 | <RESULT IF_PASS POSITIVE> | |
1473 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1474 | <END_RESULT> | |
1475 | <END_TC> | |
1476 | :exmp. | |
1477 | .*---------------------------------------------------------------------* | |
1478 | :h4.Communication operations->Exceptions->Timeout with from statement | |
1479 | .*---------------------------------------------------------------------* | |
1480 | :xmp tab=0. | |
1481 | ||
1482 | <TC - Communication operations->Exceptions->Timeout with from statement> | |
1483 | ||
1484 | <COMPILE> | |
1485 | <VERDICT_LEAF FAIL> | |
1486 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1487 | module ModuleA { | |
1488 | signature MySig_block(); | |
1489 | type port MyPortType1 procedure { inout MySig_block} | |
1490 | type component MyComp { | |
1491 | port MyPortType1 MyPort1; | |
1492 | } | |
1493 | function MyAltstep1(MyComp loc_par) runs on MyComp { | |
1494 | var MyComp MyWar1; | |
1495 | MyPort1.call(MySig_block:{},20E-3) { | |
1496 | [] MyPort1.catch(timeout) from self {} | |
1497 | } | |
1498 | } | |
1499 | } | |
1500 | <END_MODULE> | |
1501 | <RESULT IF_PASS COUNT 1> | |
1502 | (?is)\berror: | |
1503 | <END_RESULT> | |
1504 | <RESULT IF_PASS POSITIVE> | |
1505 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1506 | <END_RESULT> | |
1507 | <END_TC> | |
1508 | ||
1509 | :exmp. | |
1510 | .*---------------------------------------------------------------------* | |
1511 | :h3.Verdict operations SA-9/15 | |
1512 | .*---------------------------------------------------------------------* | |
1513 | Requirement: Verdict operations. | |
1514 | :nl.Explanation: | |
1515 | :nl.The setverdict operation shall only be used with the values pass, | |
1516 | :nl.fail, inconc and none. | |
1517 | :nl.NOTE only the direct assignments can be checked by SA. | |
1518 | .*---------------------------------------------------------------------* | |
1519 | :h4.Verdict operations | |
1520 | .*---------------------------------------------------------------------* | |
1521 | :xmp tab=0. | |
1522 | ||
1523 | <TC - Verdict operations> | |
1524 | ||
1525 | <COMPILE> | |
1526 | <VERDICT_LEAF PASS> | |
1527 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1528 | module ModuleA { | |
1529 | type component MyComp {} | |
1530 | function MyFunc1() runs on MyComp { | |
1531 | setverdict(error); | |
1532 | } | |
1533 | } | |
1534 | <END_MODULE> | |
1535 | <RESULT IF_PASS COUNT 1> | |
1536 | (?is)\bError\b.+?\bverdict\b.+?\bset\b | |
1537 | <END_RESULT> | |
1538 | <RESULT IF_PASS POSITIVE> | |
1539 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1540 | <END_RESULT> | |
1541 | <END_TC> | |
1542 | ||
1543 | :exmp. | |
1544 | ||
1545 | .*---------------------------------------------------------------------* | |
1546 | :h3.Checking of ports on connect and map operations SA-9/17 | |
1547 | .*---------------------------------------------------------------------* | |
1548 | Requirement: Invalid value is used as component reference. | |
1549 | :nl.Explanation: | |
1550 | :nl.If a messages/signature can be sent/called on one of the ports of a | |
1551 | :nl.map or connect operation, it has to be listed in the in or inout list | |
1552 | :nl.of the other port. | |
1553 | .*---------------------------------------------------------------------* | |
1554 | :h4.Connect operation, incorrect port type | |
1555 | .*---------------------------------------------------------------------* | |
1556 | :xmp tab=0. | |
1557 | ||
1558 | <TC - Connect operation, incorrect port type> | |
1559 | ||
1560 | <COMPILE> | |
1561 | <VERDICT_LEAF PASS> | |
1562 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1563 | module ModuleA { | |
1564 | signature MySig(); | |
1565 | type port MyPortType1 message { inout boolean } | |
1566 | type port MyPortType2 procedure { inout MySig } | |
1567 | type component MyComp { | |
1568 | port MyPortType1 MyPort1; | |
1569 | port MyPortType2 MyPort2; | |
1570 | } | |
1571 | function MyFunc1() runs on MyComp { | |
1572 | connect(self:MyPort1,self:MyPort2); | |
1573 | } | |
1574 | } | |
1575 | <END_MODULE> | |
1576 | <RESULT IF_PASS COUNT 1> | |
1577 | (?is)\berror: | |
1578 | <END_RESULT> | |
1579 | <RESULT IF_PASS COUNT 1> | |
1580 | (?im)\bconnection\b.+?\bnot\b.+?\bconsistent\b | |
1581 | <END_RESULT> | |
1582 | <RESULT IF_PASS POSITIVE> | |
1583 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1584 | <END_RESULT> | |
1585 | <END_TC> | |
1586 | ||
1587 | :exmp. | |
1588 | .*---------------------------------------------------------------------* | |
1589 | :h4.Connect operation, incorrect signature list case 1 | |
1590 | .*---------------------------------------------------------------------* | |
1591 | :xmp tab=0. | |
1592 | ||
1593 | <TC - Connect operation, incorrect signature list case 1> | |
1594 | ||
1595 | <COMPILE> | |
1596 | <VERDICT_LEAF PASS> | |
1597 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1598 | module ModuleA { | |
1599 | signature MySig(); | |
1600 | signature MySig2(); | |
1601 | type port MyPortType1 procedure { inout MySig,MySig2 } | |
1602 | type port MyPortType2 procedure { inout MySig } | |
1603 | type component MyComp { | |
1604 | port MyPortType1 MyPort1; | |
1605 | port MyPortType2 MyPort2; | |
1606 | } | |
1607 | function MyFunc1() runs on MyComp { | |
1608 | connect(self:MyPort1,self:MyPort2); | |
1609 | } | |
1610 | } | |
1611 | <END_MODULE> | |
1612 | <RESULT IF_PASS COUNT 1> | |
1613 | (?is)\berror: | |
1614 | <END_RESULT> | |
1615 | <RESULT IF_PASS COUNT 1> | |
1616 | (?im)\bconnection\b.+?\bnot\b.+?\bconsistent\b | |
1617 | <END_RESULT> | |
1618 | <RESULT IF_PASS COUNT 1> | |
1619 | (?im)\bnot\b.+?\bpresent\b | |
1620 | <END_RESULT> | |
1621 | <RESULT IF_PASS POSITIVE> | |
1622 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1623 | <END_RESULT> | |
1624 | <END_TC> | |
1625 | ||
1626 | :exmp. | |
1627 | .*---------------------------------------------------------------------* | |
1628 | :h4.Connect operation, incorrect signature list case 2 | |
1629 | .*---------------------------------------------------------------------* | |
1630 | :xmp tab=0. | |
1631 | ||
1632 | <TC - Connect operation, incorrect signature list case 2> | |
1633 | ||
1634 | <COMPILE> | |
1635 | <VERDICT_LEAF PASS> | |
1636 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1637 | module ModuleA { | |
1638 | signature MySig(); | |
1639 | signature MySig2(); | |
1640 | type port MyPortType1 procedure { out MySig,MySig2 } | |
1641 | type port MyPortType2 procedure { in MySig2 out MySig } | |
1642 | type component MyComp { | |
1643 | port MyPortType1 MyPort1; | |
1644 | port MyPortType2 MyPort2; | |
1645 | } | |
1646 | function MyFunc1() runs on MyComp { | |
1647 | connect(self:MyPort1,self:MyPort2); | |
1648 | } | |
1649 | } | |
1650 | <END_MODULE> | |
1651 | <RESULT IF_PASS COUNT 1> | |
1652 | (?is)\berror: | |
1653 | <END_RESULT> | |
1654 | <RESULT IF_PASS COUNT 1> | |
1655 | (?im)\bconnection\b.+?\bnot\b.+?\bconsistent\b | |
1656 | <END_RESULT> | |
1657 | <RESULT IF_PASS COUNT 2> | |
1658 | (?im)\bnot\b.+?\bpresent\b | |
1659 | <END_RESULT> | |
1660 | <RESULT IF_PASS POSITIVE> | |
1661 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1662 | <END_RESULT> | |
1663 | <END_TC> | |
1664 | ||
1665 | :exmp. | |
1666 | .*---------------------------------------------------------------------* | |
1667 | :h4.Map operation, incorrect signature list case 3 | |
1668 | .*---------------------------------------------------------------------* | |
1669 | :xmp tab=0. | |
1670 | ||
1671 | <TC - Map operation, incorrect signature list case 3> | |
1672 | ||
1673 | <COMPILE> | |
1674 | <VERDICT_LEAF PASS> | |
1675 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1676 | module ModuleA { | |
1677 | signature MySig(); | |
1678 | signature MySig2(); | |
1679 | type port MyPortType1 procedure { out MySig,MySig2 } | |
1680 | type port MyPortType2 procedure { in MySig2 out MySig } | |
1681 | type component MyComp { | |
1682 | port MyPortType1 MyPort1; | |
1683 | port MyPortType2 MyPort2; | |
1684 | } | |
1685 | testcase MyFunc1() runs on MyComp { | |
1686 | map(self:MyPort1,system:MyPort2); | |
1687 | } | |
1688 | } | |
1689 | <END_MODULE> | |
1690 | <RESULT IF_PASS COUNT 1> | |
1691 | (?is)\berror: | |
1692 | <END_RESULT> | |
1693 | <RESULT IF_PASS COUNT 1> | |
1694 | (?im)\bmapping\b.+?\bnot\b.+?\bconsistent\b | |
1695 | <END_RESULT> | |
1696 | <RESULT IF_PASS COUNT 2> | |
1697 | (?im)\bnot\b.+?\bpresent\b | |
1698 | <END_RESULT> | |
1699 | <RESULT IF_PASS POSITIVE> | |
1700 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1701 | <END_RESULT> | |
1702 | <END_TC> | |
1703 | ||
1704 | :exmp. | |
1705 | .*---------------------------------------------------------------------* | |
1706 | :h4.Connect operation, incorrect variable list case 1 | |
1707 | .*---------------------------------------------------------------------* | |
1708 | :xmp tab=0. | |
1709 | ||
1710 | <TC - Connect operation, incorrect variable list case 1> | |
1711 | ||
1712 | <COMPILE> | |
1713 | <VERDICT_LEAF PASS> | |
1714 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1715 | module ModuleA { | |
1716 | type port MyPortType1 message { inout integer,octetstring } | |
1717 | type port MyPortType2 message { inout integer } | |
1718 | type component MyComp { | |
1719 | port MyPortType1 MyPort1; | |
1720 | port MyPortType2 MyPort2; | |
1721 | } | |
1722 | function MyFunc1() runs on MyComp { | |
1723 | connect(self:MyPort1,self:MyPort2); | |
1724 | } | |
1725 | } | |
1726 | <END_MODULE> | |
1727 | <RESULT IF_PASS COUNT 1> | |
1728 | (?is)\berror: | |
1729 | <END_RESULT> | |
1730 | <RESULT IF_PASS COUNT 1> | |
1731 | (?im)\bconnection\b.+?\bnot\b.+?\bconsistent\b | |
1732 | <END_RESULT> | |
1733 | <RESULT IF_PASS COUNT 1> | |
1734 | (?im)\bnot\b.+?\bpresent\b | |
1735 | <END_RESULT> | |
1736 | <RESULT IF_PASS POSITIVE> | |
1737 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1738 | <END_RESULT> | |
1739 | <END_TC> | |
1740 | ||
1741 | :exmp. | |
1742 | .*---------------------------------------------------------------------* | |
1743 | :h4.Connect operation, incorrect variable list case 2 | |
1744 | .*---------------------------------------------------------------------* | |
1745 | :xmp tab=0. | |
1746 | ||
1747 | <TC - Connect operation, incorrect variable list case 2> | |
1748 | ||
1749 | <COMPILE> | |
1750 | <VERDICT_LEAF PASS> | |
1751 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1752 | module ModuleA { | |
1753 | type port MyPortType1 message { out integer,octetstring } | |
1754 | type port MyPortType2 message { in octetstring out integer } | |
1755 | type component MyComp { | |
1756 | port MyPortType1 MyPort1; | |
1757 | port MyPortType2 MyPort2; | |
1758 | } | |
1759 | function MyFunc1() runs on MyComp { | |
1760 | connect(self:MyPort1,self:MyPort2); | |
1761 | } | |
1762 | } | |
1763 | <END_MODULE> | |
1764 | <RESULT IF_PASS COUNT 1> | |
1765 | (?is)\berror: | |
1766 | <END_RESULT> | |
1767 | <RESULT IF_PASS COUNT 1> | |
1768 | (?im)\bconnection\b.+?\bnot\b.+?\bconsistent\b | |
1769 | <END_RESULT> | |
1770 | <RESULT IF_PASS COUNT 2> | |
1771 | (?im)\bnot\b.+?\bpresent\b | |
1772 | <END_RESULT> | |
1773 | <RESULT IF_PASS POSITIVE> | |
1774 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1775 | <END_RESULT> | |
1776 | <END_TC> | |
1777 | ||
1778 | :exmp. | |
1779 | .*---------------------------------------------------------------------* | |
1780 | :h4.Map operation, incorrect variable list case 3 | |
1781 | .*---------------------------------------------------------------------* | |
1782 | :xmp tab=0. | |
1783 | ||
1784 | <TC - Map operation, incorrect variable list case 3> | |
1785 | ||
1786 | <COMPILE> | |
1787 | <VERDICT_LEAF PASS> | |
1788 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1789 | module ModuleA { | |
1790 | type port MyPortType1 message { out integer,octetstring } | |
1791 | type port MyPortType2 message { in octetstring out integer } | |
1792 | type component MyComp { | |
1793 | port MyPortType1 MyPort1; | |
1794 | port MyPortType2 MyPort2; | |
1795 | } | |
1796 | testcase MyFunc1() runs on MyComp { | |
1797 | map(self:MyPort1,system:MyPort2); | |
1798 | } | |
1799 | } | |
1800 | <END_MODULE> | |
1801 | <RESULT IF_PASS COUNT 1> | |
1802 | (?is)\berror: | |
1803 | <END_RESULT> | |
1804 | <RESULT IF_PASS COUNT 1> | |
1805 | (?im)\bmapping\b.+?\bnot\b.+?\bconsistent\b | |
1806 | <END_RESULT> | |
1807 | <RESULT IF_PASS COUNT 2> | |
1808 | (?im)\bnot\b.+?\bpresent\b | |
1809 | <END_RESULT> | |
1810 | <RESULT IF_PASS POSITIVE> | |
1811 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1812 | <END_RESULT> | |
1813 | <END_TC> | |
1814 | :exmp. | |
1815 | ||
1816 | :p. | |
1817 | .*---------------------------------------------------------------------* | |
1818 | :h3.The Select Case statement | |
1819 | .*---------------------------------------------------------------------* | |
1820 | :nl.This test case group covers the requirement SA-9/18. | |
1821 | :p. Explanation: | |
1822 | :nl.- All templateInstance in all list branches shall be of a type compatible | |
1823 | with the type of the expression in the header. A list branch is selected | |
1824 | and the block of statements of the selected branch is executed only, if | |
1825 | any of the templateInstance matches the value of the expression in the | |
1826 | header of the statement. On executing the block of statements of the | |
1827 | selected branch (i.e. not jumping out by a go to statement), execution | |
1828 | continues with the statement following the select case statement. | |
1829 | :nl.- The block of statements of an else branch is always executed if no other | |
1830 | branch textually preceding the else branch has been selected. | |
1831 | ||
1832 | .*---------------------------------------------------------------------* | |
1833 | :h4.TTCN-3::SelectCase->control part: with integer | |
1834 | .*---------------------------------------------------------------------* | |
1835 | :xmp tab=0. | |
1836 | <TC - TTCN-3::SelectCase->control part: with integer> | |
1837 | ||
1838 | <COMPILE> | |
1839 | <VERDICT_LEAF PASS> | |
1840 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1841 | module ModuleA { | |
1842 | modulepar { | |
1843 | integer tsp_int := 1; | |
1844 | } | |
1845 | control { | |
1846 | var integer vl_int := 0; | |
1847 | select (tsp_int) | |
1848 | { | |
1849 | case (0) { vl_int := tsp_int + 10; } | |
1850 | case (1,3) { vl_int := tsp_int + 100; } | |
1851 | case (5,9) { vl_int := tsp_int + 1000; } | |
1852 | case else { vl_int := tsp_int + 2000 } | |
1853 | } | |
1854 | log("Result: ", vl_int); | |
1855 | } | |
1856 | } | |
1857 | <END_MODULE> | |
1858 | <RESULT IF_PASS NEGATIVE> | |
1859 | (?is)\berror: | |
1860 | <END_RESULT> | |
1861 | <RESULT IF_PASS POSITIVE> | |
1862 | (?im)\bnotify\b.+?\bGenerating\b.+?\bcode\b | |
1863 | <END_RESULT> | |
1864 | ||
1865 | <END_TC> | |
1866 | :exmp. | |
1867 | ||
1868 | .*---------------------------------------------------------------------* | |
1869 | :h4.TTCN-3::SelectCase->else branch: not at the end | |
1870 | .*---------------------------------------------------------------------* | |
1871 | :xmp tab=0. | |
1872 | <TC - TTCN-3::SelectCase->else branch: not at the end> | |
1873 | ||
1874 | <COMPILE> | |
1875 | <VERDICT_LEAF PASS> | |
1876 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1877 | module ModuleA { | |
1878 | modulepar { | |
1879 | integer tsp_int := 1; | |
1880 | } | |
1881 | control { | |
1882 | var integer vl_int := 0; | |
1883 | select (tsp_int) | |
1884 | { | |
1885 | case (0) { vl_int := tsp_int + 10; } | |
1886 | case (1,3) { vl_int := tsp_int + 100; } | |
1887 | case else { vl_int := tsp_int + 2000 } | |
1888 | case (5,9) { vl_int := tsp_int + 1000; } | |
1889 | case else { vl_int := tsp_int + 2000 } | |
1890 | } | |
1891 | log("Result: ", vl_int); | |
1892 | } | |
1893 | } | |
1894 | <END_MODULE> | |
1895 | <RESULT IF_PASS NEGATIVE> | |
1896 | (?is)\berror: | |
1897 | <END_RESULT> | |
1898 | <RESULT IF_PASS COUNT 2> | |
1899 | (?im)\bwarning\b.+?Control.+?never.+?reaches.+?previous | |
1900 | <END_RESULT> | |
1901 | <RESULT IF_PASS POSITIVE> | |
1902 | (?im)\bnotify\b.+?\bGenerating\b.+?\bcode\b | |
1903 | <END_RESULT> | |
1904 | <END_TC> | |
1905 | :exmp. | |
1906 | ||
1907 | .*---------------------------------------------------------------------* | |
1908 | :h4.TTCN-3::SelectCase->expression: timer | |
1909 | .*---------------------------------------------------------------------* | |
1910 | :xmp tab=0. | |
1911 | <TC - TTCN-3::SelectCase->expression: timer> | |
1912 | ||
1913 | <COMPILE> | |
1914 | <VERDICT_LEAF PASS> | |
1915 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1916 | module ModuleA { | |
1917 | type component CT {} | |
1918 | testcase TC() runs on CT { | |
1919 | timer vl_T := 5.6; | |
1920 | select (vl_T) | |
1921 | { | |
1922 | case (0.4,1.2) { setverdict(pass); } | |
1923 | case else { setverdict(fail); } | |
1924 | } | |
1925 | } | |
1926 | control { execute(TC()); } | |
1927 | } | |
1928 | //error: Reference to a value was expected instead of timer `vl_T1' | |
1929 | <END_MODULE> | |
1930 | <RESULT IF_PASS COUNT 1> | |
1931 | (?im)\berror\b.+?Reference.+?was.+?expected | |
1932 | <END_RESULT> | |
1933 | <RESULT IF_PASS POSITIVE> | |
1934 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1935 | <END_RESULT> | |
1936 | ||
1937 | <END_TC> | |
1938 | :exmp. | |
1939 | ||
1940 | .*---------------------------------------------------------------------* | |
1941 | :h4.TTCN-3::SelectCase->control part: octetstring instead of integer | |
1942 | .*---------------------------------------------------------------------* | |
1943 | :xmp tab=0. | |
1944 | <TC - TTCN-3::SelectCase->control part: octetstring instead of integer> | |
1945 | ||
1946 | <COMPILE> | |
1947 | <VERDICT_LEAF PASS> | |
1948 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1949 | module ModuleA { | |
1950 | modulepar { | |
1951 | integer tsp_int := 3; | |
1952 | } | |
1953 | control { | |
1954 | var integer vl_int := 0; | |
1955 | var charstring vl_charstr := "ja"; | |
1956 | select (tsp_int) | |
1957 | { | |
1958 | case (0) | |
1959 | { vl_int := tsp_int + 10; } | |
1960 | case (1, 3, vl_charstr) | |
1961 | { vl_int := tsp_int + 100; } | |
1962 | case (5, 9, 'A5'O, vl_int) | |
1963 | { vl_int := tsp_int + 1000; } | |
1964 | case else | |
1965 | { vl_int := tsp_int + 2000 } | |
1966 | } | |
1967 | log("Result: ", vl_int); | |
1968 | } | |
1969 | } | |
1970 | <END_MODULE> | |
1971 | <RESULT IF_PASS COUNT 1> | |
1972 | (?im)\berror\b.+?Type.+?mismatch.+?integer.+?was.+?expected | |
1973 | <END_RESULT> | |
1974 | <RESULT IF_PASS COUNT 2> | |
1975 | (?im)\berror\b.+?integer.+?was.+?expected | |
1976 | <END_RESULT> | |
1977 | <RESULT IF_PASS POSITIVE> | |
1978 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1979 | <END_RESULT> | |
1980 | ||
1981 | <END_TC> | |
1982 | :exmp. | |
1983 | ||
1984 | .*---------------------------------------------------------------------* | |
1985 | :h4.TTCN-3::SelectCase->function: bitstring instead of charstring | |
1986 | .*---------------------------------------------------------------------* | |
1987 | :xmp tab=0. | |
1988 | <TC - TTCN-3::SelectCase->function: bitstring instead of charstring> | |
1989 | ||
1990 | <COMPILE> | |
1991 | <VERDICT_LEAF PASS> | |
1992 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
1993 | module ModuleA { | |
1994 | modulepar { | |
1995 | integer tsp_int := 3; | |
1996 | } | |
1997 | function F( in charstring charstr ) return integer | |
1998 | { | |
1999 | var integer vl_int := 0; | |
2000 | var charstring vl_charstr := "ja"; | |
2001 | select (charstr) | |
2002 | { | |
2003 | case ("sdf") | |
2004 | { vl_int := tsp_int + 10; } | |
2005 | case ("ha", vl_charstr) | |
2006 | { vl_int := tsp_int + 100; } | |
2007 | case ("huha", "aha", '111010111'B) | |
2008 | { vl_int := tsp_int + 1000; } | |
2009 | case else | |
2010 | { vl_int := tsp_int + 2000 } | |
2011 | } | |
2012 | return vl_int; | |
2013 | } | |
2014 | ||
2015 | control | |
2016 | { | |
2017 | var integer vl_int := -1; | |
2018 | select (tsp_int) | |
2019 | { | |
2020 | case (0) { vl_int := F("sdf"); } | |
2021 | case (3,vl_int) { vl_int := F("ja"); } | |
2022 | case (5,9) { vl_int := F("aha"); } | |
2023 | case else { vl_int := F("sdfuu"); } | |
2024 | } | |
2025 | log("Result: ", vl_int); | |
2026 | } | |
2027 | } | |
2028 | <END_MODULE> | |
2029 | <RESULT IF_PASS COUNT 1> | |
2030 | (?im)\berror\b.+?character string.+?was.+?expected | |
2031 | <END_RESULT> | |
2032 | <RESULT IF_PASS POSITIVE> | |
2033 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2034 | <END_RESULT> | |
2035 | ||
2036 | <END_TC> | |
2037 | :exmp. | |
2038 | ||
2039 | .*---------------------------------------------------------------------* | |
2040 | :h4.TTCN-3::SelectCase->altstep: float instead of octetstring | |
2041 | .*---------------------------------------------------------------------* | |
2042 | :xmp tab=0. | |
2043 | <TC - TTCN-3::SelectCase->altstep: float instead of octetstring> | |
2044 | ||
2045 | <COMPILE> | |
2046 | <VERDICT_LEAF PASS> | |
2047 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2048 | module ModuleA { | |
2049 | modulepar { | |
2050 | integer tsp_int := 3; | |
2051 | } | |
2052 | altstep A( in octetstring octet ) | |
2053 | { | |
2054 | var integer vl_int := 0; | |
2055 | var octetstring vl_octet := 'AB56FF'O; | |
2056 | [else] { | |
2057 | select (octet & 'FF'O) | |
2058 | { | |
2059 | case ('1F'O & 'FF'O) | |
2060 | { vl_int := tsp_int + 10; } | |
2061 | case ('A9'O, vl_octet) | |
2062 | { vl_int := tsp_int + 100; } | |
2063 | case ('C5'O, 'CC'O, 5.6) | |
2064 | { vl_int := tsp_int + 1000; } | |
2065 | case else | |
2066 | { vl_int := tsp_int + 2000 } | |
2067 | } | |
2068 | log("Result: ", vl_int); | |
2069 | } | |
2070 | } | |
2071 | control | |
2072 | { | |
2073 | var integer vl_int := -1; | |
2074 | select (tsp_int) | |
2075 | { | |
2076 | case (0) { A('FF'O); } | |
2077 | case (3,vl_int) { A('A9'O); } | |
2078 | case (5,9) { A('CC'O); } | |
2079 | case else { A('1F'O); } | |
2080 | } | |
2081 | } | |
2082 | } | |
2083 | <END_MODULE> | |
2084 | <RESULT IF_PASS COUNT 1> | |
2085 | (?im)\berror\b.+?octetstring.+?was.+?expected | |
2086 | <END_RESULT> | |
2087 | <RESULT IF_PASS POSITIVE> | |
2088 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2089 | <END_RESULT> | |
2090 | ||
2091 | <END_TC> | |
2092 | :exmp. | |
2093 | ||
2094 | .*---------------------------------------------------------------------* | |
2095 | :h4.TTCN-3::SelectCase->function_runs_on: float instead of integer | |
2096 | .*---------------------------------------------------------------------* | |
2097 | :xmp tab=0. | |
2098 | <TC - TTCN-3::SelectCase->function_runs_on: float instead of integer> | |
2099 | ||
2100 | <COMPILE> | |
2101 | <VERDICT_LEAF PASS> | |
2102 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2103 | module ModuleA { | |
2104 | modulepar { | |
2105 | float tsp_float := 1.9; | |
2106 | integer tsp_int := 3; | |
2107 | } | |
2108 | type component CT {} | |
2109 | function F() runs on CT return integer | |
2110 | { | |
2111 | var integer vl_int := 0; | |
2112 | var float vl_float := 0.8; | |
2113 | select (float2int(tsp_float) * tsp_int) | |
2114 | { | |
2115 | case (5 * float2int(vl_float)) | |
2116 | { vl_int := tsp_int + 10; } | |
2117 | case (3, vl_float) | |
2118 | { vl_int := tsp_int + 100; } | |
2119 | case (6, 10, 7) | |
2120 | { vl_int := tsp_int + 1000; } | |
2121 | case else | |
2122 | { vl_int := tsp_int + 2000; } | |
2123 | } | |
2124 | return vl_int; | |
2125 | } | |
2126 | testcase TC() runs on CT | |
2127 | { | |
2128 | log("Result: ", F()); | |
2129 | } | |
2130 | control { execute ( TC() ); } | |
2131 | } | |
2132 | <END_MODULE> | |
2133 | <RESULT IF_PASS COUNT 1> | |
2134 | (?im)\berror\b.+?Type.+?mismatch.+?integer.+?was.+?expected | |
2135 | <END_RESULT> | |
2136 | <RESULT IF_PASS POSITIVE> | |
2137 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2138 | <END_RESULT> | |
2139 | ||
2140 | <END_TC> | |
2141 | :exmp. | |
2142 | ||
2143 | .*---------------------------------------------------------------------* | |
2144 | :h4.TTCN-3::SelectCase->altstep_runs_on: octet instead of bitstring | |
2145 | .*---------------------------------------------------------------------* | |
2146 | :xmp tab=0. | |
2147 | <TC - TTCN-3::SelectCase->altstep_runs_on: octet instead of bitstring> | |
2148 | ||
2149 | <COMPILE> | |
2150 | <VERDICT_LEAF PASS> | |
2151 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2152 | module ModuleA { | |
2153 | modulepar { | |
2154 | integer tsp_int := 9; | |
2155 | bitstring tsp_bitstring := '11010'B; | |
2156 | } | |
2157 | type component CT {} | |
2158 | altstep A() runs on CT | |
2159 | { | |
2160 | var integer vl_int; | |
2161 | var bitstring vl_bitstring := '111011010'B; | |
2162 | [else] { | |
2163 | select ('1110'B & tsp_bitstring) | |
2164 | { | |
2165 | case ('1001'B, vl_bitstring) | |
2166 | { vl_int := tsp_int + 10; } | |
2167 | case ('1100'B, '11'O) | |
2168 | { vl_int := tsp_int + 100; } | |
2169 | case ('11011'B, '10'B, '111'B) | |
2170 | { vl_int := tsp_int + 1000; } | |
2171 | case else | |
2172 | { vl_int := tsp_int + 2000; } | |
2173 | } | |
2174 | log("Result: ", vl_int); | |
2175 | } | |
2176 | } | |
2177 | testcase TC() runs on CT { A() } | |
2178 | control { execute ( TC() ); } | |
2179 | } | |
2180 | <END_MODULE> | |
2181 | <RESULT IF_PASS COUNT 1> | |
2182 | (?im)\berror\b.+?bitstring.+?was.+?expected | |
2183 | <END_RESULT> | |
2184 | <RESULT IF_PASS POSITIVE> | |
2185 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2186 | <END_RESULT> | |
2187 | ||
2188 | <END_TC> | |
2189 | :exmp. | |
2190 | ||
2191 | .*---------------------------------------------------------------------* | |
2192 | :h4.TTCN-3::SelectCase->testcase: integer instead of enum | |
2193 | .*---------------------------------------------------------------------* | |
2194 | :xmp tab=0. | |
2195 | <TC - TTCN-3::SelectCase->testcase: integer instead of enum> | |
2196 | ||
2197 | <COMPILE> | |
2198 | <VERDICT_LEAF PASS> | |
2199 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2200 | module ModuleA { | |
2201 | modulepar { | |
2202 | integer tsp_int := 9; | |
2203 | Enum tsp_enum := E; | |
2204 | } | |
2205 | type enumerated Enum { A,B,C,D,E,F,G } | |
2206 | type component CT {} | |
2207 | testcase TC() runs on CT | |
2208 | { | |
2209 | var integer vl_int; | |
2210 | var integer vl_H := 5; | |
2211 | var Enum vl_enum := B; | |
2212 | select (tsp_enum) | |
2213 | { | |
2214 | case (G) | |
2215 | { vl_int := tsp_int + 10; } | |
2216 | case (A,F,vl_enum) | |
2217 | { vl_int := tsp_int + 100; } | |
2218 | case (C,D,E,vl_H) | |
2219 | { vl_int := tsp_int + 1000; } | |
2220 | case else | |
2221 | { vl_int := tsp_int + 2000; } | |
2222 | } | |
2223 | log("Result: ", vl_int); | |
2224 | } | |
2225 | control { execute ( TC() ); } | |
2226 | } | |
2227 | <END_MODULE> | |
2228 | <RESULT IF_PASS COUNT 1> | |
2229 | (?im)\berror\b.+?Type.+?mismatch.+?Enum.+?was.+?expected | |
2230 | <END_RESULT> | |
2231 | <RESULT IF_PASS POSITIVE> | |
2232 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2233 | <END_RESULT> | |
2234 | ||
2235 | <END_TC> | |
2236 | :exmp. | |
2237 | ||
2238 | .*---------------------------------------------------------------------* | |
2239 | :h4.TTCN-3::SelectCase->control part: scope | |
2240 | .*---------------------------------------------------------------------* | |
2241 | :xmp tab=0. | |
2242 | <TC - TTCN-3::SelectCase->control part: scope> | |
2243 | ||
2244 | <COMPILE> | |
2245 | <VERDICT_LEAF PASS> | |
2246 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2247 | module ModuleA { | |
2248 | modulepar { | |
2249 | integer tsp_int := 1; | |
2250 | } | |
2251 | control { | |
2252 | var integer vl_int := 0; | |
2253 | select (tsp_int) | |
2254 | { | |
2255 | case (1,3,5,7) | |
2256 | { | |
2257 | vl_int := tsp_int + 100; | |
2258 | var integer vl_emb := vl_int * 5; | |
2259 | } | |
2260 | case else | |
2261 | { | |
2262 | vl_int := 0 | |
2263 | } | |
2264 | } | |
2265 | log("Result: ", vl_int); | |
2266 | log("Embedded: ", vl_emb); | |
2267 | } | |
2268 | } | |
2269 | <END_MODULE> | |
2270 | <RESULT IF_PASS COUNT 1> | |
2271 | (?im)\berror\b.+?no.+?local.+?or.+?imported.+?definition.+?vl_emb | |
2272 | <END_RESULT> | |
2273 | <RESULT IF_PASS POSITIVE> | |
2274 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2275 | <END_RESULT> | |
2276 | ||
2277 | <END_TC> | |
2278 | :exmp. | |
2279 | ||
2280 | .*---------------------------------------------------------------------* | |
2281 | :h4.TTCN-3::SelectCase->control part: identifier overloading | |
2282 | .*---------------------------------------------------------------------* | |
2283 | :xmp tab=0. | |
2284 | <TC - TTCN-3::SelectCase->control part: identifier overloading> | |
2285 | ||
2286 | <COMPILE> | |
2287 | <VERDICT_LEAF PASS> | |
2288 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2289 | module ModuleA { | |
2290 | modulepar { | |
2291 | integer tsp_int := 1; | |
2292 | } | |
2293 | control { | |
2294 | var integer vl_int := 0; | |
2295 | select (tsp_int) | |
2296 | { | |
2297 | case (1,3,5,7) | |
2298 | { | |
2299 | vl_int := 100; | |
2300 | var integer tsp_int := vl_int * 5; | |
2301 | } | |
2302 | case else | |
2303 | { | |
2304 | vl_int := 0 | |
2305 | } | |
2306 | } | |
2307 | log("Result: ", vl_int); | |
2308 | } | |
2309 | } | |
2310 | <END_MODULE> | |
2311 | <RESULT IF_PASS COUNT 1> | |
2312 | (?im)\berror\b.+?tsp_int.+?not.+?unique | |
2313 | <END_RESULT> | |
2314 | <RESULT IF_PASS COUNT 1> | |
2315 | (?im)\bnote\b.+?tsp_int.+?higher.+?scope | |
2316 | <END_RESULT> | |
2317 | <RESULT IF_PASS COUNT 1> | |
2318 | (?is)\berror: | |
2319 | <END_RESULT> | |
2320 | <RESULT IF_PASS POSITIVE> | |
2321 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2322 | <END_RESULT> | |
2323 | ||
2324 | <END_TC> | |
2325 | :exmp. | |
2326 | ||
2327 | .*---------------------------------------------------------------------* | |
2328 | :h4.TTCN-3::SelectCase->control part: goto-label | |
2329 | .*---------------------------------------------------------------------* | |
2330 | :xmp tab=0. | |
2331 | <TC - TTCN-3::SelectCase->control part: goto-label> | |
2332 | ||
2333 | <COMPILE> | |
2334 | <VERDICT_LEAF PASS> | |
2335 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2336 | module ModuleA { | |
2337 | modulepar { | |
2338 | integer tsp_int := 1; | |
2339 | } | |
2340 | control { | |
2341 | var integer vl_int := 0; | |
2342 | select (tsp_int) | |
2343 | { | |
2344 | case (1,3,5,7) | |
2345 | { | |
2346 | vl_int := 100; | |
2347 | goto L1; | |
2348 | } | |
2349 | case else | |
2350 | { | |
2351 | label L1; | |
2352 | vl_int := 0 | |
2353 | } | |
2354 | } | |
2355 | log("Result: ", vl_int); | |
2356 | } | |
2357 | } | |
2358 | <END_MODULE> | |
2359 | <RESULT IF_PASS COUNT 1> | |
2360 | (?im)\berror\b.+?Label.+?L1.+?not.+?defined | |
2361 | <END_RESULT> | |
2362 | <RESULT IF_PASS COUNT 1> | |
2363 | (?is)\berror: | |
2364 | <END_RESULT> | |
2365 | <RESULT IF_PASS POSITIVE> | |
2366 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2367 | <END_RESULT> | |
2368 | ||
2369 | <END_TC> | |
2370 | :exmp. | |
2371 | ||
2372 | .*---------------------------------------------------------------------* | |
2373 | :h4.TTCN-3::SelectCase->Syntax error_1 | |
2374 | .*---------------------------------------------------------------------* | |
2375 | :xmp tab=0. | |
2376 | <TC - TTCN-3::SelectCase->Syntax error_1> | |
2377 | ||
2378 | <COMPILE> | |
2379 | <VERDICT_LEAF PASS> | |
2380 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2381 | module ModuleA { | |
2382 | modulepar { | |
2383 | integer tsp_int := 1; | |
2384 | } | |
2385 | control { | |
2386 | var integer vl_int := 0; | |
2387 | select (tsp_int) | |
2388 | case (1,3,5,7) | |
2389 | { | |
2390 | vl_int := 100; | |
2391 | } | |
2392 | case else | |
2393 | { | |
2394 | vl_int := 0 | |
2395 | } | |
2396 | } | |
2397 | } | |
2398 | } | |
2399 | <END_MODULE> | |
2400 | <RESULT IF_PASS COUNT 2> | |
2401 | (?im)\berror\b.+?syntax.+?error | |
2402 | <END_RESULT> | |
2403 | <RESULT IF_PASS COUNT 2> | |
2404 | (?is)\berror: | |
2405 | <END_RESULT> | |
2406 | <RESULT IF_PASS POSITIVE> | |
2407 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2408 | <END_RESULT> | |
2409 | ||
2410 | <END_TC> | |
2411 | :exmp. | |
2412 | ||
2413 | .*---------------------------------------------------------------------* | |
2414 | :h4.TTCN-3::SelectCase->Syntax error_2 | |
2415 | .*---------------------------------------------------------------------* | |
2416 | :xmp tab=0. | |
2417 | <TC - TTCN-3::SelectCase->Syntax error_2> | |
2418 | ||
2419 | <COMPILE> | |
2420 | <VERDICT_LEAF PASS> | |
2421 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2422 | module ModuleA { | |
2423 | modulepar { | |
2424 | integer tsp_int := 1; | |
2425 | } | |
2426 | control { | |
2427 | var integer vl_int := 0; | |
2428 | select (tsp_int) | |
2429 | { | |
2430 | case (1,3,5 7) | |
2431 | { | |
2432 | vl_int := 100; | |
2433 | } | |
2434 | case else | |
2435 | { | |
2436 | vl_int := 0 | |
2437 | } | |
2438 | } | |
2439 | } | |
2440 | } | |
2441 | <END_MODULE> | |
2442 | <RESULT IF_PASS COUNT 1> | |
2443 | (?im)\berror\b.+?syntax.+?error | |
2444 | <END_RESULT> | |
2445 | <RESULT IF_PASS COUNT 1> | |
2446 | (?is)\berror: | |
2447 | <END_RESULT> | |
2448 | <RESULT IF_PASS POSITIVE> | |
2449 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2450 | <END_RESULT> | |
2451 | ||
2452 | <END_TC> | |
2453 | :exmp. | |
2454 | ||
2455 | .*---------------------------------------------------------------------* | |
2456 | :h4.TTCN-3::SelectCase->Syntax error_3 | |
2457 | .*---------------------------------------------------------------------* | |
2458 | :xmp tab=0. | |
2459 | <TC - TTCN-3::SelectCase->Syntax error_3> | |
2460 | ||
2461 | <COMPILE> | |
2462 | <VERDICT_LEAF PASS> | |
2463 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2464 | module ModuleA { | |
2465 | modulepar { | |
2466 | integer tsp_int := 1; | |
2467 | } | |
2468 | control { | |
2469 | var integer vl_int := 0; | |
2470 | select (tsp_int) | |
2471 | { | |
2472 | case (1,3,5,7) | |
2473 | vl_int := 100; | |
2474 | case else | |
2475 | { | |
2476 | vl_int := 0 | |
2477 | } | |
2478 | } | |
2479 | } | |
2480 | } | |
2481 | <END_MODULE> | |
2482 | <RESULT IF_PASS COUNT 1> | |
2483 | (?im)\berror\b.+?syntax.+?error | |
2484 | <END_RESULT> | |
2485 | <RESULT IF_PASS COUNT 1> | |
2486 | (?is)\berror: | |
2487 | <END_RESULT> | |
2488 | <RESULT IF_PASS POSITIVE> | |
2489 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2490 | <END_RESULT> | |
2491 | ||
2492 | <END_TC> | |
2493 | :exmp. | |
2494 | ||
2495 | .*---------------------------------------------------------------------* | |
2496 | :h4.TTCN-3::SelectCase->Syntax error_4 | |
2497 | .*---------------------------------------------------------------------* | |
2498 | :xmp tab=0. | |
2499 | <TC - TTCN-3::SelectCase->Syntax error_4> | |
2500 | ||
2501 | <COMPILE> | |
2502 | <VERDICT_LEAF PASS> | |
2503 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2504 | module ModuleA { | |
2505 | modulepar { | |
2506 | integer tsp_int := 1; | |
2507 | } | |
2508 | control { | |
2509 | var integer vl_int := 0; | |
2510 | select (tsp_int) | |
2511 | { | |
2512 | case (1,3,5,7) | |
2513 | { | |
2514 | vl_int := 100; | |
2515 | } | |
2516 | case | |
2517 | { | |
2518 | vl_int := 0 | |
2519 | } | |
2520 | } | |
2521 | } | |
2522 | } | |
2523 | <END_MODULE> | |
2524 | <RESULT IF_PASS COUNT 2> | |
2525 | (?im)\berror\b.+?syntax.+?error | |
2526 | <END_RESULT> | |
2527 | <RESULT IF_PASS COUNT 2> | |
2528 | (?is)\berror: | |
2529 | <END_RESULT> | |
2530 | <RESULT IF_PASS POSITIVE> | |
2531 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2532 | <END_RESULT> | |
2533 | ||
2534 | <END_TC> | |
2535 | :exmp. | |
2536 | ||
2537 | :p. | |
2538 | .*---------------------------------------------------------------------* | |
2539 | :h3.Configuration Operations | |
2540 | .*---------------------------------------------------------------------* | |
2541 | :nl.This test case group covers the requirement SA-9/19. | |
2542 | :p. Explanation: | |
2543 | :nl.- These operations shall only be used in TTCN-3 testcases, functions | |
2544 | and altsteps (i.e. not in the module control part). | |
2545 | :nl.- The done and killed operations shall not be used in a boolean | |
2546 | expression (i.e. in the if condition ). | |
2547 | :nl.- The alive and running operations shall not be used to determine an | |
2548 | alternative (i.e. in the alt condition). | |
2549 | :nl.- Create operation: optionally, a name can be associated with the newly | |
2550 | created component instance. The name shall be a charstring value. | |
2551 | ||
2552 | .*---------------------------------------------------------------------* | |
2553 | :h4.TTCN-3::ConfigOper->create in the control part | |
2554 | .*---------------------------------------------------------------------* | |
2555 | :xmp tab=0. | |
2556 | <TC - TTCN-3::ConfigOper->create in the control part> | |
2557 | ||
2558 | <COMPILE> | |
2559 | <VERDICT_LEAF PASS> | |
2560 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2561 | module ModuleA { | |
2562 | type component ct {}; | |
2563 | control { | |
2564 | var ct comp := ct.create; | |
2565 | var ct comp1 := ct.create alive; | |
2566 | } | |
2567 | } | |
2568 | <END_MODULE> | |
2569 | <RESULT IF_PASS COUNT 2> | |
2570 | (?im)\berror\b.+?create.+?not.+?allowed.+?control.+?part | |
2571 | <END_RESULT> | |
2572 | <RESULT IF_PASS COUNT 2> | |
2573 | (?is)\berror: | |
2574 | <END_RESULT> | |
2575 | <RESULT IF_PASS POSITIVE> | |
2576 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2577 | <END_RESULT> | |
2578 | ||
2579 | <END_TC> | |
2580 | :exmp. | |
2581 | ||
2582 | .*---------------------------------------------------------------------* | |
2583 | :h4.TTCN-3::ConfigOper->start operation in the control part | |
2584 | .*---------------------------------------------------------------------* | |
2585 | :xmp tab=0. | |
2586 | <TC - TTCN-3::ConfigOper->start operation in the control part> | |
2587 | ||
2588 | <COMPILE> | |
2589 | <VERDICT_LEAF PASS> | |
2590 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2591 | module ModuleA { | |
2592 | type component ct {}; | |
2593 | function f() runs on ct {}; | |
2594 | control { | |
2595 | var ct comp; | |
2596 | comp.start(f()); | |
2597 | } | |
2598 | } | |
2599 | <END_MODULE> | |
2600 | <RESULT IF_PASS COUNT 1> | |
2601 | (?im)\berror\b.+?Component.+?operation.+?not.+?allowed.+?control.+?part | |
2602 | <END_RESULT> | |
2603 | <RESULT IF_PASS COUNT 1> | |
2604 | (?is)\berror: | |
2605 | <END_RESULT> | |
2606 | <RESULT IF_PASS POSITIVE> | |
2607 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2608 | <END_RESULT> | |
2609 | ||
2610 | <END_TC> | |
2611 | :exmp. | |
2612 | ||
2613 | .*---------------------------------------------------------------------* | |
2614 | :h4.TTCN-3::ConfigOper->stop operation in the control part | |
2615 | .*---------------------------------------------------------------------* | |
2616 | :xmp tab=0. | |
2617 | <TC - TTCN-3::ConfigOper->stop operation in the control part> | |
2618 | ||
2619 | <COMPILE> | |
2620 | <VERDICT_LEAF PASS> | |
2621 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2622 | module ModuleA { | |
2623 | type component ct {}; | |
2624 | control { | |
2625 | var ct comp; | |
2626 | comp.stop; | |
2627 | } | |
2628 | } | |
2629 | <END_MODULE> | |
2630 | <RESULT IF_PASS COUNT 1> | |
2631 | (?im)\berror\b.+?Component.+?operation.+?not.+?allowed.+?control.+?part | |
2632 | <END_RESULT> | |
2633 | <RESULT IF_PASS COUNT 1> | |
2634 | (?is)\berror: | |
2635 | <END_RESULT> | |
2636 | <RESULT IF_PASS POSITIVE> | |
2637 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2638 | <END_RESULT> | |
2639 | ||
2640 | <END_TC> | |
2641 | :exmp. | |
2642 | ||
2643 | .*---------------------------------------------------------------------* | |
2644 | :h4.TTCN-3::ConfigOper->all-stop operation in the control part | |
2645 | .*---------------------------------------------------------------------* | |
2646 | :xmp tab=0. | |
2647 | <TC - TTCN-3::ConfigOper->all-stop operation in the control part> | |
2648 | ||
2649 | <COMPILE> | |
2650 | <VERDICT_LEAF PASS> | |
2651 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2652 | module ModuleA { | |
2653 | type component ct {}; | |
2654 | control { | |
2655 | var ct comp; | |
2656 | all component.stop; | |
2657 | } | |
2658 | } | |
2659 | <END_MODULE> | |
2660 | <RESULT IF_PASS COUNT 1> | |
2661 | (?im)\berror\b.+?syntax.+?error | |
2662 | <END_RESULT> | |
2663 | <RESULT IF_PASS COUNT 1> | |
2664 | (?is)\berror: | |
2665 | <END_RESULT> | |
2666 | <RESULT IF_PASS POSITIVE> | |
2667 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2668 | <END_RESULT> | |
2669 | ||
2670 | <END_TC> | |
2671 | :exmp. | |
2672 | ||
2673 | .*---------------------------------------------------------------------* | |
2674 | :h4.TTCN-3::ConfigOper->kill operation in the control part | |
2675 | .*---------------------------------------------------------------------* | |
2676 | :xmp tab=0. | |
2677 | <TC - TTCN-3::ConfigOper->kill operation in the control part> | |
2678 | ||
2679 | <COMPILE> | |
2680 | <VERDICT_LEAF PASS> | |
2681 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2682 | module ModuleA { | |
2683 | type component ct {}; | |
2684 | control { | |
2685 | var ct comp; | |
2686 | comp.kill; | |
2687 | } | |
2688 | } | |
2689 | <END_MODULE> | |
2690 | <RESULT IF_PASS COUNT 1> | |
2691 | (?im)\berror\b.+?syntax.+?error | |
2692 | <END_RESULT> | |
2693 | <RESULT IF_PASS COUNT 1> | |
2694 | (?is)\berror: | |
2695 | <END_RESULT> | |
2696 | <RESULT IF_PASS POSITIVE> | |
2697 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2698 | <END_RESULT> | |
2699 | ||
2700 | <END_TC> | |
2701 | :exmp. | |
2702 | ||
2703 | .*---------------------------------------------------------------------* | |
2704 | :h4.TTCN-3::ConfigOper->all-kill operation in the control part | |
2705 | .*---------------------------------------------------------------------* | |
2706 | :xmp tab=0. | |
2707 | <TC - TTCN-3::ConfigOper->all-kill operation in the control part> | |
2708 | ||
2709 | <COMPILE> | |
2710 | <VERDICT_LEAF PASS> | |
2711 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2712 | module ModuleA { | |
2713 | type component ct {}; | |
2714 | control { | |
2715 | var ct comp; | |
2716 | all component.kill; | |
2717 | } | |
2718 | } | |
2719 | <END_MODULE> | |
2720 | <RESULT IF_PASS COUNT 1> | |
2721 | (?im)\berror\b.+?syntax.+?error | |
2722 | <END_RESULT> | |
2723 | <RESULT IF_PASS COUNT 1> | |
2724 | (?is)\berror: | |
2725 | <END_RESULT> | |
2726 | <RESULT IF_PASS POSITIVE> | |
2727 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2728 | <END_RESULT> | |
2729 | ||
2730 | <END_TC> | |
2731 | :exmp. | |
2732 | ||
2733 | .*---------------------------------------------------------------------* | |
2734 | :h4.TTCN-3::ConfigOper->alive operation in the control part | |
2735 | .*---------------------------------------------------------------------* | |
2736 | :xmp tab=0. | |
2737 | <TC - TTCN-3::ConfigOper->alive operation in the control part> | |
2738 | ||
2739 | <COMPILE> | |
2740 | <VERDICT_LEAF PASS> | |
2741 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2742 | module ModuleA { | |
2743 | type component ct {}; | |
2744 | control { | |
2745 | var ct comp; | |
2746 | if (comp.alive) {} | |
2747 | } | |
2748 | } | |
2749 | <END_MODULE> | |
2750 | <RESULT IF_PASS COUNT 1> | |
2751 | (?im)\berror\b.+?Operation.+?not.+?allowed.+?control.+?part | |
2752 | <END_RESULT> | |
2753 | <RESULT IF_PASS COUNT 1> | |
2754 | (?is)\berror: | |
2755 | <END_RESULT> | |
2756 | <RESULT IF_PASS POSITIVE> | |
2757 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2758 | <END_RESULT> | |
2759 | ||
2760 | <END_TC> | |
2761 | :exmp. | |
2762 | ||
2763 | .*---------------------------------------------------------------------* | |
2764 | :h4.TTCN-3::ConfigOper->any-alive operation in the control part | |
2765 | .*---------------------------------------------------------------------* | |
2766 | :xmp tab=0. | |
2767 | <TC - TTCN-3::ConfigOper->any-alive operation in the control part> | |
2768 | ||
2769 | <COMPILE> | |
2770 | <VERDICT_LEAF PASS> | |
2771 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2772 | module ModuleA { | |
2773 | type component ct {}; | |
2774 | control { | |
2775 | var ct comp; | |
2776 | if (any component.alive) {}; | |
2777 | } | |
2778 | } | |
2779 | <END_MODULE> | |
2780 | <RESULT IF_PASS COUNT 1> | |
2781 | (?im)\berror\b.+?Operation.+?not.+?allowed.+?control.+?part | |
2782 | <END_RESULT> | |
2783 | <RESULT IF_PASS COUNT 1> | |
2784 | (?is)\berror: | |
2785 | <END_RESULT> | |
2786 | <RESULT IF_PASS POSITIVE> | |
2787 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2788 | <END_RESULT> | |
2789 | ||
2790 | <END_TC> | |
2791 | :exmp. | |
2792 | ||
2793 | ||
2794 | .*---------------------------------------------------------------------* | |
2795 | :h4.TTCN-3::ConfigOper->all-alive operation in the control part | |
2796 | .*---------------------------------------------------------------------* | |
2797 | :xmp tab=0. | |
2798 | <TC - TTCN-3::ConfigOper->all-alive operation in the control part> | |
2799 | ||
2800 | <COMPILE> | |
2801 | <VERDICT_LEAF PASS> | |
2802 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2803 | module ModuleA { | |
2804 | type component ct {}; | |
2805 | control { | |
2806 | var ct comp; | |
2807 | if (all component.alive) {}; | |
2808 | } | |
2809 | } | |
2810 | <END_MODULE> | |
2811 | <RESULT IF_PASS COUNT 1> | |
2812 | (?im)\berror\b.+?Operation.+?not.+?allowed.+?control.+?part | |
2813 | <END_RESULT> | |
2814 | <RESULT IF_PASS COUNT 1> | |
2815 | (?is)\berror: | |
2816 | <END_RESULT> | |
2817 | <RESULT IF_PASS POSITIVE> | |
2818 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2819 | <END_RESULT> | |
2820 | ||
2821 | <END_TC> | |
2822 | :exmp. | |
2823 | ||
2824 | .*---------------------------------------------------------------------* | |
2825 | :h4.TTCN-3::ConfigOper->running operation in the control part | |
2826 | .*---------------------------------------------------------------------* | |
2827 | :xmp tab=0. | |
2828 | <TC - TTCN-3::ConfigOper->running operation in the control part> | |
2829 | ||
2830 | <COMPILE> | |
2831 | <VERDICT_LEAF PASS> | |
2832 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2833 | module ModuleA { | |
2834 | type component ct {}; | |
2835 | control { | |
2836 | var ct comp; | |
2837 | if (comp.running) {} | |
2838 | } | |
2839 | } | |
2840 | <END_MODULE> | |
2841 | <RESULT IF_PASS COUNT 1> | |
2842 | (?im)\berror\b.+?Operation.+?not.+?allowed.+?control.+?part | |
2843 | <END_RESULT> | |
2844 | <RESULT IF_PASS COUNT 1> | |
2845 | (?is)\berror: | |
2846 | <END_RESULT> | |
2847 | <RESULT IF_PASS POSITIVE> | |
2848 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2849 | <END_RESULT> | |
2850 | ||
2851 | <END_TC> | |
2852 | :exmp. | |
2853 | ||
2854 | .*---------------------------------------------------------------------* | |
2855 | :h4.TTCN-3::ConfigOper->any-running operation in the control part | |
2856 | .*---------------------------------------------------------------------* | |
2857 | :xmp tab=0. | |
2858 | <TC - TTCN-3::ConfigOper->any-running operation in the control part> | |
2859 | ||
2860 | <COMPILE> | |
2861 | <VERDICT_LEAF PASS> | |
2862 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2863 | module ModuleA { | |
2864 | type component ct {}; | |
2865 | control { | |
2866 | var ct comp; | |
2867 | if (any component.running) {}; | |
2868 | } | |
2869 | } | |
2870 | <END_MODULE> | |
2871 | <RESULT IF_PASS COUNT 1> | |
2872 | (?im)\berror\b.+?Operation.+?not.+?allowed.+?control.+?part | |
2873 | <END_RESULT> | |
2874 | <RESULT IF_PASS COUNT 1> | |
2875 | (?is)\berror: | |
2876 | <END_RESULT> | |
2877 | <RESULT IF_PASS POSITIVE> | |
2878 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2879 | <END_RESULT> | |
2880 | ||
2881 | <END_TC> | |
2882 | :exmp. | |
2883 | ||
2884 | ||
2885 | .*---------------------------------------------------------------------* | |
2886 | :h4.TTCN-3::ConfigOper->all-running operation in the control part | |
2887 | .*---------------------------------------------------------------------* | |
2888 | :xmp tab=0. | |
2889 | <TC - TTCN-3::ConfigOper->all-running operation in the control part> | |
2890 | ||
2891 | <COMPILE> | |
2892 | <VERDICT_LEAF PASS> | |
2893 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2894 | module ModuleA { | |
2895 | type component ct {}; | |
2896 | control { | |
2897 | var ct comp; | |
2898 | if (all component.running) {}; | |
2899 | } | |
2900 | } | |
2901 | <END_MODULE> | |
2902 | <RESULT IF_PASS COUNT 1> | |
2903 | (?im)\berror\b.+?Operation.+?not.+?allowed.+?control.+?part | |
2904 | <END_RESULT> | |
2905 | <RESULT IF_PASS COUNT 1> | |
2906 | (?is)\berror: | |
2907 | <END_RESULT> | |
2908 | <RESULT IF_PASS POSITIVE> | |
2909 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2910 | <END_RESULT> | |
2911 | ||
2912 | <END_TC> | |
2913 | :exmp. | |
2914 | ||
2915 | .*---------------------------------------------------------------------* | |
2916 | :h4.TTCN-3::ConfigOper->done operation in the control part | |
2917 | .*---------------------------------------------------------------------* | |
2918 | :xmp tab=0. | |
2919 | <TC - TTCN-3::ConfigOper->done operation in the control part> | |
2920 | ||
2921 | <COMPILE> | |
2922 | <VERDICT_LEAF PASS> | |
2923 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2924 | module ModuleA { | |
2925 | type component ct {}; | |
2926 | control { | |
2927 | var ct comp; | |
2928 | alt { [] comp.done {} } | |
2929 | } | |
2930 | } | |
2931 | <END_MODULE> | |
2932 | <RESULT IF_PASS COUNT 1> | |
2933 | (?im)\berror\b.+?Component.+?operation.+?not.+?allowed.+?control.+?part | |
2934 | <END_RESULT> | |
2935 | <RESULT IF_PASS COUNT 1> | |
2936 | (?is)\berror: | |
2937 | <END_RESULT> | |
2938 | <RESULT IF_PASS POSITIVE> | |
2939 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2940 | <END_RESULT> | |
2941 | ||
2942 | <END_TC> | |
2943 | :exmp. | |
2944 | ||
2945 | .*---------------------------------------------------------------------* | |
2946 | :h4.TTCN-3::ConfigOper->any-done operation in the control part | |
2947 | .*---------------------------------------------------------------------* | |
2948 | :xmp tab=0. | |
2949 | <TC - TTCN-3::ConfigOper->any-done operation in the control part> | |
2950 | ||
2951 | <COMPILE> | |
2952 | <VERDICT_LEAF PASS> | |
2953 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2954 | module ModuleA { | |
2955 | type component ct {}; | |
2956 | control { | |
2957 | var ct comp; | |
2958 | alt { [] any component.done {} } | |
2959 | } | |
2960 | } | |
2961 | <END_MODULE> | |
2962 | <RESULT IF_PASS COUNT 1> | |
2963 | (?im)\berror\b.+?Component.+?operation.+?not.+?allowed.+?control.+?part | |
2964 | <END_RESULT> | |
2965 | <RESULT IF_PASS COUNT 1> | |
2966 | (?is)\berror: | |
2967 | <END_RESULT> | |
2968 | <RESULT IF_PASS POSITIVE> | |
2969 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
2970 | <END_RESULT> | |
2971 | ||
2972 | <END_TC> | |
2973 | :exmp. | |
2974 | ||
2975 | .*---------------------------------------------------------------------* | |
2976 | :h4.TTCN-3::ConfigOper->all-done operation in the control part | |
2977 | .*---------------------------------------------------------------------* | |
2978 | :xmp tab=0. | |
2979 | <TC - TTCN-3::ConfigOper->all-done operation in the control part> | |
2980 | ||
2981 | <COMPILE> | |
2982 | <VERDICT_LEAF PASS> | |
2983 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
2984 | module ModuleA { | |
2985 | type component ct {}; | |
2986 | control { | |
2987 | var ct comp; | |
2988 | alt { [] all component.done {} } | |
2989 | } | |
2990 | } | |
2991 | <END_MODULE> | |
2992 | <RESULT IF_PASS COUNT 1> | |
2993 | (?im)\berror\b.+?Component.+?operation.+?not.+?allowed.+?control.+?part | |
2994 | <END_RESULT> | |
2995 | <RESULT IF_PASS COUNT 1> | |
2996 | (?is)\berror: | |
2997 | <END_RESULT> | |
2998 | <RESULT IF_PASS POSITIVE> | |
2999 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3000 | <END_RESULT> | |
3001 | ||
3002 | <END_TC> | |
3003 | :exmp. | |
3004 | ||
3005 | .*---------------------------------------------------------------------* | |
3006 | :h4.TTCN-3::ConfigOper->killed operation in the control part | |
3007 | .*---------------------------------------------------------------------* | |
3008 | :xmp tab=0. | |
3009 | <TC - TTCN-3::ConfigOper->killed operation in the control part> | |
3010 | ||
3011 | <COMPILE> | |
3012 | <VERDICT_LEAF PASS> | |
3013 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3014 | module ModuleA { | |
3015 | type component ct {}; | |
3016 | control { | |
3017 | var ct comp; | |
3018 | alt { [] comp.killed {} } | |
3019 | } | |
3020 | } | |
3021 | <END_MODULE> | |
3022 | <RESULT IF_PASS COUNT 1> | |
3023 | (?im)\berror\b.+?Component.+?operation.+?not.+?allowed.+?control.+?part | |
3024 | <END_RESULT> | |
3025 | <RESULT IF_PASS COUNT 1> | |
3026 | (?is)\berror: | |
3027 | <END_RESULT> | |
3028 | <RESULT IF_PASS POSITIVE> | |
3029 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3030 | <END_RESULT> | |
3031 | ||
3032 | <END_TC> | |
3033 | :exmp. | |
3034 | ||
3035 | .*---------------------------------------------------------------------* | |
3036 | :h4.TTCN-3::ConfigOper->any-killed operation in the control part | |
3037 | .*---------------------------------------------------------------------* | |
3038 | :xmp tab=0. | |
3039 | <TC - TTCN-3::ConfigOper->any-killed operation in the control part> | |
3040 | ||
3041 | <COMPILE> | |
3042 | <VERDICT_LEAF PASS> | |
3043 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3044 | module ModuleA { | |
3045 | type component ct {}; | |
3046 | control { | |
3047 | var ct comp; | |
3048 | alt { [] any component.killed {} } | |
3049 | } | |
3050 | } | |
3051 | <END_MODULE> | |
3052 | <RESULT IF_PASS COUNT 1> | |
3053 | (?im)\berror\b.+?Component.+?operation.+?not.+?allowed.+?control.+?part | |
3054 | <END_RESULT> | |
3055 | <RESULT IF_PASS COUNT 1> | |
3056 | (?is)\berror: | |
3057 | <END_RESULT> | |
3058 | <RESULT IF_PASS POSITIVE> | |
3059 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3060 | <END_RESULT> | |
3061 | ||
3062 | <END_TC> | |
3063 | :exmp. | |
3064 | ||
3065 | .*---------------------------------------------------------------------* | |
3066 | :h4.TTCN-3::ConfigOper->all-killed operation in the control part | |
3067 | .*---------------------------------------------------------------------* | |
3068 | :xmp tab=0. | |
3069 | <TC - TTCN-3::ConfigOper->all-killed operation in the control part> | |
3070 | ||
3071 | <COMPILE> | |
3072 | <VERDICT_LEAF PASS> | |
3073 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3074 | module ModuleA { | |
3075 | type component ct {}; | |
3076 | control { | |
3077 | var ct comp; | |
3078 | alt { [] all component.killed {} } | |
3079 | } | |
3080 | } | |
3081 | <END_MODULE> | |
3082 | <RESULT IF_PASS COUNT 1> | |
3083 | (?im)\berror\b.+?Component.+?operation.+?not.+?allowed.+?control.+?part | |
3084 | <END_RESULT> | |
3085 | <RESULT IF_PASS COUNT 1> | |
3086 | (?is)\berror: | |
3087 | <END_RESULT> | |
3088 | <RESULT IF_PASS POSITIVE> | |
3089 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3090 | <END_RESULT> | |
3091 | ||
3092 | <END_TC> | |
3093 | :exmp. | |
3094 | ||
3095 | .*---------------------------------------------------------------------* | |
3096 | :h4.TTCN-3::ConfigOper->connect operation in the control part | |
3097 | .*---------------------------------------------------------------------* | |
3098 | :xmp tab=0. | |
3099 | <TC - TTCN-3::ConfigOper->connect operation in the control part> | |
3100 | ||
3101 | <COMPILE> | |
3102 | <VERDICT_LEAF PASS> | |
3103 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3104 | module ModuleA { | |
3105 | type port Port message { inout integer }; | |
3106 | type component ct { port Port port1; } | |
3107 | function f() runs on ct {}; | |
3108 | control { | |
3109 | var ct comp; | |
3110 | connect(mtc:Port1,comp:Port1); | |
3111 | } | |
3112 | } | |
3113 | <END_MODULE> | |
3114 | <RESULT IF_PASS COUNT 1> | |
3115 | (?im)\berror\b.+?syntax.+?error | |
3116 | <END_RESULT> | |
3117 | <RESULT IF_PASS COUNT 1> | |
3118 | (?is)\berror: | |
3119 | <END_RESULT> | |
3120 | <RESULT IF_PASS POSITIVE> | |
3121 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3122 | <END_RESULT> | |
3123 | ||
3124 | <END_TC> | |
3125 | :exmp. | |
3126 | ||
3127 | .*---------------------------------------------------------------------* | |
3128 | :h4.TTCN-3::ConfigOper->disconnect operation in the control part | |
3129 | .*---------------------------------------------------------------------* | |
3130 | :xmp tab=0. | |
3131 | <TC - TTCN-3::ConfigOper->disconnect operation in the control part> | |
3132 | ||
3133 | <COMPILE> | |
3134 | <VERDICT_LEAF PASS> | |
3135 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3136 | module ModuleA { | |
3137 | type port Port message { inout integer }; | |
3138 | type component ct { port Port port1; } | |
3139 | function f() runs on ct {}; | |
3140 | control { | |
3141 | var ct comp; | |
3142 | disconnect(self:Port1,comp:Port1); | |
3143 | } | |
3144 | } | |
3145 | <END_MODULE> | |
3146 | <RESULT IF_PASS COUNT 1> | |
3147 | (?im)\berror\b.+?syntax.+?error | |
3148 | <END_RESULT> | |
3149 | <RESULT IF_PASS COUNT 1> | |
3150 | (?is)\berror: | |
3151 | <END_RESULT> | |
3152 | <RESULT IF_PASS POSITIVE> | |
3153 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3154 | <END_RESULT> | |
3155 | ||
3156 | <END_TC> | |
3157 | :exmp. | |
3158 | ||
3159 | .*---------------------------------------------------------------------* | |
3160 | :h4.TTCN-3::ConfigOper->map operation in the control part | |
3161 | .*---------------------------------------------------------------------* | |
3162 | :xmp tab=0. | |
3163 | <TC - TTCN-3::ConfigOper->map operation in the control part> | |
3164 | ||
3165 | <COMPILE> | |
3166 | <VERDICT_LEAF PASS> | |
3167 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3168 | module ModuleA { | |
3169 | type port Port message { inout integer }; | |
3170 | type component ct { port Port port1; } | |
3171 | function f() runs on ct {}; | |
3172 | control { | |
3173 | var ct comp; | |
3174 | map(comp:Port1,system:Port1); | |
3175 | } | |
3176 | } | |
3177 | <END_MODULE> | |
3178 | <RESULT IF_PASS COUNT 1> | |
3179 | (?im)\berror\b.+?syntax.+?error | |
3180 | <END_RESULT> | |
3181 | <RESULT IF_PASS COUNT 1> | |
3182 | (?is)\berror: | |
3183 | <END_RESULT> | |
3184 | <RESULT IF_PASS POSITIVE> | |
3185 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3186 | <END_RESULT> | |
3187 | ||
3188 | <END_TC> | |
3189 | :exmp. | |
3190 | ||
3191 | .*---------------------------------------------------------------------* | |
3192 | :h4.TTCN-3::ConfigOper->unmap operation in the control part | |
3193 | .*---------------------------------------------------------------------* | |
3194 | :xmp tab=0. | |
3195 | <TC - TTCN-3::ConfigOper->unmap operation in the control part> | |
3196 | ||
3197 | <COMPILE> | |
3198 | <VERDICT_LEAF PASS> | |
3199 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3200 | module ModuleA { | |
3201 | type port Port message { inout integer }; | |
3202 | type component ct { port Port port1; } | |
3203 | function f() runs on ct {}; | |
3204 | control { | |
3205 | var ct comp; | |
3206 | unmap(comp:Port1,system:Port1); | |
3207 | } | |
3208 | } | |
3209 | <END_MODULE> | |
3210 | <RESULT IF_PASS COUNT 1> | |
3211 | (?im)\berror\b.+?syntax.+?error | |
3212 | <END_RESULT> | |
3213 | <RESULT IF_PASS COUNT 1> | |
3214 | (?is)\berror: | |
3215 | <END_RESULT> | |
3216 | <RESULT IF_PASS POSITIVE> | |
3217 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3218 | <END_RESULT> | |
3219 | ||
3220 | <END_TC> | |
3221 | :exmp. | |
3222 | ||
3223 | .*---------------------------------------------------------------------* | |
3224 | :h4.TTCN-3::ConfigOper->stop operation in the if condition | |
3225 | .*---------------------------------------------------------------------* | |
3226 | :xmp tab=0. | |
3227 | <TC - TTCN-3::ConfigOper->stop operation in the if condition> | |
3228 | ||
3229 | <COMPILE> | |
3230 | <VERDICT_LEAF PASS> | |
3231 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3232 | module ModuleA { | |
3233 | type component ct {} | |
3234 | testcase tc() runs on ct { | |
3235 | var ct comp:=ct.create alive; | |
3236 | if ( comp.stop ) {} | |
3237 | } | |
3238 | } | |
3239 | <END_MODULE> | |
3240 | <RESULT IF_PASS COUNT 1> | |
3241 | (?im)\berror\b.+?syntax.+?error | |
3242 | <END_RESULT> | |
3243 | <RESULT IF_PASS COUNT 1> | |
3244 | (?is)\berror: | |
3245 | <END_RESULT> | |
3246 | <RESULT IF_PASS POSITIVE> | |
3247 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3248 | <END_RESULT> | |
3249 | ||
3250 | <END_TC> | |
3251 | :exmp. | |
3252 | ||
3253 | .*---------------------------------------------------------------------* | |
3254 | :h4.TTCN-3::ConfigOper->all-stop operation in the if condition | |
3255 | .*---------------------------------------------------------------------* | |
3256 | :xmp tab=0. | |
3257 | <TC - TTCN-3::ConfigOper->all-stop operation in the if condition> | |
3258 | ||
3259 | <COMPILE> | |
3260 | <VERDICT_LEAF PASS> | |
3261 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3262 | module ModuleA { | |
3263 | type component ct {} | |
3264 | testcase tc() runs on ct { | |
3265 | var ct comp:=ct.create alive; | |
3266 | if ( all component.stop ) {} | |
3267 | } | |
3268 | } | |
3269 | <END_MODULE> | |
3270 | <RESULT IF_PASS COUNT 1> | |
3271 | (?im)\berror\b.+?syntax.+?error | |
3272 | <END_RESULT> | |
3273 | <RESULT IF_PASS COUNT 1> | |
3274 | (?is)\berror: | |
3275 | <END_RESULT> | |
3276 | <RESULT IF_PASS POSITIVE> | |
3277 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3278 | <END_RESULT> | |
3279 | ||
3280 | <END_TC> | |
3281 | :exmp. | |
3282 | ||
3283 | .*---------------------------------------------------------------------* | |
3284 | :h4.TTCN-3::ConfigOper->kill operation in the if condition | |
3285 | .*---------------------------------------------------------------------* | |
3286 | :xmp tab=0. | |
3287 | <TC - TTCN-3::ConfigOper->kill operation in the if condition> | |
3288 | ||
3289 | <COMPILE> | |
3290 | <VERDICT_LEAF PASS> | |
3291 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3292 | module ModuleA { | |
3293 | type component ct {} | |
3294 | testcase tc() runs on ct { | |
3295 | var ct comp:=ct.create alive; | |
3296 | if ( comp.kill ) {} | |
3297 | } | |
3298 | } | |
3299 | <END_MODULE> | |
3300 | <RESULT IF_PASS COUNT 1> | |
3301 | (?im)\berror\b.+?syntax.+?error | |
3302 | <END_RESULT> | |
3303 | <RESULT IF_PASS COUNT 1> | |
3304 | (?is)\berror: | |
3305 | <END_RESULT> | |
3306 | <RESULT IF_PASS POSITIVE> | |
3307 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3308 | <END_RESULT> | |
3309 | ||
3310 | <END_TC> | |
3311 | :exmp. | |
3312 | ||
3313 | .*---------------------------------------------------------------------* | |
3314 | :h4.TTCN-3::ConfigOper->all-kill operation in the if condition | |
3315 | .*---------------------------------------------------------------------* | |
3316 | :xmp tab=0. | |
3317 | <TC - TTCN-3::ConfigOper->all-kill operation in the if condition> | |
3318 | ||
3319 | <COMPILE> | |
3320 | <VERDICT_LEAF PASS> | |
3321 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3322 | module ModuleA { | |
3323 | type component ct {} | |
3324 | testcase tc() runs on ct { | |
3325 | var ct comp:=ct.create alive; | |
3326 | if ( all component.kill ) {} | |
3327 | } | |
3328 | } | |
3329 | <END_MODULE> | |
3330 | <RESULT IF_PASS COUNT 1> | |
3331 | (?im)\berror\b.+?syntax.+?error | |
3332 | <END_RESULT> | |
3333 | <RESULT IF_PASS COUNT 1> | |
3334 | (?is)\berror: | |
3335 | <END_RESULT> | |
3336 | <RESULT IF_PASS POSITIVE> | |
3337 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3338 | <END_RESULT> | |
3339 | ||
3340 | <END_TC> | |
3341 | :exmp. | |
3342 | ||
3343 | .*---------------------------------------------------------------------* | |
3344 | :h4.TTCN-3::ConfigOper->done operation in the if condition | |
3345 | .*---------------------------------------------------------------------* | |
3346 | :xmp tab=0. | |
3347 | <TC - TTCN-3::ConfigOper->done operation in the if condition> | |
3348 | ||
3349 | <COMPILE> | |
3350 | <VERDICT_LEAF PASS> | |
3351 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3352 | module ModuleA { | |
3353 | type component ct {} | |
3354 | testcase tc() runs on ct { | |
3355 | var ct comp:=ct.create alive; | |
3356 | if ( comp.done ) {} | |
3357 | } | |
3358 | } | |
3359 | <END_MODULE> | |
3360 | <RESULT IF_PASS COUNT 1> | |
3361 | (?im)\berror\b.+?syntax.+?error | |
3362 | <END_RESULT> | |
3363 | <RESULT IF_PASS COUNT 1> | |
3364 | (?is)\berror: | |
3365 | <END_RESULT> | |
3366 | <RESULT IF_PASS POSITIVE> | |
3367 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3368 | <END_RESULT> | |
3369 | ||
3370 | <END_TC> | |
3371 | :exmp. | |
3372 | ||
3373 | .*---------------------------------------------------------------------* | |
3374 | :h4.TTCN-3::ConfigOper->any-done operation in the if condition | |
3375 | .*---------------------------------------------------------------------* | |
3376 | :xmp tab=0. | |
3377 | <TC - TTCN-3::ConfigOper->any-done operation in the if condition> | |
3378 | ||
3379 | <COMPILE> | |
3380 | <VERDICT_LEAF PASS> | |
3381 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3382 | module ModuleA { | |
3383 | type component ct {} | |
3384 | testcase tc() runs on ct { | |
3385 | var ct comp:=ct.create alive; | |
3386 | if ( any component.done ) {} | |
3387 | } | |
3388 | } | |
3389 | <END_MODULE> | |
3390 | <RESULT IF_PASS COUNT 1> | |
3391 | (?im)\berror\b.+?syntax.+?error | |
3392 | <END_RESULT> | |
3393 | <RESULT IF_PASS COUNT 1> | |
3394 | (?is)\berror: | |
3395 | <END_RESULT> | |
3396 | <RESULT IF_PASS POSITIVE> | |
3397 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3398 | <END_RESULT> | |
3399 | ||
3400 | <END_TC> | |
3401 | :exmp. | |
3402 | ||
3403 | .*---------------------------------------------------------------------* | |
3404 | :h4.TTCN-3::ConfigOper->all-done operation in the if condition | |
3405 | .*---------------------------------------------------------------------* | |
3406 | :xmp tab=0. | |
3407 | <TC - TTCN-3::ConfigOper->all-done operation in the if condition> | |
3408 | ||
3409 | <COMPILE> | |
3410 | <VERDICT_LEAF PASS> | |
3411 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3412 | module ModuleA { | |
3413 | type component ct {} | |
3414 | testcase tc() runs on ct { | |
3415 | var ct comp:=ct.create alive; | |
3416 | if ( all component.done ) {} | |
3417 | } | |
3418 | } | |
3419 | <END_MODULE> | |
3420 | <RESULT IF_PASS COUNT 1> | |
3421 | (?im)\berror\b.+?syntax.+?error | |
3422 | <END_RESULT> | |
3423 | <RESULT IF_PASS COUNT 1> | |
3424 | (?is)\berror: | |
3425 | <END_RESULT> | |
3426 | <RESULT IF_PASS POSITIVE> | |
3427 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3428 | <END_RESULT> | |
3429 | ||
3430 | <END_TC> | |
3431 | :exmp. | |
3432 | ||
3433 | .*---------------------------------------------------------------------* | |
3434 | :h4.TTCN-3::ConfigOper->killed operation in the if condition | |
3435 | .*---------------------------------------------------------------------* | |
3436 | :xmp tab=0. | |
3437 | <TC - TTCN-3::ConfigOper->killed operation in the if condition> | |
3438 | ||
3439 | <COMPILE> | |
3440 | <VERDICT_LEAF PASS> | |
3441 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3442 | module ModuleA { | |
3443 | type component ct {} | |
3444 | testcase tc() runs on ct { | |
3445 | var ct comp:=ct.create alive; | |
3446 | if ( comp.killed ) {} | |
3447 | } | |
3448 | } | |
3449 | <END_MODULE> | |
3450 | <RESULT IF_PASS COUNT 1> | |
3451 | (?im)\berror\b.+?syntax.+?error | |
3452 | <END_RESULT> | |
3453 | <RESULT IF_PASS COUNT 1> | |
3454 | (?is)\berror: | |
3455 | <END_RESULT> | |
3456 | <RESULT IF_PASS POSITIVE> | |
3457 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3458 | <END_RESULT> | |
3459 | ||
3460 | <END_TC> | |
3461 | :exmp. | |
3462 | ||
3463 | .*---------------------------------------------------------------------* | |
3464 | :h4.TTCN-3::ConfigOper->any-killed operation in the if condition | |
3465 | .*---------------------------------------------------------------------* | |
3466 | :xmp tab=0. | |
3467 | <TC - TTCN-3::ConfigOper->any-killed operation in the if condition> | |
3468 | ||
3469 | <COMPILE> | |
3470 | <VERDICT_LEAF PASS> | |
3471 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3472 | module ModuleA { | |
3473 | type component ct {} | |
3474 | testcase tc() runs on ct { | |
3475 | var ct comp:=ct.create alive; | |
3476 | if ( any component.killed ) {} | |
3477 | } | |
3478 | } | |
3479 | <END_MODULE> | |
3480 | <RESULT IF_PASS COUNT 1> | |
3481 | (?im)\berror\b.+?syntax.+?error | |
3482 | <END_RESULT> | |
3483 | <RESULT IF_PASS COUNT 1> | |
3484 | (?is)\berror: | |
3485 | <END_RESULT> | |
3486 | <RESULT IF_PASS POSITIVE> | |
3487 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3488 | <END_RESULT> | |
3489 | ||
3490 | <END_TC> | |
3491 | :exmp. | |
3492 | ||
3493 | .*---------------------------------------------------------------------* | |
3494 | :h4.TTCN-3::ConfigOper->all-killed operation in the if condition | |
3495 | .*---------------------------------------------------------------------* | |
3496 | :xmp tab=0. | |
3497 | <TC - TTCN-3::ConfigOper->all-killed operation in the if condition> | |
3498 | ||
3499 | <COMPILE> | |
3500 | <VERDICT_LEAF PASS> | |
3501 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3502 | module ModuleA { | |
3503 | type component ct {} | |
3504 | testcase tc() runs on ct { | |
3505 | var ct comp:=ct.create alive; | |
3506 | if ( all component.killed ) {} | |
3507 | } | |
3508 | } | |
3509 | <END_MODULE> | |
3510 | <RESULT IF_PASS COUNT 1> | |
3511 | (?im)\berror\b.+?syntax.+?error | |
3512 | <END_RESULT> | |
3513 | <RESULT IF_PASS COUNT 1> | |
3514 | (?is)\berror: | |
3515 | <END_RESULT> | |
3516 | <RESULT IF_PASS POSITIVE> | |
3517 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3518 | <END_RESULT> | |
3519 | ||
3520 | <END_TC> | |
3521 | :exmp. | |
3522 | ||
3523 | .*---------------------------------------------------------------------* | |
3524 | :h4.TTCN-3::ConfigOper->stop operation in the alt condition | |
3525 | .*---------------------------------------------------------------------* | |
3526 | :xmp tab=0. | |
3527 | <TC - TTCN-3::ConfigOper->stop operation in the alt condition> | |
3528 | ||
3529 | <COMPILE> | |
3530 | <VERDICT_LEAF PASS> | |
3531 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3532 | module ModuleA { | |
3533 | type component ct {} | |
3534 | testcase tc() runs on ct { | |
3535 | var ct comp:=ct.create alive; | |
3536 | alt { [] comp.stop {} } | |
3537 | } | |
3538 | } | |
3539 | <END_MODULE> | |
3540 | <RESULT IF_PASS COUNT 2> | |
3541 | (?im)\berror\b.+?syntax.+?error | |
3542 | <END_RESULT> | |
3543 | <RESULT IF_PASS COUNT 2> | |
3544 | (?is)\berror: | |
3545 | <END_RESULT> | |
3546 | <RESULT IF_PASS POSITIVE> | |
3547 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3548 | <END_RESULT> | |
3549 | ||
3550 | <END_TC> | |
3551 | :exmp. | |
3552 | ||
3553 | .*---------------------------------------------------------------------* | |
3554 | :h4.TTCN-3::ConfigOper->all-stop operation in the alt condition | |
3555 | .*---------------------------------------------------------------------* | |
3556 | :xmp tab=0. | |
3557 | <TC - TTCN-3::ConfigOper->all-stop operation in the alt condition> | |
3558 | ||
3559 | <COMPILE> | |
3560 | <VERDICT_LEAF PASS> | |
3561 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3562 | module ModuleA { | |
3563 | type component ct {} | |
3564 | testcase tc() runs on ct { | |
3565 | var ct comp:=ct.create alive; | |
3566 | alt { [] all component.stop {} } | |
3567 | } | |
3568 | } | |
3569 | <END_MODULE> | |
3570 | <RESULT IF_PASS COUNT 2> | |
3571 | (?im)\berror\b.+?syntax.+?error | |
3572 | <END_RESULT> | |
3573 | <RESULT IF_PASS COUNT 2> | |
3574 | (?is)\berror: | |
3575 | <END_RESULT> | |
3576 | <RESULT IF_PASS POSITIVE> | |
3577 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3578 | <END_RESULT> | |
3579 | ||
3580 | <END_TC> | |
3581 | :exmp. | |
3582 | ||
3583 | .*---------------------------------------------------------------------* | |
3584 | :h4.TTCN-3::ConfigOper->kill operation in the alt condition | |
3585 | .*---------------------------------------------------------------------* | |
3586 | :xmp tab=0. | |
3587 | <TC - TTCN-3::ConfigOper->kill operation in the alt condition> | |
3588 | ||
3589 | <COMPILE> | |
3590 | <VERDICT_LEAF PASS> | |
3591 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3592 | module ModuleA { | |
3593 | type component ct {} | |
3594 | testcase tc() runs on ct { | |
3595 | var ct comp:=ct.create alive; | |
3596 | alt { [] comp.kill {} } | |
3597 | } | |
3598 | } | |
3599 | <END_MODULE> | |
3600 | <RESULT IF_PASS COUNT 2> | |
3601 | (?im)\berror\b.+?syntax.+?error | |
3602 | <END_RESULT> | |
3603 | <RESULT IF_PASS COUNT 2> | |
3604 | (?is)\berror: | |
3605 | <END_RESULT> | |
3606 | <RESULT IF_PASS POSITIVE> | |
3607 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3608 | <END_RESULT> | |
3609 | ||
3610 | <END_TC> | |
3611 | :exmp. | |
3612 | ||
3613 | .*---------------------------------------------------------------------* | |
3614 | :h4.TTCN-3::ConfigOper->all-kill operation in the alt condition | |
3615 | .*---------------------------------------------------------------------* | |
3616 | :xmp tab=0. | |
3617 | <TC - TTCN-3::ConfigOper->all-kill operation in the alt condition> | |
3618 | ||
3619 | <COMPILE> | |
3620 | <VERDICT_LEAF PASS> | |
3621 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3622 | module ModuleA { | |
3623 | type component ct {} | |
3624 | testcase tc() runs on ct { | |
3625 | var ct comp:=ct.create alive; | |
3626 | alt { [] all component.kill {} } | |
3627 | } | |
3628 | } | |
3629 | <END_MODULE> | |
3630 | <RESULT IF_PASS COUNT 2> | |
3631 | (?im)\berror\b.+?syntax.+?error | |
3632 | <END_RESULT> | |
3633 | <RESULT IF_PASS COUNT 2> | |
3634 | (?is)\berror: | |
3635 | <END_RESULT> | |
3636 | <RESULT IF_PASS POSITIVE> | |
3637 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3638 | <END_RESULT> | |
3639 | ||
3640 | <END_TC> | |
3641 | :exmp. | |
3642 | ||
3643 | .*---------------------------------------------------------------------* | |
3644 | :h4.TTCN-3::ConfigOper->alive operation in the alt condition | |
3645 | .*---------------------------------------------------------------------* | |
3646 | :xmp tab=0. | |
3647 | <TC - TTCN-3::ConfigOper->alive operation in the alt condition> | |
3648 | ||
3649 | <COMPILE> | |
3650 | <VERDICT_LEAF PASS> | |
3651 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3652 | module ModuleA { | |
3653 | type component ct {} | |
3654 | testcase tc() runs on ct { | |
3655 | var ct comp:=ct.create alive; | |
3656 | alt { [] comp.alive {} } | |
3657 | } | |
3658 | } | |
3659 | <END_MODULE> | |
3660 | <RESULT IF_PASS COUNT 2> | |
3661 | (?im)\berror\b.+?syntax.+?error | |
3662 | <END_RESULT> | |
3663 | <RESULT IF_PASS COUNT 2> | |
3664 | (?is)\berror: | |
3665 | <END_RESULT> | |
3666 | <RESULT IF_PASS POSITIVE> | |
3667 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3668 | <END_RESULT> | |
3669 | ||
3670 | <END_TC> | |
3671 | :exmp. | |
3672 | ||
3673 | .*---------------------------------------------------------------------* | |
3674 | :h4.TTCN-3::ConfigOper->any-alive operation in the alt condition | |
3675 | .*---------------------------------------------------------------------* | |
3676 | :xmp tab=0. | |
3677 | <TC - TTCN-3::ConfigOper->any-alive operation in the alt condition> | |
3678 | ||
3679 | <COMPILE> | |
3680 | <VERDICT_LEAF PASS> | |
3681 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3682 | module ModuleA { | |
3683 | type component ct {} | |
3684 | testcase tc() runs on ct { | |
3685 | var ct comp:=ct.create alive; | |
3686 | alt { [] any component.alive {} } | |
3687 | } | |
3688 | } | |
3689 | <END_MODULE> | |
3690 | <RESULT IF_PASS COUNT 2> | |
3691 | (?im)\berror\b.+?syntax.+?error | |
3692 | <END_RESULT> | |
3693 | <RESULT IF_PASS COUNT 2> | |
3694 | (?is)\berror: | |
3695 | <END_RESULT> | |
3696 | <RESULT IF_PASS POSITIVE> | |
3697 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3698 | <END_RESULT> | |
3699 | ||
3700 | <END_TC> | |
3701 | :exmp. | |
3702 | ||
3703 | .*---------------------------------------------------------------------* | |
3704 | :h4.TTCN-3::ConfigOper->all-alive operation in the alt condition | |
3705 | .*---------------------------------------------------------------------* | |
3706 | :xmp tab=0. | |
3707 | <TC - TTCN-3::ConfigOper->all-alive operation in the alt condition> | |
3708 | ||
3709 | <COMPILE> | |
3710 | <VERDICT_LEAF PASS> | |
3711 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3712 | module ModuleA { | |
3713 | type component ct {} | |
3714 | testcase tc() runs on ct { | |
3715 | var ct comp:=ct.create alive; | |
3716 | alt { [] all component.alive {} } | |
3717 | } | |
3718 | } | |
3719 | <END_MODULE> | |
3720 | <RESULT IF_PASS COUNT 2> | |
3721 | (?im)\berror\b.+?syntax.+?error | |
3722 | <END_RESULT> | |
3723 | <RESULT IF_PASS COUNT 2> | |
3724 | (?is)\berror: | |
3725 | <END_RESULT> | |
3726 | <RESULT IF_PASS POSITIVE> | |
3727 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3728 | <END_RESULT> | |
3729 | ||
3730 | <END_TC> | |
3731 | :exmp. | |
3732 | ||
3733 | .*---------------------------------------------------------------------* | |
3734 | :h4.TTCN-3::ConfigOper->running operation in the alt condition | |
3735 | .*---------------------------------------------------------------------* | |
3736 | :xmp tab=0. | |
3737 | <TC - TTCN-3::ConfigOper->running operation in the alt condition> | |
3738 | ||
3739 | <COMPILE> | |
3740 | <VERDICT_LEAF PASS> | |
3741 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3742 | module ModuleA { | |
3743 | type component ct {} | |
3744 | testcase tc() runs on ct { | |
3745 | var ct comp:=ct.create alive; | |
3746 | alt { [] comp.running {} } | |
3747 | } | |
3748 | } | |
3749 | <END_MODULE> | |
3750 | <RESULT IF_PASS COUNT 2> | |
3751 | (?im)\berror\b.+?syntax.+?error | |
3752 | <END_RESULT> | |
3753 | <RESULT IF_PASS COUNT 2> | |
3754 | (?is)\berror: | |
3755 | <END_RESULT> | |
3756 | <RESULT IF_PASS POSITIVE> | |
3757 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3758 | <END_RESULT> | |
3759 | ||
3760 | <END_TC> | |
3761 | :exmp. | |
3762 | ||
3763 | .*---------------------------------------------------------------------* | |
3764 | :h4.TTCN-3::ConfigOper->any-running operation in the alt condition | |
3765 | .*---------------------------------------------------------------------* | |
3766 | :xmp tab=0. | |
3767 | <TC - TTCN-3::ConfigOper->any-running operation in the alt condition> | |
3768 | ||
3769 | <COMPILE> | |
3770 | <VERDICT_LEAF PASS> | |
3771 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3772 | module ModuleA { | |
3773 | type component ct {} | |
3774 | testcase tc() runs on ct { | |
3775 | var ct comp:=ct.create alive; | |
3776 | alt { [] any component.running {} } | |
3777 | } | |
3778 | } | |
3779 | <END_MODULE> | |
3780 | <RESULT IF_PASS COUNT 2> | |
3781 | (?im)\berror\b.+?syntax.+?error | |
3782 | <END_RESULT> | |
3783 | <RESULT IF_PASS COUNT 2> | |
3784 | (?is)\berror: | |
3785 | <END_RESULT> | |
3786 | <RESULT IF_PASS POSITIVE> | |
3787 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3788 | <END_RESULT> | |
3789 | ||
3790 | <END_TC> | |
3791 | :exmp. | |
3792 | ||
3793 | .*---------------------------------------------------------------------* | |
3794 | :h4.TTCN-3::ConfigOper->all-running operation in the alt condition | |
3795 | .*---------------------------------------------------------------------* | |
3796 | :xmp tab=0. | |
3797 | <TC - TTCN-3::ConfigOper->all-running operation in the alt condition> | |
3798 | ||
3799 | <COMPILE> | |
3800 | <VERDICT_LEAF PASS> | |
3801 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3802 | module ModuleA { | |
3803 | type component ct {} | |
3804 | testcase tc() runs on ct { | |
3805 | var ct comp:=ct.create alive; | |
3806 | alt { [] all component.running {} } | |
3807 | } | |
3808 | } | |
3809 | <END_MODULE> | |
3810 | <RESULT IF_PASS COUNT 2> | |
3811 | (?im)\berror\b.+?syntax.+?error | |
3812 | <END_RESULT> | |
3813 | <RESULT IF_PASS COUNT 2> | |
3814 | (?is)\berror: | |
3815 | <END_RESULT> | |
3816 | <RESULT IF_PASS POSITIVE> | |
3817 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3818 | <END_RESULT> | |
3819 | ||
3820 | <END_TC> | |
3821 | :exmp. | |
3822 | ||
3823 | .*---------------------------------------------------------------------* | |
3824 | :h4.TTCN-3::ConfigOper->create name is not charstring | |
3825 | .*---------------------------------------------------------------------* | |
3826 | :xmp tab=0. | |
3827 | <TC - TTCN-3::ConfigOper->create name is not charstring> | |
3828 | ||
3829 | <COMPILE> | |
3830 | <VERDICT_LEAF PASS> | |
3831 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3832 | module ModuleA { | |
3833 | type component ct {}; | |
3834 | function f() { | |
3835 | var ct comp := ct.create (5); | |
3836 | var ct comp1 := ct.create ('01001'B) alive; | |
3837 | } | |
3838 | altstep a() { | |
3839 | var ct comp := ct.create ('3C'O); | |
3840 | var ct comp1 := ct.create (false) alive; | |
3841 | [else] {} | |
3842 | } | |
3843 | testcase tc() runs on ct { | |
3844 | var ct comp := ct.create (5.6); | |
3845 | var ct comp1 := ct.create ('ffb9a'H) alive; | |
3846 | } | |
3847 | } | |
3848 | <END_MODULE> | |
3849 | <RESULT IF_PASS COUNT 6> | |
3850 | (?im)\berror\b.+?First.+?operand.+?should.+?be.+?charstring | |
3851 | <END_RESULT> | |
3852 | <RESULT IF_PASS COUNT 6> | |
3853 | (?is)\berror: | |
3854 | <END_RESULT> | |
3855 | <RESULT IF_PASS POSITIVE> | |
3856 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3857 | <END_RESULT> | |
3858 | ||
3859 | <END_TC> | |
3860 | :exmp. | |
3861 | ||
3862 | .*---------------------------------------------------------------------* | |
3863 | :h4.TTCN-3::ConfigOper->Scope: component variable - create alive | |
3864 | .*---------------------------------------------------------------------* | |
3865 | :xmp tab=0. | |
3866 | <TC - TTCN-3::ConfigOper->Scope: component variable - create alive> | |
3867 | ||
3868 | <COMPILE> | |
3869 | <VERDICT_LEAF PASS> | |
3870 | <MODULE TTCN ModuleA ModuleA.ttcn> | |
3871 | module ModuleA { | |
3872 | type component ct {}; | |
3873 | testcase tc() runs on ct { | |
3874 | if (true) { | |
3875 | var ct comp := ct.create ("alive") alive; | |
3876 | } | |
3877 | if ( comp.alive ) {} | |
3878 | } | |
3879 | } | |
3880 | <END_MODULE> | |
3881 | <RESULT IF_PASS COUNT 1> | |
3882 | (?im)\berror\b.+?no.+?local.+?or.+?imported.+?definition.+?comp | |
3883 | <END_RESULT> | |
3884 | <RESULT IF_PASS COUNT 1> | |
3885 | (?is)\berror: | |
3886 | <END_RESULT> | |
3887 | <RESULT IF_PASS POSITIVE> | |
3888 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
3889 | <END_RESULT> | |
3890 | ||
3891 | <END_TC> | |
3892 | :exmp. | |
3893 | ||
3894 | :p. | |
3895 | .*---------------------------------------------------------------------* | |
3896 | :h3.The Interleave statement | |
3897 | .*---------------------------------------------------------------------* | |
3898 | :nl.This test case group covers the requirement SA-9/20. | |
3899 | :p. Explanation: | |
3900 | :nl.- The interleave statement allows to specify the interleaved occurrence | |
3901 | :nl. and handling of the statements done, killed, timeout, receive, trigger, | |
3902 | getcall, catch and check. | |
3903 | :nl.- Control transfer statements for, while, do-while, goto, stop, repeat, | |
3904 | :nl. return, activate, deactivate, direct call of altsteps as alternatives | |
3905 | :nl. and (direct and indirect) calls of user-defined functions, which include | |
3906 | :nl. communication operations, shall not be used in interleave statements. | |
3907 | :nl.- It is not allowed to guard branches of an interleave statement with | |
3908 | Boolean expressions (i.e. the '[ ]' shall always be empty). | |
3909 | :nl. It is also not allowed to specify else branches in interleaved behaviour. | |
3910 | ||
3911 | :p. TTCN-3 language extensions: | |
3912 | :nl.- Loop constructs for, while and do-while loops are accepted and supported | |
3913 | without any restriction in interleave statements. | |
3914 | :nl.- Statements activate, deactivate and stop can also be used within interleave. |