Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / preCompilerFlags / TpreCompilerFlags.ttcnpp
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 #include "test_macro.inc"
9 module TpreCompilerFlags {
10
11 type port TEST_PT message
12 {
13 inout charstring;
14 } with { extension "internal" }
15
16 type component MTC_CT
17 {
18 port TEST_PT TP;
19 };
20
21 function f_test() runs on MTC_CT
22 {
23 #define DEBUG
24 #include "test_include.inc"
25 #ifdef DEBUG
26 log("DEBUG is ON.");
27 #else
28 log("DEBUG is OFF.");
29 #endif
30 #undef DEBUG
31 #include "test_include.inc"
32 #ifdef DEBUG
33 log("DEBUG is ON.");
34 #else
35 log("DEBUG is OFF.");
36 #endif
37 setverdict(pass);
38 }
39
40 function f_pi() runs on MTC_CT
41 {
42 #define _ 1.0
43 log("PI=",4.0* -(
44 -_-_-_-_
45 -_-_-_-_-_-_-_-_-_
46 -_-_-_-_-_-_-_-_-_-_-_-_
47 -_-_-_-_-_-_-_-_-_-_-_-_-_-_
48 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
49 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
50 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
51 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
52 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
53 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
54 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
55 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
56 -_-_-_-_-_-_-_-_-_-_-_-_-_-_
57 -_-_-_-_-_-_-_-_-_-_-_-_
58 -_-_-_-_-_-_-_-_
59 -_-_-_-_
60 )/ (-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_)
61 / (-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_));
62 setverdict(pass);
63 }
64 function f_misc() runs on MTC_CT
65 {
66 #define MLC aaa bbb \
67 ccc ddd /* this is a multi
68 line comment */ \
69 eee
70 #define ADD(a,b) a+b
71 #define FIVE 5
72 #define TEN 10
73 log(ADD(FIVE,TEN));
74 setverdict(pass);
75 }
76 function f_sender() runs on MTC_CT
77 {
78 SEND
79 }
80 function f_receiver() runs on MTC_CT
81 {
82 var charstring vl_string;
83 timer Tl_t := 1.0;
84 Tl_t.start;
85 alt {
86 RECEIVE
87 TIMEOUT
88 }
89 }
90 testcase tc_test() runs on MTC_CT
91 {
92 f_test();
93 f_pi();
94 f_misc();
95 }
96 testcase tc_messaging() runs on MTC_CT
97 {
98 connect(mtc:TP, mtc:TP);
99 f_sender();
100 f_receiver();
101 }
102
103 control {
104 execute(tc_test());
105 execute(tc_messaging());
106 }
107 }
This page took 0.048263 seconds and 5 git commands to generate.