Sync with 5.3.0
[deliverable/titan.core.git] / function_test / Semantic_Analyser / ASN_SA_asn1adhoc_TD.script
CommitLineData
970ed795
EL
1.******************************************************************************
2.* Copyright (c) 2000-2014 Ericsson Telecom AB
3.* All rights reserved. This program and the accompanying materials
4.* are made available under the terms of the Eclipse Public License v1.0
5.* which accompanies this distribution, and is available at
6.* http://www.eclipse.org/legal/epl-v10.html
7.******************************************************************************/
8:text.
9:lang eng.
10
11.* EDML webpage: http://cpi.ericsson.se/dwaxe/
12.* EDML2PDF converter: http://dwaxe.ericsson.se/x2pdf
13.* EDML user guide: http://www.lmc.ericsson.se/~lmcmarg/isit/edml_ug.html
14
15.* Document header information
16:docname.Test Description
a38c6d4c 17:docno.20/15291-CRL200/5 Uen
970ed795 18:rev.
a38c6d4c 19:date.2015-04-27
970ed795
EL
20
21:prep.ETH/RZD Endre Szalai (+36 1 437 7796)
22:appr.
23:checked.
24
25:title.Test description of the Semantic Analyzer: Adhoc tests
26:contents level=2.
27.*---------------------------------------------------------------------*
28:h1.Introduction
29.*---------------------------------------------------------------------*
30.*---------------------------------------------------------------------*
31:h2.Revision history
32.*---------------------------------------------------------------------*
33:xmp tab=2.
34REV DATE PREPARED CHANGE
35__________________________________________________
a38c6d4c 36- 2005-01-31 ETHESI New document for TITAN R1.6
970ed795
EL
37:exmp.
38.*---------------------------------------------------------------------*
39:h2.Purpose
40.*---------------------------------------------------------------------*
41This document contains adhoc tests for ASN.1 Semantic Analyser. These test
42cases shall be moved to different test descriptions in forthcoming
43projects.
44.*---------------------------------------------------------------------*
45:h2.Test cases - ASN.1
46.*---------------------------------------------------------------------*
47.*---------------------------------------------------------------------*
48:h3.ASN1::Not unique symbol: EXPORTS
49.*---------------------------------------------------------------------*
50:xmp tab=0.
51<TC - ASN1::Not unique symbol: EXPORTS>
52<COMPILE>
53<VERDICT_LEAF PASS>
54<MODULE ASN Module-A ModuleA.asn>
55Module-A DEFINITIONS ::=
56BEGIN
57 EXPORTS Duplicate-symbol, Duplicate-symbol;
58 IMPORTS ;
59 Duplicate-symbol ::= BOOLEAN
60END
61<END_MODULE>
62<RESULT IF_PASS COUNT 1>
63(?im)\berror\b.+?Duplicate.+?identifier.+?in.+?SymbolList.+?Duplicate-symbol
64<END_RESULT>
65<RESULT IF_PASS COUNT 1>
66(?is)\berror:
67<END_RESULT>
68<RESULT IF_PASS COUNT 1>
69(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
70<END_RESULT>
71<END_TC>
72:exmp.
73
74.*---------------------------------------------------------------------*
75:h3.ASN1::Not unique symbol: IMPORTS
76.*---------------------------------------------------------------------*
77:xmp tab=0.
78<TC - ASN1::Not unique symbol: IMPORTS>
79<COMPILE>
80<VERDICT_LEAF PASS>
81<MODULE ASN Module-A ModuleA.asn>
82Module-A DEFINITIONS ::=
83BEGIN
84 IMPORTS Duplicate-symbol, Duplicate-symbol FROM Module-B;
85 X ::= BOOLEAN
86END
87<END_MODULE>
88<MODULE ASN Module-B ModuleB.asn>
89Module-B DEFINITIONS ::=
90BEGIN
91 IMPORTS ;
92 Duplicate-symbol ::= BOOLEAN
93END
94<END_MODULE>
95<RESULT IF_PASS COUNT 1>
96(?im)\berror\b.+?Duplicate.+?identifier.+?in.+?SymbolList.+?Duplicate-symbol
97<END_RESULT>
98<RESULT IF_PASS COUNT 1>
99(?is)\berror:
100<END_RESULT>
101<RESULT IF_PASS COUNT 1>
102(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
103<END_RESULT>
104<END_TC>
105:exmp.
106
107.*---------------------------------------------------------------------*
108:h3.ASN1::Not unique assignment: Assignments of a module
109.*---------------------------------------------------------------------*
110:xmp tab=0.
111<TC - ASN1::Not unique assignment: Assignments of a module>
112<COMPILE>
113<VERDICT_LEAF PASS>
114<MODULE ASN Module-A ModuleA.asn>
115Module-A DEFINITIONS ::=
116BEGIN
117 IMPORTS ;
118 -- TR 677: Duplicate symbol check in a module
119 Duplicate-symbol ::= BOOLEAN
120 Duplicate-symbol ::= INTEGER
121END
122<END_MODULE>
123<RESULT IF_PASS COUNT 1>
124(?im)\berror\b.+?Duplicate.+?assignment.+?Duplicate-symbol
125<END_RESULT>
126<RESULT IF_PASS COUNT 1>
127(?im)\bnote\b.+?previous.+?assignment.+?Duplicate-symbol.+?here
128<END_RESULT>
129<RESULT IF_PASS COUNT 1>
130(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
131<END_RESULT>
132<END_TC>
133:exmp.
134
135.*---------------------------------------------------------------------*
136:h3.ASN1::Not unique assignment: Reserved assignment
137.*---------------------------------------------------------------------*
138:xmp tab=0.
139<TC - ASN1::Not unique assignment: Reserved assignment>
140<COMPILE>
141<VERDICT_LEAF FAIL>
142<MODULE ASN Module-A ModuleA.asn>
143Module-A DEFINITIONS ::=
144BEGIN
145 IMPORTS ;
146 -- NOTE: it's not clear how to trigger the error message in SA, if
147 -- the parser always cathces the reserved identifiers.
148 -- in Assignments::chk_uniq(): "`%s' is a reserved identifier"
149 EMBEDDED PDV ::= INTEGER
150END
151<END_MODULE>
152<RESULT IF_PASS COUNT 1>
153(?im)\berror\b.+?Duplicated.+?identifier.+?in.+?SymbolList.+?Duplicated-symbol
154<END_RESULT>
155<RESULT IF_PASS COUNT 1>
156(?is)\berror:
157<END_RESULT>
158<RESULT IF_PASS COUNT 1>
159(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
160<END_RESULT>
161<RESULT IF_FAIL COUNT 1>
162(?im)\berror\b.+?syntax.+?error.+?unexpected.+?embedded
163<END_RESULT>
164<RESULT IF_FAIL COUNT 1>
165(?is)\berror:
166<END_RESULT>
167<END_TC>
168:exmp.
169
170.*---------------------------------------------------------------------*
171:h3.ASN1::Symbol is not exported
172.*---------------------------------------------------------------------*
173:xmp tab=0.
174<TC - ASN1::Symbol is not exported>
175<COMPILE>
176<VERDICT_LEAF PASS>
177<MODULE ASN Module-A ModuleA.asn>
178Module-A DEFINITIONS ::=
179BEGIN
180 IMPORTS X, Hidden-symbol FROM Module-B;
181 Z ::= INTEGER
182END
183<END_MODULE>
184<MODULE ASN Module-B ModuleB.asn>
185Module-B DEFINITIONS ::=
186BEGIN
187 EXPORTS X;
188 IMPORTS ;
189 X ::= BOOLEAN
190 Hidden-symbol ::= INTEGER
191END
192<END_MODULE>
193<RESULT IF_PASS COUNT 1>
194(?im)\berror\b.+?symbol.+?Hidden-symbol.+?not.+?exported
195<END_RESULT>
196<RESULT IF_PASS COUNT 1>
197(?is)\berror:
198<END_RESULT>
199<RESULT IF_PASS COUNT 1>
200(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
201<END_RESULT>
202<END_TC>
203:exmp.
204
205.*---------------------------------------------------------------------*
206:h3.ASN1::Import from a TTCN-3 module
207.*---------------------------------------------------------------------*
208:xmp tab=0.
209<TC - ASN1::Import from a TTCN-3 module>
210<COMPILE>
211<VERDICT_LEAF PASS>
212<MODULE ASN Module-A ModuleA.asn>
213Module-A DEFINITIONS ::=
214BEGIN
215 IMPORTS T3type FROM ModuleB;
216 Z ::= INTEGER
217END
218<END_MODULE>
219<MODULE TTCN ModuleB ModuleB.ttcn>
220module ModuleB {
221 type integer T3type;
222}
223<END_MODULE>
224<RESULT IF_PASS COUNT 1>
225(?im)\berror\b.+?cannot.+?import.+?from.+?TTCN.*?3.+?module
226<END_RESULT>
227<RESULT IF_PASS COUNT 1>
228(?is)\berror:
229<END_RESULT>
230<RESULT IF_PASS COUNT 1>
231(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
232<END_RESULT>
233<END_TC>
234:exmp.
235
236.*---------------------------------------------------------------------*
237:h3.ASN1::Importing from itself
238.*---------------------------------------------------------------------*
239:xmp tab=0.
240<TC - ASN1::Importing from itself>
241<COMPILE>
242<VERDICT_LEAF PASS>
243<MODULE ASN Module-A ModuleA.asn>
244Module-A DEFINITIONS ::=
245BEGIN
246 IMPORTS Z FROM Module-A;
247 Z ::= INTEGER
248END
249<END_MODULE>
250<RESULT IF_PASS COUNT 1>
251(?im)\berror\b.+?cannot.+?import.+?from.+?itself
252<END_RESULT>
253<RESULT IF_PASS COUNT 1>
254(?is)\berror:
255<END_RESULT>
256<RESULT IF_PASS COUNT 1>
257(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
258<END_RESULT>
259<END_TC>
260:exmp.
261
262.*---------------------------------------------------------------------*
263:h3.ASN1::Duplicated import
264.*---------------------------------------------------------------------*
265:xmp tab=0.
266<TC - ASN1::Duplicated import>
267<COMPILE>
268<VERDICT_LEAF PASS>
269<MODULE ASN Module-A ModuleA.asn>
270Module-A DEFINITIONS ::=
271BEGIN
272 -- TR 676: Unnecessary error message when symbol is not unique in the IMPORTS section
273 IMPORTS B FROM Module-B
274 B FROM Module-B;
275 A ::= INTEGER
276END
277<END_MODULE>
278<MODULE ASN Module-B ModuleB.asn>
279Module-B DEFINITIONS ::=
280BEGIN
281 IMPORTS ;
282 B ::= INTEGER
283END
284<END_MODULE>
285<RESULT IF_PASS COUNT 1>
286(?im)\berror\b.+?duplicate.+?import.+?from.+?Module-B
287<END_RESULT>
288<RESULT IF_PASS COUNT 1>
289(?is)\berror:
290<END_RESULT>
291<RESULT IF_PASS COUNT 1>
292(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
293<END_RESULT>
294<END_TC>
295:exmp.
296
297.*---------------------------------------------------------------------*
298:h3.ASN1::Invalid module identifier
299.*---------------------------------------------------------------------*
300:xmp tab=0.
301<TC - ASN1::Invalid module identifier>
302<COMPILE>
303<VERDICT_LEAF FAIL>
304<MODULE ASN module-A ModuleA.asn>
305-- catched by the parser or even before (at module recognition)
306-- Therefore it's not clear how to trigger the error message:
307-- in Module::Module: "`%s' is not a valid module identifier"
308module-A DEFINITIONS ::=
309BEGIN
310 IMPORTS ;
311 Z ::= INTEGER
312END
313<END_MODULE>
314<RESULT IF_PASS COUNT 1>
315(?im)\berror\b.+?not.+?valid.+?module.+?identifier
316<END_RESULT>
317<RESULT IF_PASS COUNT 1>
318(?is)\berror:
319<END_RESULT>
320<RESULT IF_PASS COUNT 1>
321(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
322<END_RESULT>
323<RESULT IF_FAIL COUNT 1>
324(?im)\berror\b.+?cannot.+?recognize.+?as.+?asn.*?1.+?module
325<END_RESULT>
326<RESULT IF_FAIL COUNT 1>
327(?is)\berror:
328<END_RESULT>
329<END_TC>
330:exmp.
331
332.*---------------------------------------------------------------------*
333:h3.ASN1::No assignment in the referenced module
334.*---------------------------------------------------------------------*
335:xmp tab=0.
336<TC - ASN1::No assignment in the referenced module>
337<COMPILE>
338<VERDICT_LEAF FAIL>
339<MODULE ASN Module-A ModuleA.asn>
340Module-A DEFINITIONS ::=
341BEGIN
342 IMPORTS X, Nonexi FROM Module-B;
343 Z ::= Module-B.Nonexi
344END
345<END_MODULE>
346<MODULE ASN Module-B ModuleB.asn>
347Module-B DEFINITIONS ::=
348BEGIN
349 IMPORTS ;
350 X ::= INTEGER
351END
352<END_MODULE>
353<RESULT IF_PASS COUNT 1>
354(?im)\berror\b.+?not.+?valid.+?module.+?identifier
355<END_RESULT>
356<RESULT IF_PASS COUNT 1>
357(?is)\berror:
358<END_RESULT>
359<RESULT IF_PASS COUNT 1>
360(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
361<END_RESULT>
362<END_TC>
363:exmp.
364
365.*---------------------------------------------------------------------*
366:h3.ASN1::Ambiguous assignment reference
367.*---------------------------------------------------------------------*
368:xmp tab=0.
369<TC - ASN1::Ambiguous assignment reference>
370<COMPILE>
371<VERDICT_LEAF FAIL>
372<MODULE ASN Module-A ModuleA.asn>
373Module-A DEFINITIONS ::=
374BEGIN
375 IMPORTS Ambi-ass FROM Module-B
376 Ambi-ass FROM Module-C;
377 Z ::= INTEGER
378 X ::= Ambi-ass
379END
380<END_MODULE>
381<MODULE ASN Module-B ModuleB.asn>
382Module-B DEFINITIONS ::=
383BEGIN
384 IMPORTS ;
385 Ambi-ass ::= INTEGER
386END
387<END_MODULE>
388<MODULE ASN Module-C ModuleC.asn>
389Module-C DEFINITIONS ::=
390BEGIN
391 IMPORTS ;
392 Ambi-ass ::= INTEGER
393END
394<END_MODULE>
395<RESULT IF_PASS COUNT 1>
396(?im)\berror\b.+?not.+?valid.+?module.+?identifier
397<END_RESULT>
398<RESULT IF_PASS COUNT 1>
399(?is)\berror:
400<END_RESULT>
401<RESULT IF_PASS COUNT 1>
402(?im)\bnotify\b.+?\bcode\b.+?\bnot\b.+?\bgenerated\b
403<END_RESULT>
404<END_TC>
405:exmp.
406
407:etext.
408
This page took 0.037922 seconds and 5 git commands to generate.