1 .******************************************************************************
2 .* Copyright (c) 2000-2016 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
12 .******************************************************************************/
16 :docname.Test Description
17 :docno. xy/152 91-CRL 113 200/5 Uen
23 :appr.ETH/RZ (Gyula Koos)
26 :title.Test description of the TTCN-3 Semantic Analyzer: Import of Imports
28 .*---------------------------------------------------------------------*
29 :h1.PREREQUISITES AND PREPARATIONS
30 .*---------------------------------------------------------------------*
31 .*---------------------------------------------------------------------*
32 :h2.Scope of the Test Object
33 .*---------------------------------------------------------------------*
35 This TD contains unified test cases related to TTCN3 Executor's import of imports function.
36 DON'T YOU DARE TO WRITE AN INSPECTION RECORD ABOUT THIS FILE
40 :p.:us.Revision Information:eus.
45 REV DATE PREPARED CHANGE
46 === ========== ======== ======
47 PA1 2011.11.21 ETHBAAT
52 .*---------------------------------------------------------------------*
54 .*---------------------------------------------------------------------*
55 :p.:us.Software Tools:eus.
62 .*---------------------------------------------------------------------*
63 :h1.REQUIREMENT-BASED TESTS
64 .*---------------------------------------------------------------------*
65 .*---------------------------------------------------------------------*
66 :h2.Testing Import of Imports feature
67 .*---------------------------------------------------------------------*
69 .*---------------------------------------------------------------------*
70 :h3. Default private import lines - virtual but not real circular import
71 .*---------------------------------------------------------------------*
74 <TC - Default private import lines - virtual but not real circular import >
78 <MODULE TTCN A A.ttcn>
80 import from C {import all};
81 const integer i_A := 60;
86 <MODULE TTCN B B.ttcn>
89 import from A {import all};
93 testcase tc_A() runs on CT {
100 <MODULE TTCN C C.ttcn>
103 import from B { import all };
104 const integer i_C:=3;
106 //because of "import from B { import all };" -but B contatains only private imports!
107 testcase tc_A() runs on CT {
108 var integer i:= i_A; //wrong
111 testcase tc_B() runs on CT {
119 C\.ttcn: In TTCN-3 module `C':
120 C\.ttcn:7.3-9.3: In testcase definition `tc_A':
121 C\.ttcn:8.17-23: In variable definition `i':
122 C\.ttcn:8.21-23: error: There is no local or imported definition with name `i_A'
124 )?(Notify: Error found in the input modules. Code will not be generated\.)
131 .*---------------------------------------------------------------------*
132 :h3. Explicit private import lines - No real circular import chain
133 .*---------------------------------------------------------------------*
136 <TC - Explicit private import lines - No real circular import chain>
140 <MODULE TTCN A_PR A_PR.ttcn>
142 private import from C_PR {import all};
143 const integer i_A := 60;
148 <MODULE TTCN B_PR B_PR.ttcn>
150 private import from A_PR all;
151 private import from A_PR {import all};
152 const integer i_B:=2;
154 testcase tc_A() runs on CT {
161 <MODULE TTCN C_PR C_PR.ttcn>
163 private import from B_PR all;
164 private import from B_PR { import all };
165 const integer i_C:=3;
167 //because of "private import from B_PR { import all };" -but B contatains only private imports!
168 testcase tc_A() runs on CT {
169 var integer i:= i_A; //wrong
172 testcase tc_B() runs on CT {
181 C_PR\.ttcn: In TTCN-3 module `C_PR':
182 C_PR\.ttcn:7.3-9.3: In testcase definition `tc_A':
183 C_PR\.ttcn:8.17-23: In variable definition `i':
184 C_PR\.ttcn:8.21-23: error: There is no local or imported definition with name `i_A'
186 )?(Notify: Error found in the input modules. Code will not be generated\.)
192 .*---------------------------------------------------------------------*
193 :h3. Chain of modules with public import statements - 3 circle of imports
194 .*---------------------------------------------------------------------*
196 <TC - Chain of modules with public import statements - 3 circle of imports>
201 <MODULE TTCN A_PU A_PU.ttcn>
203 public import from C_PU {import all}; //circle!
204 const integer i_A := 60;
208 <MODULE TTCN B_PU B_PU.ttcn>
210 public import from A_PU all;
211 public import from A_PU {import all}; //circle
212 const integer i_b:=2;
218 <MODULE TTCN C_PU C_PU.ttcn>
220 public import from B_PU all;
221 public import from B_PU { import all }; //circle
222 const integer i_C:=3;
229 A_PU.ttcn: In TTCN-3 module `A_PU':
230 A_PU.ttcn:2.10-38: In import definition:
231 A_PU.ttcn: warning: Circular import chain is not recommended: `@A_PU' -> `@C_PU' -> `@B_PU' -> `@A_PU'
236 .*---------------------------------------------------------------------*
237 :h3. Chain of modules with public import statements - one circle of imports
238 .*---------------------------------------------------------------------*
240 <TC - Chain of modules with public import statements - one circle of imports >
245 <MODULE TTCN A_PU A_PU.ttcn>
247 public import from C_PU {import all}; //circle !
248 const integer i_A := 60;
252 <MODULE TTCN B_PU B_PU.ttcn>
254 public import from A_PU all; //no circle
255 const integer i_B:=2;
260 <MODULE TTCN C_PU C_PU.ttcn>
262 public import from B_PU all; //sees i_B
263 public import from B_PU { import all };// sees: public import from A_PU all; =>sees: i_A. don't see: public import from C_PU {import all};(from A)
265 const integer i_C:=3;
271 A_PU.ttcn: In TTCN-3 module `A_PU':
272 A_PU.ttcn:2.10-38: In import definition:
273 A_PU.ttcn: warning: Circular import chain is not recommended: `@A_PU' -> `@C_PU' -> `@B_PU' -> `@A_PU'
279 .*---------------------------------------------------------------------*
280 :h4. Circular import check
281 .*---------------------------------------------------------------------*
283 <TC - Circular import check >
288 <MODULE TTCN a a.ttcn>
299 <MODULE TTCN b b.ttcn>
311 <MODULE TTCN c c.ttcn>
325 b.ttcn: In TTCN-3 module `b':
326 b.ttcn:2.5-21: In import definition:
327 b.ttcn: warning: Circular import chain is not recommended: `@b' -> `@c' -> `@b'