Merge pull request #19 from nspaseski/master
[deliverable/titan.core.git] / function_test / Semantic_Analyser / ASN_SA_asn1adhoc_TD.script
1 .******************************************************************************
2 .* Copyright (c) 2000-2015 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
17 :docno.20/15291-CRL200/5 Uen
18 :rev.
19 :date.2015-04-27
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.
34 REV DATE PREPARED CHANGE
35 __________________________________________________
36 - 2005-01-31 ETHESI New document for TITAN R1.6
37 :exmp.
38 .*---------------------------------------------------------------------*
39 :h2.Purpose
40 .*---------------------------------------------------------------------*
41 This document contains adhoc tests for ASN.1 Semantic Analyser. These test
42 cases shall be moved to different test descriptions in forthcoming
43 projects.
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>
55 Module-A DEFINITIONS ::=
56 BEGIN
57 EXPORTS Duplicate-symbol, Duplicate-symbol;
58 IMPORTS ;
59 Duplicate-symbol ::= BOOLEAN
60 END
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>
82 Module-A DEFINITIONS ::=
83 BEGIN
84 IMPORTS Duplicate-symbol, Duplicate-symbol FROM Module-B;
85 X ::= BOOLEAN
86 END
87 <END_MODULE>
88 <MODULE ASN Module-B ModuleB.asn>
89 Module-B DEFINITIONS ::=
90 BEGIN
91 IMPORTS ;
92 Duplicate-symbol ::= BOOLEAN
93 END
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>
115 Module-A DEFINITIONS ::=
116 BEGIN
117 IMPORTS ;
118 -- TR 677: Duplicate symbol check in a module
119 Duplicate-symbol ::= BOOLEAN
120 Duplicate-symbol ::= INTEGER
121 END
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>
143 Module-A DEFINITIONS ::=
144 BEGIN
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
150 END
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>
178 Module-A DEFINITIONS ::=
179 BEGIN
180 IMPORTS X, Hidden-symbol FROM Module-B;
181 Z ::= INTEGER
182 END
183 <END_MODULE>
184 <MODULE ASN Module-B ModuleB.asn>
185 Module-B DEFINITIONS ::=
186 BEGIN
187 EXPORTS X;
188 IMPORTS ;
189 X ::= BOOLEAN
190 Hidden-symbol ::= INTEGER
191 END
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>
213 Module-A DEFINITIONS ::=
214 BEGIN
215 IMPORTS T3type FROM ModuleB;
216 Z ::= INTEGER
217 END
218 <END_MODULE>
219 <MODULE TTCN ModuleB ModuleB.ttcn>
220 module 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>
244 Module-A DEFINITIONS ::=
245 BEGIN
246 IMPORTS Z FROM Module-A;
247 Z ::= INTEGER
248 END
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>
270 Module-A DEFINITIONS ::=
271 BEGIN
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
276 END
277 <END_MODULE>
278 <MODULE ASN Module-B ModuleB.asn>
279 Module-B DEFINITIONS ::=
280 BEGIN
281 IMPORTS ;
282 B ::= INTEGER
283 END
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"
308 module-A DEFINITIONS ::=
309 BEGIN
310 IMPORTS ;
311 Z ::= INTEGER
312 END
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>
340 Module-A DEFINITIONS ::=
341 BEGIN
342 IMPORTS X, Nonexi FROM Module-B;
343 Z ::= Module-B.Nonexi
344 END
345 <END_MODULE>
346 <MODULE ASN Module-B ModuleB.asn>
347 Module-B DEFINITIONS ::=
348 BEGIN
349 IMPORTS ;
350 X ::= INTEGER
351 END
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>
373 Module-A DEFINITIONS ::=
374 BEGIN
375 IMPORTS Ambi-ass FROM Module-B
376 Ambi-ass FROM Module-C;
377 Z ::= INTEGER
378 X ::= Ambi-ass
379 END
380 <END_MODULE>
381 <MODULE ASN Module-B ModuleB.asn>
382 Module-B DEFINITIONS ::=
383 BEGIN
384 IMPORTS ;
385 Ambi-ass ::= INTEGER
386 END
387 <END_MODULE>
388 <MODULE ASN Module-C ModuleC.asn>
389 Module-C DEFINITIONS ::=
390 BEGIN
391 IMPORTS ;
392 Ambi-ass ::= INTEGER
393 END
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.03891 seconds and 5 git commands to generate.