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 .******************************************************************************/
11 :docname.Test Description
18 :appr.ETH/RZ (Gyula Koos)
21 :title.Test description of the TTCN-3 Semantic Analyzer: Import of Imports
23 .*---------------------------------------------------------------------*
24 :h1.PREREQUISITES AND PREPARATIONS
25 .*---------------------------------------------------------------------*
26 .*---------------------------------------------------------------------*
27 :h2.Scope of the Test Object
28 .*---------------------------------------------------------------------*
30 This TD contains unified test cases related to TTCN3 Executor's import of imports function.
31 DON'T YOU DARE TO WRITE AN INSPECTION RECORD ABOUT THIS FILE
35 :p.:us.Revision Information:eus.
40 REV DATE PREPARED CHANGE
41 === ========== ======== ======
42 PA1 2011.11.21 ETHBAAT
47 .*---------------------------------------------------------------------*
49 .*---------------------------------------------------------------------*
50 :p.:us.Software Tools:eus.
57 .*---------------------------------------------------------------------*
58 :h1.REQUIREMENT-BASED TESTS
59 .*---------------------------------------------------------------------*
60 .*---------------------------------------------------------------------*
61 :h2.Testing Import of Imports feature
62 .*---------------------------------------------------------------------*
64 .*---------------------------------------------------------------------*
65 :h3. Default private import lines - virtual but not real circular import
66 .*---------------------------------------------------------------------*
69 <TC - Default private import lines - virtual but not real circular import >
73 <MODULE TTCN A A.ttcn>
75 import from C {import all};
76 const integer i_A := 60;
81 <MODULE TTCN B B.ttcn>
84 import from A {import all};
88 testcase tc_A() runs on CT {
95 <MODULE TTCN C C.ttcn>
98 import from B { import all };
101 //because of "import from B { import all };" -but B contatains only private imports!
102 testcase tc_A() runs on CT {
103 var integer i:= i_A; //wrong
106 testcase tc_B() runs on CT {
114 C\.ttcn: In TTCN-3 module `C':
115 C\.ttcn:7.3-9.3: In testcase definition `tc_A':
116 C\.ttcn:8.17-23: In variable definition `i':
117 C\.ttcn:8.21-23: error: There is no local or imported definition with name `i_A'
119 )?(Notify: Error found in the input modules. Code will not be generated\.)
126 .*---------------------------------------------------------------------*
127 :h3. Explicit private import lines - No real circular import chain
128 .*---------------------------------------------------------------------*
131 <TC - Explicit private import lines - No real circular import chain>
135 <MODULE TTCN A_PR A_PR.ttcn>
137 private import from C_PR {import all};
138 const integer i_A := 60;
143 <MODULE TTCN B_PR B_PR.ttcn>
145 private import from A_PR all;
146 private import from A_PR {import all};
147 const integer i_B:=2;
149 testcase tc_A() runs on CT {
156 <MODULE TTCN C_PR C_PR.ttcn>
158 private import from B_PR all;
159 private import from B_PR { import all };
160 const integer i_C:=3;
162 //because of "private import from B_PR { import all };" -but B contatains only private imports!
163 testcase tc_A() runs on CT {
164 var integer i:= i_A; //wrong
167 testcase tc_B() runs on CT {
176 C_PR\.ttcn: In TTCN-3 module `C_PR':
177 C_PR\.ttcn:7.3-9.3: In testcase definition `tc_A':
178 C_PR\.ttcn:8.17-23: In variable definition `i':
179 C_PR\.ttcn:8.21-23: error: There is no local or imported definition with name `i_A'
181 )?(Notify: Error found in the input modules. Code will not be generated\.)
187 .*---------------------------------------------------------------------*
188 :h3. Chain of modules with public import statements - 3 circle of imports
189 .*---------------------------------------------------------------------*
191 <TC - Chain of modules with public import statements - 3 circle of imports>
196 <MODULE TTCN A_PU A_PU.ttcn>
198 public import from C_PU {import all}; //circle!
199 const integer i_A := 60;
203 <MODULE TTCN B_PU B_PU.ttcn>
205 public import from A_PU all;
206 public import from A_PU {import all}; //circle
207 const integer i_b:=2;
213 <MODULE TTCN C_PU C_PU.ttcn>
215 public import from B_PU all;
216 public import from B_PU { import all }; //circle
217 const integer i_C:=3;
224 A_PU.ttcn: In TTCN-3 module `A_PU':
225 A_PU.ttcn:2.10-38: In import definition:
226 A_PU.ttcn: warning: Circular import chain is not recommended: `@A_PU' -> `@C_PU' -> `@B_PU' -> `@A_PU'
231 .*---------------------------------------------------------------------*
232 :h3. Chain of modules with public import statements - one circle of imports
233 .*---------------------------------------------------------------------*
235 <TC - Chain of modules with public import statements - one circle of imports >
240 <MODULE TTCN A_PU A_PU.ttcn>
242 public import from C_PU {import all}; //circle !
243 const integer i_A := 60;
247 <MODULE TTCN B_PU B_PU.ttcn>
249 public import from A_PU all; //no circle
250 const integer i_B:=2;
255 <MODULE TTCN C_PU C_PU.ttcn>
257 public import from B_PU all; //sees i_B
258 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)
260 const integer i_C:=3;
266 A_PU.ttcn: In TTCN-3 module `A_PU':
267 A_PU.ttcn:2.10-38: In import definition:
268 A_PU.ttcn: warning: Circular import chain is not recommended: `@A_PU' -> `@C_PU' -> `@B_PU' -> `@A_PU'
274 .*---------------------------------------------------------------------*
275 :h4. Circular import check
276 .*---------------------------------------------------------------------*
278 <TC - Circular import check >
283 <MODULE TTCN a a.ttcn>
294 <MODULE TTCN b b.ttcn>
306 <MODULE TTCN c c.ttcn>
320 b.ttcn: In TTCN-3 module `b':
321 b.ttcn:2.5-21: In import definition:
322 b.ttcn: warning: Circular import chain is not recommended: `@b' -> `@c' -> `@b'