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