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 ******************************************************************************/
8 //^In TTCN\-3 module \`C_BPU_SE\'\:$//
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
14 public modulepar charstring tsp_C_ch := "This is a modulepar in C"
16 public import from B_APU_SE all;
17 public import from B_APU_SE {import all};
19 type component MTC {};
23 const integer c_C_i := 0;
24 public const integer c_C_i_pu := 0;
25 friend const integer c_C_i_fr := 0;
26 private const integer c_C_i_pr := 0;
29 template integer t_C_i := 0;
30 public template integer t_C_i_pu := 0;
31 friend template integer t_C_i_fr := 0;
32 private template integer t_C_i_pr := 0;
36 public type integer C_MyInt_pu;
37 private type integer C_MyInt_pr;
38 friend type integer C_MyInt_fr;
41 /* public */ function f_C() { log("This is f_C") }
42 public function f_C_pu() { log("This is f_C_pu") }
43 friend function f_C_fr() { log("This is f_C_fr") }
44 private function f_C_pr() { log("This is f_C_pr") }
46 //=============Testcases=========================================
48 // Public members of A are visible and
49 // "public import from A_SE all;" of B_APU is visible via "public import from B_APU_SE {import from all};" , therefore public objects defined in A are imported
50 testcase tc_A() runs on MTC { //^In testcase definition `tc_A'://
56 var A_MyInt_pu myInt_pu;
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'//
72 //Only public and friend members of B_APU are visible and imported:
74 testcase tc_B() runs on MTC { //^In testcase definition `tc_B'://
80 var B_MyInt_pu myInt_pu;
86 var B_MyInt_fr myInt_fr;
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'//