Commit | Line | Data |
---|---|---|
970ed795 | 1 | .****************************************************************************** |
3abe9331 | 2 | .* Copyright (c) 2000-2015 Ericsson Telecom AB |
970ed795 EL |
3 | .* All rights reserved. This program and the accompanying materials |
4 | .* are made available under the terms of the Eclipse Public License v1.0 | |
5 | .* which accompanies this distribution, and is available at | |
6 | .* http://www.eclipse.org/legal/epl-v10.html | |
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.22/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: Implicit message encoding | |
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 2007-01-31 EDMDELI New document for TITAN R7 | |
37 | A 2007-03-06 EJNOSZA Approved after review | |
38 | B 2007-06-01 ETHNBA New TCs added for 'discard' mapping | |
39 | C 2009-06-11 EFERKOV No more name clashes | |
40 | D 2010-07-02 EKRISZA corrected version information | |
41 | A 2011-12-12 EKRISZA Updated for release | |
42 | A 2012-06-27 EFERKOV Updated for release | |
43 | A 2013-01-17 EKRIPND Updated for release | |
44 | :exmp. | |
45 | .*---------------------------------------------------------------------* | |
46 | :h2.Purpose | |
47 | .*---------------------------------------------------------------------* | |
48 | The purpose of this Test Description is to define and describe the function | |
49 | test activity for the Semantic Analyser functionality of the TTCN-3 compiler: | |
50 | :nl.SA-10/x: Implicit message encoding. | |
51 | :p.The specification of the test cases can be found in this document. | |
52 | .*---------------------------------------------------------------------* | |
53 | :h1.Test environment | |
54 | .*---------------------------------------------------------------------* | |
55 | .*---------------------------------------------------------------------* | |
56 | :h2.Hardware | |
57 | .*---------------------------------------------------------------------* | |
58 | No specific hardware requirement. | |
59 | .*---------------------------------------------------------------------* | |
60 | :h2.Software | |
61 | .*---------------------------------------------------------------------* | |
62 | Tests shall be carried out on the following platforms: | |
63 | :list. | |
64 | :li D='1.'.Solaris 8 (Sun OS 5.8) (gcc 3.0.4) | |
65 | :li D='2.'.SUSE Linux Enterprise server 8 (2.4.19-4GB) (gcc 3.2) | |
66 | :li D='3.'.CYGWIN_NT-5.0 (Cygwin DLL: 1.5.12) on Windows 2000 (gcc 3.3.3) | |
67 | :elist. | |
68 | .*---------------------------------------------------------------------* | |
69 | :h2.Configuration | |
70 | .*---------------------------------------------------------------------* | |
71 | The test environment had been setup in CVS. The tester program is stored in: | |
72 | :nl.TTCNv3/function_test/Tools/SAtester.pl | |
73 | :nl.Test cases are stored with extension .script in the directory: | |
74 | :nl.TTCNv3/function_test/Semantic_Analyser/ | |
75 | .*---------------------------------------------------------------------* | |
76 | :h2.Installation | |
77 | .*---------------------------------------------------------------------* | |
78 | Install proper TITAN binaries on the used platforms and make sure that | |
79 | your environment settings are correct: | |
80 | :list. | |
81 | :li D='1.'.TTCN3_DIR is set | |
82 | :li D='2.'.$TTCN3_DIR/bin is added to the PATH variable | |
83 | :li D='3.'.$TTCN3_DIR/lib is added to the LD_LIBRARY_PATH variable | |
84 | :li D='4.'.Perl 5.6.0 or higher is available on the platform | |
85 | :li D='5.'.Create a symlink to your Perl binary into the directory where the | |
86 | test cases are stored: | |
87 | :nl.ln -s <your Perl> perl | |
88 | :elist. | |
89 | .*---------------------------------------------------------------------* | |
90 | :h2.Test Tools | |
91 | .*---------------------------------------------------------------------* | |
92 | A tester program had been written in Perl especially for the Semantic Analyser | |
93 | tests. For the list of command line parameters, type 'SAtester.pl -help', for the | |
94 | complete documentation, type 'SAtester.pl -doc'. | |
95 | :p.Test cases are specified in the Test Description documents in EDML format. | |
96 | The tester program parses these files and generates the TTCN-3/ASN.1 modules, then | |
97 | calls the compiler to compile them. The result printout is then matched against | |
98 | different patterns to be able to set the verdict. Test cases contain not only | |
99 | the source modules, but the patterns as well. | |
100 | :p.The tester program allows one-by-one execution of test cases and batched | |
101 | execution as well. | |
102 | :p.NOTE: the tester program requires Perl 5.6.0 or higher. | |
103 | .*---------------------------------------------------------------------* | |
104 | :h1.Test cases | |
105 | .*---------------------------------------------------------------------* | |
106 | Ref [1]: SA-10/x: Implicit message encoding | |
107 | ||
108 | ||
109 | .*---------------------------------------------------------------------* | |
110 | :h2.Encoder/Decoder functions: extension attribute tests | |
111 | .*---------------------------------------------------------------------* | |
112 | This test case group covers the requirement SA-10/1. | |
113 | ||
114 | The test cases below test the non-standard extension attribute used to | |
115 | define encoder/decoder functions. All 4 prototypes are tested (convert, | |
116 | fast, backtrack, sliding). Tests include negative and positive tests for | |
117 | both syntax and semantics. | |
118 | ||
119 | .*---------------------------------------------------------------------* | |
120 | :h3.Encoder/Decoder function, missing with attribute | |
121 | .*---------------------------------------------------------------------* | |
122 | :xmp tab=0. | |
123 | ||
124 | <TC - Encoder/Decoder function, missing with attribute> | |
125 | ||
126 | <COMPILE> | |
127 | <VERDICT_LEAF PASS> | |
128 | <MODULE TTCN Temp Temp.ttcn> | |
129 | module Temp { | |
130 | type record MyPDU { | |
131 | integer i, | |
132 | float f | |
133 | } | |
134 | external function f_converter(in octetstring os) return MyPDU; | |
135 | } | |
136 | <END_MODULE> | |
137 | <RESULT IF_PASS NEGATIVE> | |
138 | (?is)\berror: | |
139 | <END_RESULT> | |
140 | <RESULT IF_PASS POSITIVE> | |
141 | (?im)Notify: File `Temp.hh' was generated. | |
142 | <END_RESULT> | |
143 | <END_TC> | |
144 | ||
145 | :exmp. | |
146 | ||
147 | ||
148 | .*---------------------------------------------------------------------* | |
149 | :h3.Encoder/Decoder function, prototypes without encoding | |
150 | .*---------------------------------------------------------------------* | |
151 | :xmp tab=0. | |
152 | ||
153 | <TC - Encoder/Decoder function, prototypes without encoding> | |
154 | ||
155 | <COMPILE> | |
156 | <VERDICT_LEAF PASS> | |
157 | <MODULE TTCN Temp Temp.ttcn> | |
158 | module Temp { | |
159 | type record MyPDU { | |
160 | integer i, | |
161 | float f | |
162 | } | |
163 | ||
164 | external function f_converter_decode(in octetstring os) return MyPDU | |
165 | with { extension "prototype(convert)" } | |
166 | external function f_converter_encode(in MyPDU pdu) return octetstring | |
167 | with { extension "prototype(convert)" } | |
168 | group G { | |
169 | external function f_fast_encode(in MyPDU pdu, out octetstring os); | |
170 | external function f_fast_decode(in octetstring os, out MyPDU pdu); | |
171 | } with { extension "prototype(fast)" } | |
172 | } | |
173 | <END_MODULE> | |
174 | <RESULT IF_PASS NEGATIVE> | |
175 | (?is)\berror: | |
176 | <END_RESULT> | |
177 | <RESULT IF_PASS POSITIVE> | |
178 | (?im)Notify: File `Temp.hh' was generated. | |
179 | <END_RESULT> | |
180 | <END_TC> | |
181 | ||
182 | :exmp. | |
183 | ||
184 | .*---------------------------------------------------------------------* | |
185 | :h3.Encoder/Decoder functions | |
186 | .*---------------------------------------------------------------------* | |
187 | :xmp tab=0. | |
188 | ||
189 | <TC - Encoder/Decoder functions> | |
190 | ||
191 | <COMPILE> | |
192 | <VERDICT_LEAF PASS> | |
193 | <MODULE TTCN Temp Temp.ttcn> | |
194 | module Temp { | |
195 | type record MyPDU { | |
196 | integer i, | |
197 | float f | |
198 | } with { encode "RAW"; variant "" } | |
199 | external function f_convert_decode(in octetstring os) return MyPDU | |
200 | with { extension " prototype ( convert ) decode(RAW) " } | |
201 | external function f_convert_encode(in MyPDU p_pdu) return octetstring | |
202 | with { extension " prototype ( convert ) encode(RAW) " } | |
203 | group G { | |
204 | external function f_fast_decode(in octetstring os, out MyPDU pdu) | |
205 | with { extension "decode(RAW)" } | |
206 | external function f_fast_encode(in MyPDU pdu, out octetstring os) | |
207 | with { extension "encode(RAW)" } | |
208 | } with { extension " prototype (fast) " } | |
209 | external function f_backtrack_decoder(in octetstring os, out MyPDU pdu) return integer | |
210 | with { extension " prototype ( backtrack ) decode(RAW) " } | |
211 | external function f_sliding_decoder(inout octetstring os, out MyPDU pdu) return integer | |
212 | with { extension " prototype ( sliding ) decode(RAW) " } | |
213 | } | |
214 | <END_MODULE> | |
215 | <RESULT IF_PASS NEGATIVE> | |
216 | (?is)\berror: | |
217 | <END_RESULT> | |
218 | <RESULT IF_PASS POSITIVE> | |
219 | (?im)Notify: File `Temp.hh' was generated. | |
220 | <END_RESULT> | |
221 | <END_TC> | |
222 | ||
223 | :exmp. | |
224 | ||
225 | .*---------------------------------------------------------------------* | |
226 | :h3.Encoder/Decoder functions, invalid or missing prototype | |
227 | .*---------------------------------------------------------------------* | |
228 | :xmp tab=0. | |
229 | ||
230 | <TC - Encoder/Decoder functions, invalid or missing prototype> | |
231 | ||
232 | <COMPILE> | |
233 | <VERDICT_LEAF PASS> | |
234 | <MODULE TTCN Temp Temp.ttcn> | |
235 | module Temp { | |
236 | type record MyPDU { | |
237 | integer i, | |
238 | float f | |
239 | } with { encode "RAW"; variant "" } | |
240 | external function f_converter1(in MyPDU p_pdu) return octetstring | |
241 | with { | |
242 | extension "prototype( module ) encode(RAW)" | |
243 | } | |
244 | external function f_converter2(in MyPDU p_pdu) return octetstring | |
245 | with { | |
246 | extension "prototype( prototype ) encode(RAW)" | |
247 | } | |
248 | external function f_converter3(in MyPDU p_pdu) return octetstring | |
249 | with { | |
250 | extension "prototype() encode(RAW)" | |
251 | } | |
252 | external function f_converter4(in MyPDU p_pdu) return octetstring | |
253 | with { | |
254 | extension "prototype encode(RAW)" | |
255 | } | |
256 | } | |
257 | <END_MODULE> | |
258 | <RESULT IF_PASS COUNT 4> | |
259 | (?is)\berror: | |
260 | <END_RESULT> | |
261 | <RESULT IF_PASS POSITIVE> | |
262 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
263 | <END_RESULT> | |
264 | <END_TC> | |
265 | ||
266 | :exmp. | |
267 | ||
268 | .*---------------------------------------------------------------------* | |
269 | :h3.Encoder/Decoder functions, invalid codec | |
270 | .*---------------------------------------------------------------------* | |
271 | :xmp tab=0. | |
272 | ||
273 | <TC - Encoder/Decoder functions, invalid codec> | |
274 | ||
275 | <COMPILE> | |
276 | <VERDICT_LEAF PASS> | |
277 | <MODULE TTCN Temp Temp.ttcn> | |
278 | module Temp { | |
279 | type record MyPDU { | |
280 | integer i, | |
281 | float f | |
282 | } | |
283 | external function f_converter1(in MyPDU p_pdu) return octetstring | |
284 | with { | |
285 | extension "prototype( convert ) encode" | |
286 | } | |
287 | external function f_converter2(in MyPDU p_pdu) return octetstring | |
288 | with { | |
289 | extension "prototype(convert) encode(CER)" | |
290 | } | |
291 | external function f_converter3(in MyPDU p_pdu) return octetstring | |
292 | with { | |
293 | extension "prototype(convert) encode(BER: " | |
294 | } | |
295 | external function f_converter4(in MyPDU p_pdu) return octetstring | |
296 | with { | |
297 | extension "prototype(convert) encode(RAW nonexistent)" | |
298 | } | |
299 | external function f_converter5(in MyPDU p_pdu) return octetstring | |
300 | with { | |
301 | extension "prototype(convert) encode(nonexistent)" | |
302 | } | |
303 | } | |
304 | <END_MODULE> | |
305 | <RESULT IF_PASS COUNT 5> | |
306 | (?is)\berror: | |
307 | <END_RESULT> | |
308 | <RESULT IF_PASS POSITIVE> | |
309 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
310 | <END_RESULT> | |
311 | <END_TC> | |
312 | ||
313 | :exmp. | |
314 | ||
315 | .*---------------------------------------------------------------------* | |
316 | :h3.Encoder/Decoder functions, multiple prototypes, multiple encodes | |
317 | .*---------------------------------------------------------------------* | |
318 | :xmp tab=0. | |
319 | ||
320 | <TC - Encoder/Decoder functions, multiple prototypes, multiple encodes> | |
321 | ||
322 | <COMPILE> | |
323 | <VERDICT_LEAF PASS> | |
324 | <MODULE TTCN Temp Temp.ttcn> | |
325 | module Temp { | |
326 | type record MyPDU { | |
327 | integer i, | |
328 | float f | |
329 | } with { encode "RAW"; variant "" } | |
330 | group G { | |
331 | external function f_converter1(in MyPDU p_pdu) return octetstring | |
332 | with { extension "prototype(convert) encode(RAW)" } | |
333 | external function f_converter2(in MyPDU p_pdu) return octetstring | |
334 | with { extension "encode(RAW)" } | |
335 | } with { extension "prototype(convert)" } | |
336 | group G1 { | |
337 | group G2 { | |
338 | external function f_converter3(in MyPDU p_pdu) return octetstring | |
339 | } with { extension "encode(RAW)" } | |
340 | group G3 { | |
341 | external function f_converter4(in MyPDU p_pdu) return octetstring | |
342 | } | |
343 | } with { extension "prototype(convert) encode(RAW) " } | |
344 | external function f_converter5(in MyPDU p_pdu) return octetstring | |
345 | with { extension "prototype(fast) prototype(convert) encode(RAW)" } | |
346 | external function f_converter6(in MyPDU p_pdu) return octetstring | |
347 | with { extension "prototype(convert) encode(TEXT) encode(RAW)" } | |
348 | } | |
349 | <END_MODULE> | |
350 | <RESULT IF_PASS COUNT 4> | |
351 | (?is)\berror: | |
352 | <END_RESULT> | |
353 | <RESULT IF_PASS POSITIVE> | |
354 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
355 | <END_RESULT> | |
356 | <END_TC> | |
357 | ||
358 | :exmp. | |
359 | ||
360 | .*---------------------------------------------------------------------* | |
361 | :h3.Encoder/Decoder functions, valid codec options | |
362 | .*---------------------------------------------------------------------* | |
363 | :xmp tab=0. | |
364 | ||
365 | <TC - Encoder/Decoder functions, valid codec options> | |
366 | ||
367 | <COMPILE> | |
368 | <VERDICT_LEAF PASS> | |
369 | <MODULE TTCN Temp Temp.ttcn> | |
370 | module Temp { | |
371 | type record MyPDU { float f } with { encode "RAW"; variant "" } | |
372 | type record MyPDUtxt { integer i } with { encode "TEXT"; variant "TEXT_CODING()" } | |
373 | external function f_converter1(in MyPDU p_pdu) return octetstring | |
374 | with { extension "prototype(convert) encode(RAW:nonexistent)" } | |
375 | external function f_converter2(in MyPDUtxt p_pdu) return charstring | |
376 | with { extension "prototype(convert) encode(TEXT:nonexistent)" } | |
377 | external function f_converter3(in MyPDUtxt p_pdu) return charstring | |
378 | with { extension "prototype(convert) encode(TEXT:nonexi() hehe(haha()),what?!)" } | |
379 | } | |
380 | <END_MODULE> | |
381 | <RESULT IF_PASS NEGATIVE> | |
382 | (?is)\berror: | |
383 | <END_RESULT> | |
384 | <RESULT IF_PASS POSITIVE> | |
385 | (?im)Notify: File `Temp.hh' was generated. | |
386 | <END_RESULT> | |
387 | <END_TC> | |
388 | ||
389 | :exmp. | |
390 | ||
391 | .*---------------------------------------------------------------------* | |
392 | :h3.Encoder/Decoder functions, valid errorbehaviors | |
393 | .*---------------------------------------------------------------------* | |
394 | :xmp tab=0. | |
395 | ||
396 | <TC - Encoder/Decoder functions, valid errorbehaviors> | |
397 | <COMPILE> | |
398 | <VERDICT_LEAF PASS> | |
399 | <MODULE TTCN Temp Temp.ttcn> | |
400 | module Temp { | |
401 | type record MyPDU { | |
402 | integer i, | |
403 | float f | |
404 | } with { encode "RAW"; variant "" } | |
405 | group G { | |
406 | external function f_converter1(in MyPDU p_pdu) return octetstring | |
407 | with { extension "errorbehavior(UNBOUND:DEFAULT)" } | |
408 | external function f_converter2(in MyPDU p_pdu) return octetstring | |
409 | with { extension "errorbehavior(UNBOUND:DEFAULT,REPR:ERROR)" } | |
410 | group Gf3 { | |
411 | external function f_converter3(in MyPDU p_pdu) return octetstring | |
412 | with { extension "errorbehavior(ENC_ENUM:WARNING,DEC_ENUM:WARNING) errorbehavior(REPR:ERROR)" } | |
413 | } with { extension "errorbehavior(UNBOUND:DEFAULT)" } | |
414 | external function f_converter4(in MyPDU p_pdu) return octetstring | |
415 | with { extension "errorbehavior(FOO:BAR)" } | |
416 | } with { extension "prototype(convert) encode(RAW)" } | |
417 | } | |
418 | <END_MODULE> | |
419 | <RESULT IF_PASS NEGATIVE> | |
420 | (?is)\berror: | |
421 | <END_RESULT> | |
422 | <RESULT IF_PASS COUNT 2> | |
423 | (?im)\bwarning:.+is not a valid error | |
424 | <END_RESULT> | |
425 | <RESULT IF_PASS POSITIVE> | |
426 | (?im)Notify: File `Temp.hh' was generated. | |
427 | <END_RESULT> | |
428 | <END_TC> | |
429 | ||
430 | :exmp. | |
431 | ||
432 | .*---------------------------------------------------------------------* | |
433 | :h3.Encoder/Decoder functions, invalid errorbehaviors | |
434 | .*---------------------------------------------------------------------* | |
435 | :xmp tab=0. | |
436 | ||
437 | <TC - Encoder/Decoder functions, invalid errorbehaviors> | |
438 | <COMPILE> | |
439 | <VERDICT_LEAF PASS> | |
440 | <MODULE TTCN Temp Temp.ttcn> | |
441 | module Temp { | |
442 | type record MyPDU { | |
443 | integer i, | |
444 | float f | |
445 | } | |
446 | external function f_converter1(in MyPDU p_pdu) return octetstring | |
447 | with { extension "prototype(convert) encode(RAW) errorbehavior" } | |
448 | external function f_converter2(in MyPDU p_pdu) return octetstring | |
449 | with { extension "prototype(convert) errorbehavior( encode(RAW)" } | |
450 | external function f_converter3(in MyPDU p_pdu) return octetstring | |
451 | with { extension "prototype(convert) encode(RAW) errorbehavior(error)" } | |
452 | external function f_converter4(in MyPDU p_pdu) return octetstring | |
453 | with { extension "prototype(convert) encode(RAW) errorbehavior(FOO:BAR,error)" } | |
454 | } with { encode "RAW"; variant "" } | |
455 | <END_MODULE> | |
456 | <RESULT IF_PASS COUNT 4> | |
457 | (?is)\berror: | |
458 | <END_RESULT> | |
459 | <RESULT IF_PASS POSITIVE> | |
460 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
461 | <END_RESULT> | |
462 | <END_TC> | |
463 | ||
464 | :exmp. | |
465 | ||
466 | ||
467 | .*---------------------------------------------------------------------* | |
468 | :h2.Encoder/Decoder functions: function parameters and return type | |
469 | .*---------------------------------------------------------------------* | |
470 | This test case group covers the requirement SA-10/2. | |
471 | ||
472 | The test cases below test the function parameters and return type used in | |
473 | define encoder/decoder functions. All 4 prototypes are tested (convert, | |
474 | fast, backtrack, sliding). Tests include negative and positive tests for | |
475 | both syntax and semantics. | |
476 | ||
477 | .*---------------------------------------------------------------------* | |
478 | :h3.Encoder/Decoder functions, valid funcs of all types | |
479 | .*---------------------------------------------------------------------* | |
480 | :xmp tab=0. | |
481 | ||
482 | <TC - Encoder/Decoder functions, valid funcs of all types> | |
483 | ||
484 | <COMPILE> | |
485 | <VERDICT_LEAF PASS> | |
486 | <MODULE TTCN Temp Temp.ttcn> | |
487 | module Temp { | |
488 | type record MyPDU { | |
489 | integer i, | |
490 | float f | |
491 | } | |
492 | group G_converter { | |
493 | external function f_convert_decode(in octetstring os) return MyPDU | |
494 | with { extension "decode(RAW)" } | |
495 | external function f_convert_encode(in MyPDU pdu) return octetstring | |
496 | with { extension "encode(RAW)" } | |
497 | } with { extension "prototype(convert)" } | |
498 | group G_fast { | |
499 | external function f_fast_decode(in octetstring os, out MyPDU pdu) | |
500 | with { extension "decode(RAW)" } | |
501 | external function f_fast_encode(in MyPDU pdu, out octetstring os) | |
502 | with { extension "encode(RAW)" } | |
503 | } with { extension "prototype(fast)" } | |
504 | group G_decode { | |
505 | external function f_backtrack_decode(in octetstring os, out MyPDU pdu) return integer | |
506 | with { extension "prototype(backtrack)" } | |
507 | external function f_sliding_decode(inout octetstring os, out MyPDU pdu) return integer | |
508 | with { extension "prototype(sliding)" } | |
509 | } with { extension "decode(RAW)" } | |
510 | } with { encode "RAW"; variant "" extension "errorbehavior(ALL:ERROR)" } | |
511 | <END_MODULE> | |
512 | <RESULT IF_PASS NEGATIVE> | |
513 | (?is)\berror: | |
514 | <END_RESULT> | |
515 | <RESULT IF_PASS POSITIVE> | |
516 | (?im)Notify: File `Temp.hh' was generated. | |
517 | <END_RESULT> | |
518 | <END_TC> | |
519 | ||
520 | :exmp. | |
521 | ||
522 | .*---------------------------------------------------------------------* | |
523 | :h3.Encoder/Decoder functions, converter type, invalid parameter or return type | |
524 | .*---------------------------------------------------------------------* | |
525 | :xmp tab=0. | |
526 | ||
527 | <TC - Encoder/Decoder functions, converter type, invalid parameter or return type> | |
528 | ||
529 | <COMPILE> | |
530 | <VERDICT_LEAF PASS> | |
531 | <MODULE TTCN Temp Temp.ttcn> | |
532 | module Temp { | |
533 | type record MyPDU { | |
534 | integer i, | |
535 | float f | |
536 | } | |
537 | group G_decoders { | |
538 | external function f_decode1(out octetstring os) return MyPDU; | |
539 | external function f_decode2(inout octetstring os) return MyPDU; | |
540 | external function f_decode3(in charstring os) return MyPDU; | |
541 | external function f_decode4(in MyPDU os) return MyPDU; | |
542 | external function f_decode5(in octetstring os, in integer i) return MyPDU; | |
543 | external function f_decode6() return MyPDU; | |
544 | external function f_decode7(in octetstring os); | |
545 | } with { extension "prototype(convert) decode(RAW)" } | |
546 | group G_encoders { | |
547 | external function f_encode1(out MyPDU pdu) return octetstring; | |
548 | external function f_encode2(inout MyPDU pdu) return octetstring; | |
549 | external function f_encode3() return octetstring; | |
550 | external function f_encode4(in MyPDU pdu); | |
551 | external function f_encode5(in MyPDU pdu) return integer; | |
552 | external function f_encode6(in MyPDU pdu) return MyPDU; | |
553 | } with { extension "prototype(convert) encode(RAW)" } | |
554 | } with { encode "RAW"; variant "" extension "errorbehavior(ALL:ERROR)" } | |
555 | <END_MODULE> | |
556 | <RESULT IF_PASS COUNT 13> | |
557 | (?is)\berror: | |
558 | <END_RESULT> | |
559 | <RESULT IF_PASS POSITIVE> | |
560 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
561 | <END_RESULT> | |
562 | <END_TC> | |
563 | ||
564 | :exmp. | |
565 | ||
566 | .*---------------------------------------------------------------------* | |
567 | :h3.Encoder/Decoder functions, fast type, invalid parameter or return type | |
568 | .*---------------------------------------------------------------------* | |
569 | :xmp tab=0. | |
570 | ||
571 | <TC - Encoder/Decoder functions, fast type, invalid parameter or return type> | |
572 | ||
573 | <COMPILE> | |
574 | <VERDICT_LEAF PASS> | |
575 | <MODULE TTCN Temp Temp.ttcn> | |
576 | module Temp { | |
577 | type record MyPDU { | |
578 | integer i, | |
579 | float f | |
580 | } | |
581 | group G_decoders { | |
582 | external function f_decode1(out octetstring os, out MyPDU pdu); | |
583 | external function f_decode2(inout octetstring os, out MyPDU pdu); | |
584 | external function f_decode3(in MyPDU os, out MyPDU pdu); | |
585 | external function f_decode4(in charstring os, out MyPDU pdu); | |
586 | external function f_decode5(in octetstring os); | |
587 | external function f_decode6(in octetstring os, in MyPDU pdu); | |
588 | external function f_decode7(in octetstring os, inout MyPDU pdu); | |
589 | external function f_decode8(in octetstring os, in MyPDU pdu, integer i); | |
590 | external function f_decode9(in octetstring os, out MyPDU pdu) return integer; | |
591 | } with { extension "prototype(fast) decode(RAW)" } | |
592 | group G_encoders { | |
593 | external function f_encode1(out MyPDU pdu, out octetstring os); | |
594 | external function f_encode2(inout MyPDU pdu, out octetstring os); | |
595 | external function f_encode3(in MyPDU pdu, in octetstring os); | |
596 | external function f_encode4(in MyPDU pdu, inout octetstring os); | |
597 | external function f_encode5(in MyPDU pdu, out charstring os); | |
598 | external function f_encode6(in MyPDU pdu, out MyPDU os); | |
599 | external function f_encode7(in MyPDU pdu); | |
600 | external function f_encode8(); | |
601 | external function f_encode9(in MyPDU pdu, out octetstring os) return integer; | |
602 | } with { extension "prototype(fast) encode(RAW)" } | |
603 | } with { encode "RAW"; variant "" extension "errorbehavior(ALL:ERROR)" } | |
604 | <END_MODULE> | |
605 | <RESULT IF_PASS COUNT 18> | |
606 | (?is)\berror: | |
607 | <END_RESULT> | |
608 | <RESULT IF_PASS POSITIVE> | |
609 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
610 | <END_RESULT> | |
611 | <END_TC> | |
612 | ||
613 | :exmp. | |
614 | ||
615 | .*---------------------------------------------------------------------* | |
616 | :h3.Decoder functions, backtrack type, invalid parameter or return type | |
617 | .*---------------------------------------------------------------------* | |
618 | :xmp tab=0. | |
619 | ||
620 | <TC - Decoder functions, backtrack type, invalid parameter or return type> | |
621 | ||
622 | <COMPILE> | |
623 | <VERDICT_LEAF PASS> | |
624 | <MODULE TTCN Temp Temp.ttcn> | |
625 | module Temp { | |
626 | type record MyPDU { | |
627 | integer i, | |
628 | float f | |
629 | } with { encode "RAW"; variant "" } | |
630 | group G { | |
631 | external function f_backtrack1(out octetstring os, out MyPDU pdu) return integer; | |
632 | external function f_backtrack2(inout octetstring os, out MyPDU pdu) return integer; | |
633 | external function f_backtrack3(in MyPDU os, out MyPDU pdu) return integer; | |
634 | external function f_backtrack4(in charstring os, out MyPDU pdu) return integer; | |
635 | external function f_backtrack5(in octetstring os, in MyPDU pdu) return integer; | |
636 | external function f_backtrack6(in octetstring os, inout MyPDU pdu) return integer; | |
637 | external function f_backtrack7(in octetstring os) return integer; | |
638 | external function f_backtrack8(in octetstring os, out MyPDU pdu); | |
639 | external function f_backtrack9(in octetstring os, out MyPDU pdu) return octetstring; | |
640 | } with { extension "prototype(backtrack) decode(RAW)" } | |
641 | } | |
642 | <END_MODULE> | |
643 | <RESULT IF_PASS COUNT 9> | |
644 | (?is)\berror: | |
645 | <END_RESULT> | |
646 | <RESULT IF_PASS POSITIVE> | |
647 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
648 | <END_RESULT> | |
649 | <END_TC> | |
650 | ||
651 | :exmp. | |
652 | ||
653 | .*---------------------------------------------------------------------* | |
654 | :h3.Decoder functions, sliding type, invalid parameter or return type | |
655 | .*---------------------------------------------------------------------* | |
656 | :xmp tab=0. | |
657 | ||
658 | <TC - Decoder functions, sliding type, invalid parameter or return type> | |
659 | ||
660 | <COMPILE> | |
661 | <VERDICT_LEAF PASS> | |
662 | <MODULE TTCN Temp Temp.ttcn> | |
663 | module Temp { | |
664 | type record MyPDU { | |
665 | integer i, | |
666 | float f | |
667 | } with { encode "RAW"; variant "" } | |
668 | group G { | |
669 | external function f_sliding1(in octetstring os, out MyPDU pdu) return integer; | |
670 | external function f_sliding2(out octetstring os, out MyPDU pdu) return integer; | |
671 | external function f_sliding3(inout MyPDU os, out MyPDU pdu) return integer; | |
672 | external function f_sliding4(inout charstring os, out MyPDU pdu) return integer; | |
673 | external function f_sliding5(inout octetstring os, in MyPDU pdu) return integer; | |
674 | external function f_sliding6(inout octetstring os, inout MyPDU pdu) return integer; | |
675 | external function f_sliding7(inout octetstring os, out MyPDU pdu); | |
676 | external function f_sliding8(inout octetstring os, out MyPDU pdu) return octetstring; | |
677 | external function f_sliding9(inout octetstring os) return integer; | |
678 | } with { extension "prototype(sliding) decode(RAW)" } | |
679 | } | |
680 | <END_MODULE> | |
681 | <RESULT IF_PASS COUNT 9> | |
682 | (?is)\berror: | |
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 | ||
689 | :exmp. | |
690 | ||
691 | ||
692 | .*---------------------------------------------------------------------* | |
693 | :h3.Encoder/Decoder functions, invalid encoder for backtrack and sliding types | |
694 | .*---------------------------------------------------------------------* | |
695 | :xmp tab=0. | |
696 | ||
697 | <TC - Encoder/Decoder functions, invalid encoder for backtrack and sliding types> | |
698 | ||
699 | <COMPILE> | |
700 | <VERDICT_LEAF PASS> | |
701 | <MODULE TTCN Temp Temp.ttcn> | |
702 | module Temp { | |
703 | type record MyPDU { | |
704 | integer i, | |
705 | float f | |
706 | } with { encode "RAW"; variant "" } | |
707 | external function f_backtrack_encoder(in MyPDU pdu, out octetstring os) return integer | |
708 | with { extension "prototype(backtrack) encode(RAW)" } | |
709 | external function f_sliding_encoder(inout MyPDU pdu, out octetstring os) return integer | |
710 | with { extension "prototype(sliding) encode(RAW)" } | |
711 | } | |
712 | <END_MODULE> | |
713 | <RESULT IF_PASS COUNT 2> | |
714 | (?is)Attribute `encode' cannot be used with | |
715 | <END_RESULT> | |
716 | <RESULT IF_PASS COUNT 3> | |
717 | (?is)\berror: | |
718 | <END_RESULT> | |
719 | <RESULT IF_PASS POSITIVE> | |
720 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
721 | <END_RESULT> | |
722 | <END_TC> | |
723 | ||
724 | :exmp. | |
725 | ||
726 | ||
727 | ||
728 | .*---------------------------------------------------------------------* | |
729 | :h2.Ports with dual interfaces | |
730 | .*---------------------------------------------------------------------* | |
731 | This test case group covers the requirement SA-10/3. | |
732 | ||
733 | The test cases below test the ports with dual interfaces. | |
734 | ||
735 | ||
736 | .*---------------------------------------------------------------------* | |
737 | :h3.Ports with dual interfaces, valid def. using simple and ext. func. mappings | |
738 | .*---------------------------------------------------------------------* | |
739 | :xmp tab=0. | |
740 | ||
741 | <TC - Ports with dual interfaces, valid def. using simple and ext. func. mappings> | |
742 | ||
743 | <COMPILE> | |
744 | <VERDICT_LEAF PASS> | |
745 | <MODULE TTCN Temp Temp.ttcn> | |
746 | module Temp { | |
747 | type record MyInControlPDU { } | |
748 | type record MyOutControlPDU { } | |
749 | type record MyPDU1 { } | |
750 | type record MyPDU2 { } | |
751 | ||
752 | external function f_encode_pdu1(in MyPDU1 pdu) return octetstring | |
753 | with { extension "prototype(convert)" } | |
754 | external function f_encode_pdu2(in MyPDU2 pdu, out octetstring os) | |
755 | with { extension "prototype(fast)" } | |
756 | ||
757 | group G_backtrack { | |
758 | external function f_decode_pdu1(in octetstring os, out MyPDU1 pdu) return integer; | |
759 | external function f_decode_pdu2(in octetstring os, out MyPDU2 pdu) return integer; | |
760 | } with { extension "prototype(backtrack)" } | |
761 | ||
762 | type port ProviderPort message { | |
763 | in MyInControlPDU; | |
764 | out MyOutControlPDU; | |
765 | inout octetstring; | |
766 | } with { extension "provider" } | |
767 | ||
768 | type port UserPort message { | |
769 | in MyInControlPDU; | |
770 | out MyOutControlPDU; | |
771 | inout MyPDU1, MyPDU2; | |
772 | } with { extension "user ProviderPort | |
773 | out( | |
774 | MyOutControlPDU -> MyOutControlPDU : simple; | |
775 | MyPDU1 -> octetstring : function(f_encode_pdu1); | |
776 | MyPDU2 -> octetstring : function(f_encode_pdu2) | |
777 | ) | |
778 | in( | |
779 | MyInControlPDU -> MyInControlPDU : simple; | |
780 | octetstring -> MyPDU1 : function(f_decode_pdu1), | |
781 | MyPDU2 : function(f_decode_pdu2) | |
782 | )" | |
783 | } | |
784 | } | |
785 | <END_MODULE> | |
786 | <RESULT IF_PASS NEGATIVE> | |
787 | (?is)\berror: | |
788 | <END_RESULT> | |
789 | <RESULT IF_PASS POSITIVE> | |
790 | (?im)Notify: File `Temp.hh' was generated. | |
791 | <END_RESULT> | |
792 | <END_TC> | |
793 | ||
794 | :exmp. | |
795 | ||
796 | .*---------------------------------------------------------------------* | |
797 | :h3.Ports with dual interfaces, invalid provider/user | |
798 | .*---------------------------------------------------------------------* | |
799 | :xmp tab=0. | |
800 | ||
801 | <TC - Ports with dual interfaces, invalid provider/user> | |
802 | ||
803 | <COMPILE> | |
804 | <VERDICT_LEAF PASS> | |
805 | <MODULE TTCN Temp Temp.ttcn> | |
806 | module Temp { | |
807 | type port PA message { inout octetstring } | |
808 | with { | |
809 | extension "provider" | |
810 | } | |
811 | type port PB message { inout octetstring } | |
812 | with { | |
813 | extension "user PA | |
814 | in(octetstring -> octetstring: simple) | |
815 | out(octetstring -> octetstring: simple)" | |
816 | } | |
817 | type port PC message { inout octetstring } | |
818 | with { | |
819 | extension "user PA | |
820 | in(octetstring -> octetstring: simple) | |
821 | out(octetstring -> octetstring: simple)" | |
822 | extension "provider" | |
823 | } | |
824 | type port PD message { inout octetstring } | |
825 | with { | |
826 | extension "user Pnonexi | |
827 | in(octetstring -> octetstring: simple) | |
828 | out(octetstring -> octetstring: simple)" | |
829 | } | |
830 | } | |
831 | <END_MODULE> | |
832 | <RESULT IF_PASS COUNT 1> | |
833 | (?is)Attributes .+ cannot be used at the same time | |
834 | <END_RESULT> | |
835 | <RESULT IF_PASS COUNT 1> | |
836 | (?is)There is no local or imported definition | |
837 | <END_RESULT> | |
838 | <RESULT IF_PASS COUNT 2> | |
839 | (?is)\berror: | |
840 | <END_RESULT> | |
841 | <RESULT IF_PASS POSITIVE> | |
842 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
843 | <END_RESULT> | |
844 | <END_TC> | |
845 | ||
846 | :exmp. | |
847 | ||
848 | .*---------------------------------------------------------------------* | |
849 | :h3.Ports with dual interfaces, signature mapping | |
850 | .*---------------------------------------------------------------------* | |
851 | :xmp tab=0. | |
852 | ||
853 | <TC - Ports with dual interfaces, signature mapping> | |
854 | ||
855 | <COMPILE> | |
856 | <VERDICT_LEAF PASS> | |
857 | <MODULE TTCN Temp Temp.ttcn> | |
858 | module Temp { | |
859 | signature S(in octetstring os); | |
860 | type port PA mixed | |
861 | { | |
862 | inout octetstring; | |
863 | inout S; | |
864 | } with { | |
865 | extension "provider" | |
866 | } | |
867 | type port PB mixed | |
868 | { | |
869 | inout octetstring; | |
870 | inout S; | |
871 | } with { | |
872 | extension "user PA | |
873 | in(octetstring -> octetstring: simple; | |
874 | S -> S : simple) | |
875 | out(octetstring -> octetstring: simple; | |
876 | S -> S : simple)" | |
877 | } | |
878 | } | |
879 | <END_MODULE> | |
880 | <RESULT IF_PASS COUNT 2> | |
881 | (?im)\berror:.+\bmapping is not present on the list of incoming messages | |
882 | <END_RESULT> | |
883 | <RESULT IF_PASS COUNT 2> | |
884 | (?im)\berror:.+\bmapping is not present on the list of outgoing messages | |
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 | ||
891 | :exmp. | |
892 | ||
893 | ||
894 | .*---------------------------------------------------------------------* | |
895 | :h3.Ports with dual interfaces, missing incoming signature from the list of external interface | |
896 | .*---------------------------------------------------------------------* | |
897 | :xmp tab=0. | |
898 | ||
899 | <TC - Ports with dual interfaces, missing incoming signature from the list of external interface> | |
900 | ||
901 | <COMPILE> | |
902 | <VERDICT_LEAF PASS> | |
903 | <MODULE TTCN Temp Temp.ttcn> | |
904 | module Temp { | |
905 | ||
906 | signature S(in octetstring os) | |
907 | ||
908 | type port ProviderPort mixed { | |
909 | inout octetstring; | |
910 | } with { extension "provider"} | |
911 | ||
912 | type port UserPort mixed { | |
913 | in S; | |
914 | inout octetstring | |
915 | } with { extension "user ProviderPort | |
916 | out( | |
917 | octetstring -> octetstring : simple | |
918 | ) | |
919 | in( | |
920 | octetstring -> octetstring : simple | |
921 | )" | |
922 | ||
923 | } | |
924 | } | |
925 | <END_MODULE> | |
926 | <RESULT IF_PASS COUNT 1> | |
927 | (?is)\berror: Incoming signature `@Temp.S' of user port type `@Temp.UserPort' is not present on the list of incoming signatures in provider port type `@Temp.ProviderPort' | |
928 | <END_RESULT> | |
929 | <RESULT IF_PASS POSITIVE> | |
930 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
931 | <END_RESULT> | |
932 | <END_TC> | |
933 | ||
934 | :exmp. | |
935 | ||
936 | .*---------------------------------------------------------------------* | |
937 | :h3.Ports with dual interfaces, missing outgoing signature from the list of external interface | |
938 | .*---------------------------------------------------------------------* | |
939 | :xmp tab=0. | |
940 | ||
941 | <TC - Ports with dual interfaces, missing outgoing signature from the list of external interface> | |
942 | ||
943 | <COMPILE> | |
944 | <VERDICT_LEAF PASS> | |
945 | <MODULE TTCN Temp Temp.ttcn> | |
946 | module Temp { | |
947 | ||
948 | signature S(in octetstring os) | |
949 | ||
950 | type port ProviderPort mixed { | |
951 | inout octetstring; | |
952 | } with { extension "provider"} | |
953 | ||
954 | type port UserPort mixed { | |
955 | out S; | |
956 | inout octetstring | |
957 | } with { extension "user ProviderPort | |
958 | out( | |
959 | octetstring -> octetstring : simple | |
960 | ) | |
961 | in( | |
962 | octetstring -> octetstring : simple | |
963 | )" | |
964 | ||
965 | } | |
966 | } | |
967 | <END_MODULE> | |
968 | <RESULT IF_PASS COUNT 1> | |
969 | (?is)\berror: Outgoing signature `@Temp.S' of user port type `@Temp.UserPort' is not present on the list of outgoing signatures in provider port type `@Temp.ProviderPort' | |
970 | <END_RESULT> | |
971 | <RESULT IF_PASS POSITIVE> | |
972 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
973 | <END_RESULT> | |
974 | <END_TC> | |
975 | ||
976 | :exmp. | |
977 | ||
978 | .*---------------------------------------------------------------------* | |
979 | :h3.Ports with dual interfaces, missing incoming signature from the list of internal interface | |
980 | .*---------------------------------------------------------------------* | |
981 | :xmp tab=0. | |
982 | ||
983 | <TC - Ports with dual interfaces, missing incoming signature from the list of internal interface> | |
984 | ||
985 | <COMPILE> | |
986 | <VERDICT_LEAF PASS> | |
987 | <MODULE TTCN Temp Temp.ttcn> | |
988 | module Temp { | |
989 | ||
990 | signature S(in octetstring os) | |
991 | ||
992 | type port ProviderPort mixed { | |
993 | in S; | |
994 | inout octetstring; | |
995 | } with { extension "provider"} | |
996 | ||
997 | type port UserPort mixed { | |
998 | inout octetstring | |
999 | } with { extension "user ProviderPort | |
1000 | out( | |
1001 | octetstring -> octetstring : simple | |
1002 | ) | |
1003 | in( | |
1004 | octetstring -> octetstring : simple | |
1005 | )" | |
1006 | ||
1007 | } | |
1008 | } | |
1009 | <END_MODULE> | |
1010 | <RESULT IF_PASS COUNT 1> | |
1011 | (?is)\berror: Incoming signature `@Temp.S' of provider port type `@Temp.ProviderPort' is not present on the list of incoming signatures in user port type `@Temp.UserPort' | |
1012 | <END_RESULT> | |
1013 | <RESULT IF_PASS POSITIVE> | |
1014 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1015 | <END_RESULT> | |
1016 | <END_TC> | |
1017 | ||
1018 | :exmp. | |
1019 | ||
1020 | ||
1021 | .*---------------------------------------------------------------------* | |
1022 | :h3.Ports with dual interfaces, missing outgoing signature from the list of internal interface | |
1023 | .*---------------------------------------------------------------------* | |
1024 | :xmp tab=0. | |
1025 | ||
1026 | <TC - Ports with dual interfaces, missing outgoing signature from the list of internal interface> | |
1027 | ||
1028 | <COMPILE> | |
1029 | <VERDICT_LEAF PASS> | |
1030 | <MODULE TTCN Temp Temp.ttcn> | |
1031 | module Temp { | |
1032 | ||
1033 | signature S(in octetstring os) | |
1034 | ||
1035 | type port ProviderPort mixed { | |
1036 | out S; | |
1037 | inout octetstring; | |
1038 | } with { extension "provider"} | |
1039 | ||
1040 | type port UserPort mixed { | |
1041 | inout octetstring | |
1042 | } with { extension "user ProviderPort | |
1043 | out( | |
1044 | octetstring -> octetstring : simple | |
1045 | ) | |
1046 | in( | |
1047 | octetstring -> octetstring : simple | |
1048 | )" | |
1049 | ||
1050 | } | |
1051 | } | |
1052 | <END_MODULE> | |
1053 | <RESULT IF_PASS COUNT 1> | |
1054 | (?is)\berror: Outgoing signature `@Temp.S' of provider port type `@Temp.ProviderPort' is not present on the list of outgoing signatures in user port type `@Temp.UserPort' | |
1055 | <END_RESULT> | |
1056 | <RESULT IF_PASS POSITIVE> | |
1057 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1058 | <END_RESULT> | |
1059 | <END_TC> | |
1060 | ||
1061 | :exmp. | |
1062 | ||
1063 | ||
1064 | .*---------------------------------------------------------------------* | |
1065 | :h3.Ports with dual interfaces, duplicate mapping | |
1066 | .*---------------------------------------------------------------------* | |
1067 | :xmp tab=0. | |
1068 | ||
1069 | <TC - Ports with dual interfaces, duplicate mapping> | |
1070 | ||
1071 | <COMPILE> | |
1072 | <VERDICT_LEAF PASS> | |
1073 | <MODULE TTCN Temp Temp.ttcn> | |
1074 | module Temp { | |
1075 | ||
1076 | external function f_encode(in octetstring os, out octetstring oos) | |
1077 | with { extension "prototype(fast)" } | |
1078 | ||
1079 | type port PP message { in octetstring } with { extension "provider" } | |
1080 | type port PA message { in octetstring } with { | |
1081 | extension "user PP | |
1082 | in( octetstring -> octetstring : simple; | |
1083 | octetstring -> octetstring : function(f_encode)) " | |
1084 | } | |
1085 | } | |
1086 | <END_MODULE> | |
1087 | <RESULT IF_PASS COUNT 1> | |
1088 | (?is)\berror: Duplicate mapping | |
1089 | <END_RESULT> | |
1090 | <RESULT IF_PASS POSITIVE> | |
1091 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1092 | <END_RESULT> | |
1093 | <END_TC> | |
1094 | ||
1095 | :exmp. | |
1096 | ||
1097 | .*---------------------------------------------------------------------* | |
1098 | :h3.Ports with dual interfaces, invalid mapping syntax | |
1099 | .*---------------------------------------------------------------------* | |
1100 | :xmp tab=0. | |
1101 | ||
1102 | <TC - Ports with dual interfaces, invalid mapping syntax> | |
1103 | ||
1104 | <COMPILE> | |
1105 | <VERDICT_LEAF PASS> | |
1106 | <MODULE TTCN Temp Temp.ttcn> | |
1107 | module Temp { | |
1108 | type port PP message { in octetstring } with { extension "provider" } | |
1109 | type port PA message { in octetstring } with { | |
1110 | extension "user PP in( octetstring -> octetstring : sample)" } | |
1111 | } | |
1112 | <END_MODULE> | |
1113 | <RESULT IF_PASS COUNT 1> | |
1114 | (?is)syntax error | |
1115 | <END_RESULT> | |
1116 | <RESULT IF_PASS POSITIVE> | |
1117 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1118 | <END_RESULT> | |
1119 | <END_TC> | |
1120 | ||
1121 | :exmp. | |
1122 | ||
1123 | .*---------------------------------------------------------------------* | |
1124 | :h3.Ports with dual interfaces, invalid mappings | |
1125 | .*---------------------------------------------------------------------* | |
1126 | :xmp tab=0. | |
1127 | ||
1128 | <TC - Ports with dual interfaces, invalid mappings> | |
1129 | ||
1130 | <COMPILE> | |
1131 | <VERDICT_LEAF PASS> | |
1132 | <MODULE TTCN Temp Temp.ttcn> | |
1133 | module Temp { | |
1134 | ||
1135 | type record MyInControlPDU { } | |
1136 | type record MyOutControlPDU { } | |
1137 | type record MyPDU1 { } | |
1138 | type record MyPDU2 { } | |
1139 | ||
1140 | external function f_encode_pdu1(in MyPDU1 pdu) return octetstring | |
1141 | with { extension "prototype(convert)" } | |
1142 | external function f_encode_pdu2(in MyPDU2 pdu, out octetstring os) | |
1143 | with { extension "prototype(fast)" } | |
1144 | ||
1145 | group G_backtrack { | |
1146 | external function f_decode_pdu1(in octetstring os, out MyPDU1 pdu) return integer; | |
1147 | external function f_decode_pdu2(in octetstring os, out MyPDU2 pdu) return integer; | |
1148 | } with { extension "prototype(backtrack)" } | |
1149 | ||
1150 | type port ProviderPort message { | |
1151 | in MyInControlPDU; | |
1152 | out MyOutControlPDU; | |
1153 | inout octetstring; | |
1154 | } with { extension "provider" } | |
1155 | ||
1156 | type port UserPort message { | |
1157 | in MyInControlPDU; | |
1158 | out MyOutControlPDU; | |
1159 | inout MyPDU1, MyPDU2; | |
1160 | } with { extension "user ProviderPort | |
1161 | out( | |
1162 | MyOutControlPDU -> MyInControlPDU : simple; | |
1163 | MyPDU1 -> octetstring : function(f_encode_pdu1); | |
1164 | MyPDU2 -> octetstring : function(f_encode_pdu2) | |
1165 | ) | |
1166 | in( | |
1167 | MyInControlPDU -> MyInControlPDU : simple; | |
1168 | octetstring -> MyPDU1 : simple, | |
1169 | MyPDU2 : function(f_decode_pdu2) | |
1170 | )" | |
1171 | } | |
1172 | } | |
1173 | <END_MODULE> | |
1174 | <RESULT IF_PASS COUNT 4> | |
1175 | (?is)\berror: | |
1176 | <END_RESULT> | |
1177 | <RESULT IF_PASS COUNT 2> | |
1178 | (?is)\bThe source and target types must be the same: | |
1179 | <END_RESULT> | |
1180 | <RESULT IF_PASS POSITIVE> | |
1181 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1182 | <END_RESULT> | |
1183 | <END_TC> | |
1184 | ||
1185 | :exmp. | |
1186 | ||
1187 | .*---------------------------------------------------------------------* | |
1188 | :h3.Ports with dual interfaces, discard mapping | |
1189 | .*---------------------------------------------------------------------* | |
1190 | :xmp tab=0. | |
1191 | ||
1192 | <TC - Ports with dual interfaces, discard mapping> | |
1193 | ||
1194 | <COMPILE> | |
1195 | <VERDICT_LEAF PASS> | |
1196 | <MODULE TTCN Temp Temp.ttcn> | |
1197 | module Temp { | |
1198 | type record MyInControlPDU { } | |
1199 | type record MyOutControlPDU { } | |
1200 | type record MyPDU1 { } | |
1201 | type record MyPDU2 { } | |
1202 | ||
1203 | external function f_encode_pdu1(in MyPDU1 pdu) return octetstring | |
1204 | with { extension "prototype(convert)" } | |
1205 | external function f_encode_pdu2(in MyPDU2 pdu, out octetstring os) | |
1206 | with { extension "prototype(fast)" } | |
1207 | ||
1208 | group G_backtrack { | |
1209 | external function f_decode_pdu1(in octetstring os, out MyPDU1 pdu) return integer; | |
1210 | external function f_decode_pdu2(in octetstring os, out MyPDU2 pdu) return integer; | |
1211 | } with { extension "prototype(backtrack)" } | |
1212 | ||
1213 | type port ProviderPort message { | |
1214 | in MyInControlPDU; | |
1215 | out MyOutControlPDU; | |
1216 | inout octetstring; | |
1217 | } with { extension "provider" } | |
1218 | ||
1219 | type port UserPort message { | |
1220 | in MyInControlPDU; | |
1221 | out MyOutControlPDU; | |
1222 | inout MyPDU1, MyPDU2; | |
1223 | } with { extension "user ProviderPort | |
1224 | out( | |
1225 | MyOutControlPDU -> MyOutControlPDU : simple; | |
1226 | MyPDU1 -> octetstring : function(f_encode_pdu1); | |
1227 | MyPDU2 -> octetstring : function(f_encode_pdu2); | |
1228 | MyPDU2 -> - : discard | |
1229 | ) | |
1230 | in( | |
1231 | MyInControlPDU -> MyInControlPDU : simple; | |
1232 | octetstring -> MyPDU1 : function(f_decode_pdu1), | |
1233 | - : discard, | |
1234 | MyPDU2 : function(f_decode_pdu2) | |
1235 | ||
1236 | ||
1237 | ||
1238 | )" | |
1239 | } | |
1240 | } | |
1241 | <END_MODULE> | |
1242 | <RESULT IF_PASS COUNT 1> | |
1243 | (?is)\berror: Duplicate mapping for type `@Temp.MyPDU2' | |
1244 | <END_RESULT> | |
1245 | <RESULT IF_PASS COUNT 1> | |
1246 | (?is)\berror: Mapping `discard' must be the last target of the source type | |
1247 | <END_RESULT> | |
1248 | <RESULT IF_PASS POSITIVE> | |
1249 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1250 | <END_RESULT> | |
1251 | <END_TC> | |
1252 | ||
1253 | :exmp. | |
1254 | ||
1255 | .*---------------------------------------------------------------------* | |
1256 | :h3.Ports with dual interfaces, discard mapping for foreign PDU | |
1257 | .*---------------------------------------------------------------------* | |
1258 | :xmp tab=0. | |
1259 | ||
1260 | <TC - Ports with dual interfaces, discard mapping for foreign PDU> | |
1261 | ||
1262 | <COMPILE> | |
1263 | <VERDICT_LEAF PASS> | |
1264 | <MODULE TTCN Temp Temp.ttcn> | |
1265 | module Temp { | |
1266 | type record MyInControlPDU { } | |
1267 | type record MyOutControlPDU { } | |
1268 | type record MyPDU1 { } | |
1269 | type record MyPDU2 { } | |
1270 | type record MyPDU3 { } | |
1271 | ||
1272 | external function f_encode_pdu1(in MyPDU1 pdu) return octetstring | |
1273 | with { extension "prototype(convert)" } | |
1274 | external function f_encode_pdu2(in MyPDU2 pdu, out octetstring os) | |
1275 | with { extension "prototype(fast)" } | |
1276 | ||
1277 | group G_backtrack { | |
1278 | external function f_decode_pdu1(in octetstring os, out MyPDU1 pdu) return integer; | |
1279 | external function f_decode_pdu2(in octetstring os, out MyPDU2 pdu) return integer; | |
1280 | } with { extension "prototype(backtrack)" } | |
1281 | ||
1282 | type port ProviderPort message { | |
1283 | in MyInControlPDU; | |
1284 | out MyOutControlPDU; | |
1285 | inout octetstring; | |
1286 | } with { extension "provider" } | |
1287 | ||
1288 | type port UserPort message { | |
1289 | in MyInControlPDU; | |
1290 | out MyOutControlPDU; | |
1291 | inout MyPDU1, MyPDU2; | |
1292 | } with { extension "user ProviderPort | |
1293 | out( | |
1294 | MyOutControlPDU -> MyOutControlPDU : simple; | |
1295 | MyPDU1 -> octetstring : function(f_encode_pdu1); | |
1296 | MyPDU2 -> - : discard; | |
1297 | MyPDU3 -> - : discard | |
1298 | ) | |
1299 | in( | |
1300 | MyPDU3 -> - : discard; | |
1301 | MyInControlPDU -> MyInControlPDU : simple; | |
1302 | octetstring -> MyPDU1 : function(f_decode_pdu1), | |
1303 | MyPDU2 : function(f_decode_pdu2), | |
1304 | - : discard | |
1305 | ||
1306 | )" | |
1307 | } | |
1308 | } | |
1309 | <END_MODULE> | |
1310 | <RESULT IF_PASS COUNT 1> | |
1311 | (?is)\berror: Source type `@Temp.MyPDU3' of the `in' mapping is not present on the list of incoming messages in provider port type `@Temp.ProviderPort' | |
1312 | <END_RESULT> | |
1313 | <RESULT IF_PASS COUNT 1> | |
1314 | (?is)\berror: Source type `@Temp.MyPDU3' of the `out' mapping is not present on the list of outgoing messages in user port type `@Temp.UserPort' | |
1315 | <END_RESULT> | |
1316 | <RESULT IF_PASS POSITIVE> | |
1317 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1318 | <END_RESULT> | |
1319 | <END_TC> | |
1320 | ||
1321 | :exmp. | |
1322 | ||
1323 | .*---------------------------------------------------------------------* | |
1324 | :h3.Ports with dual interfaces, missing 'provider' attribute | |
1325 | .*---------------------------------------------------------------------* | |
1326 | :xmp tab=0. | |
1327 | ||
1328 | <TC - Ports with dual interfaces, missing 'provider' attribute> | |
1329 | ||
1330 | <COMPILE> | |
1331 | <VERDICT_LEAF PASS> | |
1332 | <MODULE TTCN Temp Temp.ttcn> | |
1333 | module Temp { | |
1334 | type record MyInControlPDU { } | |
1335 | type record MyOutControlPDU { } | |
1336 | type record MyPDU1 { } | |
1337 | type record MyPDU2 { } | |
1338 | ||
1339 | external function f_encode_pdu1(in MyPDU1 pdu) return octetstring | |
1340 | with { extension "prototype(convert)" } | |
1341 | external function f_encode_pdu2(in MyPDU2 pdu, out octetstring os) | |
1342 | with { extension "prototype(fast)" } | |
1343 | ||
1344 | group G_backtrack { | |
1345 | external function f_decode_pdu1(in octetstring os, out MyPDU1 pdu) return integer; | |
1346 | external function f_decode_pdu2(in octetstring os, out MyPDU2 pdu) return integer; | |
1347 | } with { extension "prototype(backtrack)" } | |
1348 | ||
1349 | type port ProviderPort message { | |
1350 | in MyInControlPDU; | |
1351 | out MyOutControlPDU; | |
1352 | inout octetstring; | |
1353 | } | |
1354 | ||
1355 | type port UserPort message { | |
1356 | in MyInControlPDU; | |
1357 | out MyOutControlPDU; | |
1358 | inout MyPDU1, MyPDU2; | |
1359 | } with { extension "user ProviderPort | |
1360 | in( | |
1361 | MyInControlPDU -> MyInControlPDU : simple; | |
1362 | octetstring -> MyPDU1 : function(f_decode_pdu1), | |
1363 | MyPDU2 : function(f_decode_pdu2), | |
1364 | - : discard | |
1365 | ||
1366 | ) | |
1367 | out( | |
1368 | MyOutControlPDU -> MyOutControlPDU : simple; | |
1369 | MyPDU1 -> octetstring : function(f_encode_pdu1); | |
1370 | MyPDU2 -> - : discard | |
1371 | )" | |
1372 | ||
1373 | } | |
1374 | } | |
1375 | <END_MODULE> | |
1376 | <RESULT IF_PASS COUNT 1> | |
1377 | (?is)\berror: The referenced port type `@Temp.ProviderPort' must have the `provider' attribute | |
1378 | <END_RESULT> | |
1379 | <RESULT IF_PASS POSITIVE> | |
1380 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1381 | <END_RESULT> | |
1382 | <END_TC> | |
1383 | ||
1384 | :exmp. | |
1385 | ||
1386 | ||
1387 | .*---------------------------------------------------------------------* | |
1388 | :h3.Ports with dual interfaces, missing 'address' attribute from provider port | |
1389 | .*---------------------------------------------------------------------* | |
1390 | :xmp tab=0. | |
1391 | ||
1392 | <TC - Ports with dual interfaces, missing 'address' attribute from provider port> | |
1393 | ||
1394 | <COMPILE> | |
1395 | <VERDICT_LEAF PASS> | |
1396 | <MODULE TTCN Temp Temp.ttcn> | |
1397 | module Temp { | |
1398 | type integer address; | |
1399 | ||
1400 | type port ProviderPort message { | |
1401 | inout octetstring; | |
1402 | } with { extension "provider"} | |
1403 | ||
1404 | type port UserPort message { | |
1405 | inout octetstring | |
1406 | } with { extension "user ProviderPort | |
1407 | in( | |
1408 | octetstring -> octetstring : simple | |
1409 | ) | |
1410 | out( | |
1411 | octetstring -> octetstring : simple | |
1412 | ) address" | |
1413 | ||
1414 | } | |
1415 | } | |
1416 | <END_MODULE> | |
1417 | <RESULT IF_PASS COUNT 1> | |
1418 | (?is)\berror: Attribute `address' cannot be used because the provider port type `@Temp.ProviderPort' does not have attribute `address' | |
1419 | <END_RESULT> | |
1420 | <RESULT IF_PASS POSITIVE> | |
1421 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1422 | <END_RESULT> | |
1423 | <END_TC> | |
1424 | ||
1425 | :exmp. | |
1426 | ||
1427 | .*---------------------------------------------------------------------* | |
1428 | :h3.Ports with dual interfaces, missing 'internal' attribute from user port | |
1429 | .*---------------------------------------------------------------------* | |
1430 | :xmp tab=0. | |
1431 | ||
1432 | <TC - Ports with dual interfaces, missing 'internal' attribute from user port> | |
1433 | ||
1434 | <COMPILE> | |
1435 | <VERDICT_LEAF PASS> | |
1436 | <MODULE TTCN Temp Temp.ttcn> | |
1437 | module Temp { | |
1438 | ||
1439 | type port ProviderPort message { | |
1440 | inout octetstring; | |
1441 | } with { extension "provider internal"} | |
1442 | ||
1443 | type port UserPort message { | |
1444 | inout octetstring | |
1445 | } with { extension "user ProviderPort | |
1446 | in( | |
1447 | octetstring -> octetstring : simple | |
1448 | ) | |
1449 | out( | |
1450 | octetstring -> octetstring : simple | |
1451 | )" | |
1452 | ||
1453 | } | |
1454 | } | |
1455 | <END_MODULE> | |
1456 | <RESULT IF_PASS COUNT 1> | |
1457 | (?is)\berror: Missing attribute `internal'. Provider port type `@Temp.ProviderPort' has attribute `internal', which must be also present here | |
1458 | <END_RESULT> | |
1459 | <RESULT IF_PASS POSITIVE> | |
1460 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1461 | <END_RESULT> | |
1462 | <END_TC> | |
1463 | ||
1464 | :exmp. | |
1465 | ||
1466 | .*---------------------------------------------------------------------* | |
1467 | :h3.Ports with dual interfaces, invalid incoming mapping(s) | |
1468 | .*---------------------------------------------------------------------* | |
1469 | :xmp tab=0. | |
1470 | ||
1471 | <TC - Ports with dual interfaces, invalid incoming mapping(s)> | |
1472 | ||
1473 | <COMPILE> | |
1474 | <VERDICT_LEAF PASS> | |
1475 | <MODULE TTCN Temp Temp.ttcn> | |
1476 | module Temp { | |
1477 | ||
1478 | type port ProviderPort message { | |
1479 | out octetstring; | |
1480 | } with { extension "provider"} | |
1481 | ||
1482 | type port UserPort message { | |
1483 | inout octetstring | |
1484 | } with { extension "user ProviderPort | |
1485 | in( | |
1486 | octetstring -> octetstring : simple | |
1487 | ) | |
1488 | out( | |
1489 | octetstring -> octetstring : simple | |
1490 | )" | |
1491 | ||
1492 | } | |
1493 | } | |
1494 | <END_MODULE> | |
1495 | <RESULT IF_PASS COUNT 1> | |
1496 | (?is)\berror: Invalid incoming mappings. Provider port type `@Temp.ProviderPort' does not have incoming message types | |
1497 | <END_RESULT> | |
1498 | <RESULT IF_PASS POSITIVE> | |
1499 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1500 | <END_RESULT> | |
1501 | <END_TC> | |
1502 | ||
1503 | :exmp. | |
1504 | ||
1505 | ||
1506 | .*---------------------------------------------------------------------* | |
1507 | :h3.Ports with dual interfaces, completely missing 'in' mappings | |
1508 | .*---------------------------------------------------------------------* | |
1509 | :xmp tab=0. | |
1510 | ||
1511 | <TC - Ports with dual interfaces, completely missing 'in' mappings> | |
1512 | ||
1513 | <COMPILE> | |
1514 | <VERDICT_LEAF PASS> | |
1515 | <MODULE TTCN Temp Temp.ttcn> | |
1516 | module Temp { | |
1517 | ||
1518 | type record MyPDU{ } | |
1519 | ||
1520 | type port ProviderPort message { | |
1521 | in MyPDU; | |
1522 | inout octetstring; | |
1523 | } with { extension "provider"} | |
1524 | ||
1525 | type port UserPort message { | |
1526 | inout octetstring | |
1527 | } with { extension "user ProviderPort | |
1528 | out( | |
1529 | octetstring -> octetstring : simple | |
1530 | )" | |
1531 | ||
1532 | } | |
1533 | } | |
1534 | <END_MODULE> | |
1535 | <RESULT IF_PASS COUNT 1> | |
1536 | (?is)\berror: Missing `in' mappings to handle the incoming message types of provider port type `@Temp.ProviderPort' | |
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 | .*---------------------------------------------------------------------* | |
1547 | :h3.Ports with dual interfaces, completely missing 'out' mappings | |
1548 | .*---------------------------------------------------------------------* | |
1549 | :xmp tab=0. | |
1550 | ||
1551 | <TC - Ports with dual interfaces, completely missing 'out' mappings> | |
1552 | ||
1553 | <COMPILE> | |
1554 | <VERDICT_LEAF PASS> | |
1555 | <MODULE TTCN Temp Temp.ttcn> | |
1556 | module Temp { | |
1557 | ||
1558 | type record MyPDU{ } | |
1559 | ||
1560 | type port ProviderPort message { | |
1561 | out MyPDU; | |
1562 | inout octetstring; | |
1563 | } with { extension "provider"} | |
1564 | ||
1565 | type port UserPort message { | |
1566 | inout octetstring | |
1567 | } with { extension "user ProviderPort | |
1568 | in( | |
1569 | octetstring -> octetstring : simple | |
1570 | )" | |
1571 | ||
1572 | } | |
1573 | } | |
1574 | <END_MODULE> | |
1575 | <RESULT IF_PASS COUNT 1> | |
1576 | (?is)\berror: Missing `out' mappings to handle the outgoing message types of user port type `@Temp.UserPort' | |
1577 | <END_RESULT> | |
1578 | <RESULT IF_PASS POSITIVE> | |
1579 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1580 | <END_RESULT> | |
1581 | <END_TC> | |
1582 | ||
1583 | :exmp. | |
1584 | ||
1585 | .*---------------------------------------------------------------------* | |
1586 | :h3.Ports with dual interfaces, nonexistent message types | |
1587 | .*---------------------------------------------------------------------* | |
1588 | :xmp tab=0. | |
1589 | ||
1590 | <TC - Ports with dual interfaces, nonexistent message types> | |
1591 | ||
1592 | <COMPILE> | |
1593 | <VERDICT_LEAF PASS> | |
1594 | <MODULE TTCN Temp Temp.ttcn> | |
1595 | module Temp { | |
1596 | type port PP message { inout octetstring } with { extension "provider" } | |
1597 | type port PA message { inout octetstring } with { | |
1598 | extension "user PP | |
1599 | in(octetstring -> octetstring : simple; | |
1600 | Nonexi_PDU -> Nonexi_PDU : simple) | |
1601 | out(octetstring -> octetstring : simple; | |
1602 | Nonexi_PDU -> Nonexi_PDU : simple)" | |
1603 | } | |
1604 | } | |
1605 | <END_MODULE> | |
1606 | <RESULT IF_PASS COUNT 4> | |
1607 | (?is)error: There is no local or imported definition with name `Nonexi_PDU' | |
1608 | <END_RESULT> | |
1609 | <RESULT IF_PASS POSITIVE> | |
1610 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1611 | <END_RESULT> | |
1612 | <END_TC> | |
1613 | ||
1614 | :exmp. | |
1615 | ||
1616 | .*---------------------------------------------------------------------* | |
1617 | :h3.Ports with dual interfaces, nonexistent message types 2 | |
1618 | .*---------------------------------------------------------------------* | |
1619 | :xmp tab=0. | |
1620 | ||
1621 | <TC - Ports with dual interfaces, nonexistent message types 2> | |
1622 | ||
1623 | <COMPILE> | |
1624 | <VERDICT_LEAF PASS> | |
1625 | <MODULE TTCN Temp Temp.ttcn> | |
1626 | module Temp { | |
1627 | type record MyPDU { } with { encode "RAW" variant "" } | |
1628 | group G { | |
1629 | external function f_encode(in MyPDU pdu, out octetstring os) | |
1630 | with { extension "encode(RAW)" } | |
1631 | external function f_decode(in octetstring os, out MyPDU pdu) | |
1632 | with { extension "decode(RAW)" } | |
1633 | } with { extension "prototype(fast)" } | |
1634 | type port PP message { inout octetstring } with { extension "provider" } | |
1635 | type port PA message { in charstring } with { | |
1636 | extension "user PP | |
1637 | in( octetstring -> MyPDU : function(f_decode)) | |
1638 | out(MyPDU -> octetstring : function(f_encode))" | |
1639 | } | |
1640 | } | |
1641 | <END_MODULE> | |
1642 | <RESULT IF_PASS COUNT 2> | |
1643 | (?is)\berror: | |
1644 | <END_RESULT> | |
1645 | <RESULT IF_PASS POSITIVE> | |
1646 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1647 | <END_RESULT> | |
1648 | <END_TC> | |
1649 | ||
1650 | :exmp. | |
1651 | ||
1652 | .*---------------------------------------------------------------------* | |
1653 | :h3.Ports with dual interfaces, missing mappings: outgoing types of the internal interface | |
1654 | .*---------------------------------------------------------------------* | |
1655 | :xmp tab=0. | |
1656 | ||
1657 | <TC - Ports with dual interfaces, missing mappings: outgoing types of the internal interface> | |
1658 | ||
1659 | <COMPILE> | |
1660 | <VERDICT_LEAF PASS> | |
1661 | <MODULE TTCN Temp Temp.ttcn> | |
1662 | module Temp { | |
1663 | type record MyInControlPDU { } | |
1664 | type record MyOutControlPDU { } | |
1665 | type record MyPDU1 { } | |
1666 | type record MyPDU2 { } | |
1667 | ||
1668 | external function f_encode_pdu1(in MyPDU1 pdu) return octetstring | |
1669 | with { extension "prototype(convert)" } | |
1670 | external function f_encode_pdu2(in MyPDU2 pdu, out octetstring os) | |
1671 | with { extension "prototype(fast)" } | |
1672 | ||
1673 | group G_backtrack { | |
1674 | external function f_decode_pdu1(in octetstring os, out MyPDU1 pdu) return integer; | |
1675 | external function f_decode_pdu2(in octetstring os, out MyPDU2 pdu) return integer; | |
1676 | } with { extension "prototype(backtrack)" } | |
1677 | ||
1678 | type port ProviderPort message { | |
1679 | in MyInControlPDU; | |
1680 | out MyOutControlPDU; | |
1681 | inout octetstring; | |
1682 | } with { extension "provider" } | |
1683 | ||
1684 | type port UserPort message { | |
1685 | in MyInControlPDU; | |
1686 | out MyOutControlPDU; | |
1687 | inout MyPDU1, MyPDU2, charstring; | |
1688 | } with { extension "user ProviderPort | |
1689 | out( | |
1690 | MyOutControlPDU -> MyOutControlPDU : simple; | |
1691 | MyPDU1 -> octetstring : function(f_encode_pdu1) | |
1692 | ) | |
1693 | in( | |
1694 | MyInControlPDU -> MyInControlPDU : simple; | |
1695 | octetstring -> MyPDU1 : function(f_decode_pdu1), | |
1696 | MyPDU2 : function(f_decode_pdu2) | |
1697 | )" | |
1698 | } | |
1699 | } | |
1700 | <END_MODULE> | |
1701 | <RESULT IF_PASS COUNT 2> | |
1702 | (?im)\berror: .+ not handled by the outgoing mappings | |
1703 | <END_RESULT> | |
1704 | <RESULT IF_PASS POSITIVE> | |
1705 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1706 | <END_RESULT> | |
1707 | <END_TC> | |
1708 | ||
1709 | :exmp. | |
1710 | ||
1711 | .*---------------------------------------------------------------------* | |
1712 | :h3.Ports with dual interfaces, missing mappings: incoming types of the external interface | |
1713 | .*---------------------------------------------------------------------* | |
1714 | :xmp tab=0. | |
1715 | ||
1716 | <TC - Ports with dual interfaces, missing mappings: incoming types of the external interface> | |
1717 | ||
1718 | <COMPILE> | |
1719 | <VERDICT_LEAF PASS> | |
1720 | <MODULE TTCN Temp Temp.ttcn> | |
1721 | module Temp { | |
1722 | type record MyInControlPDU { } | |
1723 | type record MyOutControlPDU { } | |
1724 | type record MyPDU1 { } | |
1725 | type record MyPDU2 { } | |
1726 | type record MyPDU3 { } | |
1727 | ||
1728 | external function f_encode_pdu1(in MyPDU1 pdu) return octetstring | |
1729 | with { extension "prototype(convert)" } | |
1730 | external function f_encode_pdu2(in MyPDU2 pdu, out octetstring os) | |
1731 | with { extension "prototype(fast)" } | |
1732 | ||
1733 | group G_backtrack { | |
1734 | external function f_decode_pdu1(in octetstring os, out MyPDU1 pdu) return integer; | |
1735 | external function f_decode_pdu2(in octetstring os, out MyPDU2 pdu) return integer; | |
1736 | } with { extension "prototype(backtrack)" } | |
1737 | ||
1738 | type port ProviderPort message { | |
1739 | in MyInControlPDU; | |
1740 | out MyOutControlPDU; | |
1741 | inout octetstring; | |
1742 | in charstring; | |
1743 | in MyPDU3 | |
1744 | } with { extension "provider" } | |
1745 | ||
1746 | type port UserPort message { | |
1747 | in MyInControlPDU; | |
1748 | out MyOutControlPDU; | |
1749 | inout MyPDU1, MyPDU2; | |
1750 | } with { extension "user ProviderPort | |
1751 | out( | |
1752 | MyOutControlPDU -> MyOutControlPDU : simple; | |
1753 | MyPDU1 -> octetstring : function(f_encode_pdu1); | |
1754 | MyPDU2 -> octetstring : function(f_encode_pdu2) | |
1755 | ) | |
1756 | in( | |
1757 | MyInControlPDU -> MyInControlPDU : simple; | |
1758 | octetstring -> MyPDU1 : function(f_decode_pdu1), | |
1759 | MyPDU2 : function(f_decode_pdu2) | |
1760 | )" | |
1761 | } | |
1762 | } | |
1763 | <END_MODULE> | |
1764 | <RESULT IF_PASS COUNT 2> | |
1765 | (?im)error: .+ not handled by the incoming mappings | |
1766 | <END_RESULT> | |
1767 | <RESULT IF_PASS POSITIVE> | |
1768 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1769 | <END_RESULT> | |
1770 | <END_TC> | |
1771 | ||
1772 | :exmp. | |
1773 | ||
1774 | .*---------------------------------------------------------------------* | |
1775 | :h3.Ports with dual interfaces, external outgoing and internal incoming | |
1776 | .*---------------------------------------------------------------------* | |
1777 | :xmp tab=0. | |
1778 | ||
1779 | <TC - Ports with dual interfaces, external outgoing and internal incoming> | |
1780 | ||
1781 | <COMPILE> | |
1782 | <VERDICT_LEAF PASS> | |
1783 | <MODULE TTCN Temp Temp.ttcn> | |
1784 | module Temp { | |
1785 | type record MyPDU1 { } | |
1786 | type record MyPDU2 { } | |
1787 | type record MyPDU3 { } | |
1788 | type record MyPDU4 { } | |
1789 | ||
1790 | type port ExternalFacePort message { | |
1791 | out integer; | |
1792 | out MyPDU1; | |
1793 | out MyPDU2; | |
1794 | inout bitstring; | |
1795 | } with { extension "provider" } | |
1796 | ||
1797 | type port InternalFacePort message { | |
1798 | in charstring; | |
1799 | in MyPDU3; | |
1800 | in MyPDU4; | |
1801 | inout bitstring; | |
1802 | } with { extension "user ExternalFacePort | |
1803 | in(bitstring -> bitstring : simple) | |
1804 | out(bitstring -> bitstring : simple)" | |
1805 | } | |
1806 | } | |
1807 | <END_MODULE> | |
1808 | <RESULT IF_PASS NEGATIVE> | |
1809 | (?is)\berror: | |
1810 | <END_RESULT> | |
1811 | <RESULT IF_PASS POSITIVE> | |
1812 | (?im)Notify: File `Temp.hh' was generated. | |
1813 | <END_RESULT> | |
1814 | <END_TC> | |
1815 | ||
1816 | :exmp. | |
1817 | ||
1818 | .*---------------------------------------------------------------------* | |
1819 | :h3.Ports with dual interfaces, connecting and mapping | |
1820 | .*---------------------------------------------------------------------* | |
1821 | :xmp tab=0. | |
1822 | ||
1823 | <TC - Ports with dual interfaces, connecting and mapping> | |
1824 | ||
1825 | <COMPILE> | |
1826 | <VERDICT_LEAF PASS> | |
1827 | <MODULE TTCN Temp Temp.ttcn> | |
1828 | module Temp { | |
1829 | type record MyInControlPDU { } | |
1830 | type record MyOutControlPDU { } | |
1831 | type record MyPDU1 { } | |
1832 | type record MyPDU2 { } | |
1833 | ||
1834 | external function f_encode_pdu1(in MyPDU1 pdu) return octetstring | |
1835 | with { extension "prototype(convert)" } | |
1836 | external function f_encode_pdu2(in MyPDU2 pdu, out octetstring os) | |
1837 | with { extension "prototype(fast)" } | |
1838 | ||
1839 | group G_backtrack { | |
1840 | external function f_decode_pdu1(in octetstring os, out MyPDU1 pdu) return integer; | |
1841 | external function f_decode_pdu2(in octetstring os, out MyPDU2 pdu) return integer; | |
1842 | } with { extension "prototype(backtrack)" } | |
1843 | ||
1844 | type port ProviderPort message { | |
1845 | in MyInControlPDU; | |
1846 | out MyOutControlPDU; | |
1847 | inout octetstring; | |
1848 | } with { extension "internal provider" } | |
1849 | ||
1850 | type port UserPort message { | |
1851 | in MyInControlPDU; | |
1852 | out MyOutControlPDU; | |
1853 | inout MyPDU1, MyPDU2; | |
1854 | } with { extension "internal user ProviderPort | |
1855 | out( | |
1856 | MyOutControlPDU -> MyOutControlPDU : simple; | |
1857 | MyPDU1 -> octetstring : function(f_encode_pdu1); | |
1858 | MyPDU2 -> octetstring : function(f_encode_pdu2) | |
1859 | ) | |
1860 | in( | |
1861 | MyInControlPDU -> MyInControlPDU : simple; | |
1862 | octetstring -> MyPDU1 : function(f_decode_pdu1), | |
1863 | MyPDU2 : function(f_decode_pdu2) | |
1864 | )" | |
1865 | } | |
1866 | ||
1867 | type port MyPort message { | |
1868 | out MyInControlPDU; | |
1869 | in MyOutControlPDU; | |
1870 | inout octetstring; | |
1871 | } | |
1872 | ||
1873 | type component K1 { | |
1874 | port MyPort my_port; | |
1875 | } | |
1876 | ||
1877 | type component K2 { | |
1878 | port UserPort user_port; | |
1879 | } | |
1880 | ||
1881 | testcase TC1() runs on K1 { | |
1882 | var K1 k1; | |
1883 | var K2 k2; | |
1884 | connect(k1:my_port, k2:user_port); | |
1885 | map(k1:my_port, k2:user_port); | |
1886 | } | |
1887 | } | |
1888 | <END_MODULE> | |
1889 | <RESULT IF_PASS NEGATIVE> | |
1890 | (?is)\berror: | |
1891 | <END_RESULT> | |
1892 | <RESULT IF_PASS COUNT 1> | |
1893 | (?is)\bwarning: Port type .+ was marked as `internal' | |
1894 | <END_RESULT> | |
1895 | <RESULT IF_PASS POSITIVE> | |
1896 | (?im)Notify: File `Temp.hh' was generated. | |
1897 | <END_RESULT> | |
1898 | <END_TC> | |
1899 | ||
1900 | :exmp. | |
1901 | ||
1902 | .*---------------------------------------------------------------------* | |
1903 | :h3.Ports with dual interfaces, non standard attribute keywords as identifiers | |
1904 | .*---------------------------------------------------------------------* | |
1905 | :xmp tab=0. | |
1906 | ||
1907 | <TC - Ports with dual interfaces, non standard attribute keywords as identifiers> | |
1908 | ||
1909 | <COMPILE> | |
1910 | <VERDICT_LEAF PASS> | |
1911 | <MODULE TTCN Temp Temp.ttcn> | |
1912 | module Temp { | |
1913 | type record user { } | |
1914 | type record internal { } | |
1915 | type record simple { } | |
1916 | ||
1917 | external function fast(in internal pdu) return octetstring | |
1918 | with { extension "prototype(convert)" } | |
1919 | external function convert(in octetstring os, out internal pdu) | |
1920 | with { extension "prototype(fast)" } | |
1921 | ||
1922 | type port provider message { | |
1923 | inout user; | |
1924 | inout simple; | |
1925 | inout octetstring; | |
1926 | } with { extension "internal provider" } | |
1927 | ||
1928 | type port sliding message { | |
1929 | inout user; | |
1930 | inout simple; | |
1931 | inout internal; | |
1932 | } with { extension "internal user provider | |
1933 | in(simple -> simple : simple; | |
1934 | user -> user : simple; | |
1935 | octetstring -> internal : function(convert)) | |
1936 | out(simple -> simple : simple; | |
1937 | user -> user : simple; | |
1938 | internal -> octetstring : function(fast))" | |
1939 | } | |
1940 | } | |
1941 | <END_MODULE> | |
1942 | <RESULT IF_PASS NEGATIVE> | |
1943 | (?is)\berror: | |
1944 | <END_RESULT> | |
1945 | <RESULT IF_PASS NEGATIVE> | |
1946 | (?is)\bwarning: | |
1947 | <END_RESULT> | |
1948 | <RESULT IF_PASS POSITIVE> | |
1949 | (?im)Notify: File `Temp.hh' was generated. | |
1950 | <END_RESULT> | |
1951 | <END_TC> | |
1952 | ||
1953 | :exmp. | |
1954 | ||
1955 | .*---------------------------------------------------------------------* | |
1956 | :h3.Ports with dual interfaces, cardinality 1->N with non-backtrack decoder | |
1957 | .*---------------------------------------------------------------------* | |
1958 | :xmp tab=0. | |
1959 | ||
1960 | <TC - Ports with dual interfaces, cardinality 1->N with non-backtrack decoder> | |
1961 | ||
1962 | <COMPILE> | |
1963 | <VERDICT_LEAF PASS> | |
1964 | <MODULE TTCN Temp Temp.ttcn> | |
1965 | module Temp { | |
1966 | type record MyPDU1 { integer i, float f } with { encode "RAW"; variant "" } | |
1967 | type record MyPDU2 { charstring c, boolean b } with { encode "RAW"; variant "" } | |
1968 | external function f_decode1(in octetstring os, out MyPDU1 pdu) return integer | |
1969 | with { extension "prototype(backtrack) decode(RAW) errorbehavior(ALL:WARNING)" } | |
1970 | external function f_decode2(in octetstring os, out MyPDU2 pdu) | |
1971 | with { extension "prototype(fast) decode(RAW) errorbehavior(ALL:WARNING)" } | |
1972 | type port ProvPort message { in octetstring } | |
1973 | with { extension "internal provider" } | |
1974 | type port UserPort message { in MyPDU1, MyPDU2 } | |
1975 | with { extension "internal user ProvPort | |
1976 | in( octetstring -> MyPDU1 : function(f_decode1), | |
1977 | MyPDU2 : function(f_decode2) )" | |
1978 | } | |
1979 | } | |
1980 | <END_MODULE> | |
1981 | <RESULT IF_PASS COUNT 1> | |
1982 | (?is)\berror: | |
1983 | <END_RESULT> | |
1984 | <RESULT IF_PASS POSITIVE> | |
1985 | (?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b | |
1986 | <END_RESULT> | |
1987 | <END_TC> | |
1988 | ||
1989 | :exmp. | |
1990 | ||
1991 | .*---------------------------------------------------------------------* | |
1992 | :h3.Ports with dual interfaces, coding method | |
1993 | .*---------------------------------------------------------------------* | |
1994 | :xmp tab=0. | |
1995 | ||
1996 | <TC - Ports with dual interfaces, coding method> | |
1997 | ||
1998 | <COMPILE> | |
1999 | <VERDICT_LEAF PASS> | |
2000 | <MODULE TTCN Temp Temp.ttcn> | |
2001 | module Temp { | |
2002 | type record MyPDU1 { integer i, float f } with { encode "RAW"; variant "" } | |
2003 | type record MyPDU2 { charstring c, boolean b } with { encode "RAW"; variant "" } | |
2004 | type port ProvPort message { in octetstring } | |
2005 | with { extension "internal provider" } | |
2006 | type port UserPort message { in MyPDU1, MyPDU2 } | |
2007 | with { extension "internal user ProvPort | |
2008 | in( octetstring -> MyPDU1 : decode(RAW) errorbehavior(ALL:WARNING,DEC_ENUM:IGNORE), | |
2009 | MyPDU2 : decode(RAW) )" | |
2010 | } | |
2011 | } | |
2012 | <END_MODULE> | |
2013 | <RESULT IF_PASS NEGATIVE> | |
2014 | (?is)\berror: | |
2015 | <END_RESULT> | |
2016 | <RESULT IF_PASS NEGATIVE> | |
2017 | (?is)\bwarning: | |
2018 | <END_RESULT> | |
2019 | <RESULT IF_PASS POSITIVE> | |
2020 | (?im)Notify: File `Temp.hh' was generated. | |
2021 | <END_RESULT> | |
2022 | <END_TC> | |
2023 | ||
2024 | :exmp. | |
2025 | ||
2026 | .*---------------------------------------------------------------------* | |
2027 | :h3.Ports with dual interfaces, decoding with sliding function | |
2028 | .*---------------------------------------------------------------------* | |
2029 | :xmp tab=0. | |
2030 | ||
2031 | <TC - Ports with dual interfaces, decoding with sliding function> | |
2032 | ||
2033 | <COMPILE> | |
2034 | <VERDICT_LEAF PASS> | |
2035 | <MODULE TTCN Temp Temp.ttcn> | |
2036 | module Temp { | |
2037 | type record MyPDU { integer i, float f } with { encode "RAW"; variant "" } | |
2038 | external function f_decode(inout octetstring os, out MyPDU pdu) return integer | |
2039 | with { extension "prototype(sliding) decode(RAW) errorbehavior(ALL:WARNING)" } | |
2040 | type port ProvPort message { in octetstring } | |
2041 | with { extension "internal provider" } | |
2042 | type port UserPort message { in MyPDU } | |
2043 | with { extension "internal user ProvPort | |
2044 | in( octetstring -> MyPDU : function(f_decode) )" | |
2045 | } | |
2046 | } | |
2047 | <END_MODULE> | |
2048 | <RESULT IF_PASS NEGATIVE> | |
2049 | (?is)\berror: | |
2050 | <END_RESULT> | |
2051 | <RESULT IF_PASS NEGATIVE> | |
2052 | (?is)\bwarning: | |
2053 | <END_RESULT> | |
2054 | <RESULT IF_PASS POSITIVE> | |
2055 | (?im)Notify: File `Temp.hh' was generated. | |
2056 | <END_RESULT> | |
2057 | <END_TC> | |
2058 | ||
2059 | :exmp. | |
2060 | ||
2061 | .*---------------------------------------------------------------------* | |
2062 | :h3.Ports with dual interfaces, internal function as catch-all in mappings | |
2063 | .*---------------------------------------------------------------------* | |
2064 | :xmp tab=0. | |
2065 | ||
2066 | <TC - Ports with dual interfaces, internal function as catch-all in mappings> | |
2067 | ||
2068 | <COMPILE> | |
2069 | <VERDICT_LEAF PASS> | |
2070 | <MODULE TTCN Temp Temp.ttcn> | |
2071 | module Temp { | |
2072 | type integer MyPDU1 with { encode "RAW"; variant "" } | |
2073 | type boolean MyPDU2 with { encode "RAW"; variant "" } | |
2074 | function f_catchall_decode(in octetstring os, out MyPDU1 pdu) return integer { | |
2075 | pdu := 0; | |
2076 | return 0; | |
2077 | } with { extension "prototype(backtrack)" } | |
2078 | type port ProvPort message { in octetstring } | |
2079 | with { extension "internal provider" } | |
2080 | type port UserPort message { in MyPDU1, MyPDU2 } | |
2081 | with { extension "internal user ProvPort | |
2082 | in( octetstring -> MyPDU1 : decode(RAW), | |
2083 | MyPDU2 : decode(RAW), | |
2084 | MyPDU1 : function(f_catchall_decode) )" | |
2085 | } | |
2086 | } | |
2087 | <END_MODULE> | |
2088 | <RESULT IF_PASS NEGATIVE> | |
2089 | (?is)\berror: | |
2090 | <END_RESULT> | |
2091 | <RESULT IF_PASS NEGATIVE> | |
2092 | (?is)\bwarning: | |
2093 | <END_RESULT> | |
2094 | <RESULT IF_PASS POSITIVE> | |
2095 | (?im)Notify: File `Temp.hh' was generated. | |
2096 | <END_RESULT> | |
2097 | <END_TC> | |
2098 | ||
2099 | :exmp. |