Sync with 5.4.0
[deliverable/titan.core.git] / function_test / Semantic_Analyser / import_of_iports / C_FR_SE.ttcn
CommitLineData
114d1c9a 1/******************************************************************************
3abe9331 2 * Copyright (c) 2000-2015 Ericsson Telecom AB
114d1c9a
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//^In TTCN\-3 module \`C_FR_SE\'\:$//
9// This module
10// 1. provides a module with "public import from B_APU_SE all; public import from B_APU_SE {import from all};" to test import statement located in prev. next modules and this module
11// 2. provides a module which a friend of A_SE
12// 3. provides a module which is a friend of B_CEFR_SE
13module C_FR_SE {
14
15public modulepar charstring tsp_C_ch := "This is a modulepar in C"
16
17public import from B_CEFR_SE all;
18public import from B_CEFR_SE {import all};
19
20type component MTC {};
21
22
23//==CONST===
24const integer c_C_i := 0;
25public const integer c_C_i_pu := 0;
26friend const integer c_C_i_fr := 0;
27private const integer c_C_i_pr := 0;
28
29//==TEMPLATES===
30template integer t_C_i := 0;
31public template integer t_C_i_pu := 0;
32friend template integer t_C_i_fr := 0;
33private template integer t_C_i_pr := 0;
34
35//===TYPES===
36type integer C_MyInt;
37public type integer C_MyInt_pu;
38private type integer C_MyInt_pr;
39friend type integer C_MyInt_fr;
40
41//==functions
42/* public */ function f_C() { log("This is f_C") }
43public function f_C_pu() { log("This is f_C_pu") }
44friend function f_C_fr() { log("This is f_C_fr") }
45private function f_C_pr() { log("This is f_C_pr") }
46
47//=============Testcases=========================================
48
49// Public members of A are visible and
50// "public import from A_SE all;" of B_APU is visible via "public import from B_APU_SE {import from all};" ,
51// therefore public objects defined in A are imported
52testcase tc_A() runs on MTC { //^In testcase definition `tc_A'://
53 var integer i:=c_A_i;
54 i:=c_A_i_pu;
55 i:=valueof(t_A_i);
56 i:=valueof(t_A_i_pu);
57 var A_MyInt myInt;
58 var A_MyInt_pu myInt_pu;
59 f_A();
60 f_A_pu();
61
62 i:=c_A_i_fr; //^In variable assignment:// //^error: There is no local or imported definition with name `c_A_i_fr'//
63 i:=valueof(t_A_i_fr); //^In variable assignment:// //In the operand of operation `valueof\(\)'// //^error: There is no local or imported definition with name `t_A_i_fr'//
64 var A_MyInt_fr myInt_fr; //^In variable definition `myInt_fr'// //^error: There is no local or imported definition with name `A_MyInt_fr'//
65 f_A_fr();//^In function or altstep instance:// //^error: There is no local or imported definition with name `f_A_fr'//
66
67 i:=c_A_i_pr;//^In variable assignment:// //^error: There is no local or imported definition with name `c_A_i_pr'//
68 i:=valueof(t_A_i_pr);//^In variable assignment:// //In the operand of operation `valueof\(\)'// //^error: There is no local or imported definition with name `t_A_i_pr'//
69 var A_MyInt_pr a_myInt_pr;//^In variable definition `a_myInt_pr'// //^error: There is no local or imported definition with name `A_MyInt_pr'//
70 f_A_pr();//^In function or altstep instance:// //^error: There is no local or imported definition with name `f_A_pr'//
71 setverdict(pass);
72}
73
74//Only public and friend members of B_APU are visible and imported:
75
76testcase tc_B() runs on MTC { //^In testcase definition `tc_B'://
77 var integer i:=c_B_i;
78 i:=c_B_i_pu;
79 i:=valueof(t_B_i_pu);
80 i:=valueof(t_B_i);
81 var B_MyInt myInt;
82 var B_MyInt_pu myInt_pu;
83 f_B();
84 f_B_pu();
85
86 i:=c_B_i_fr;
87 i:=valueof(t_B_i_fr);
88 var B_MyInt_fr myInt_fr;
89 f_B_fr();
90
91 i:=c_B_i_pr;//^In variable assignment\:$// //^error: There is no local or imported definition with name `c_B_i_pr'//
92 i:=valueof(t_B_i_pr);//^In variable assignment:// //In the operand of operation `valueof\(\)'// //^error: There is no local or imported definition with name `t_B_i_pr'//
93 var B_MyInt_pr b_myInt_pr; //^In variable definition `b_myInt_pr'////^error: There is no local or imported definition with name `B_MyInt_pr'//
94 f_B_pr(); //^In function or altstep instance:// //^error: There is no local or imported definition with name `f_B_pr'//
95 setverdict(pass);
96}
97
98
99}
This page took 0.027806 seconds and 5 git commands to generate.