Debian Codegraph @

regression_test/compileonly/mfgen-tpd/invalid_buildconfig_tpd/Hello123/src/MyExample1.ttcn

raw
1 /******************************************************************************
2 * Copyright (c) 2000-2021 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 v2.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
7 *
8 * Contributors:
9 * Balasko, Jeno
10 * Beres, Szabolcs
11 *
12 ******************************************************************************/
13 // TTCN-3 version of "Hello, world!"
14 module MyExample1
15 {
16 type record of integer ROI;
17 type port PCOType message
18 {
19 inout charstring;
20 }
21
22 type component MTCType
23 {
24 port PCOType MyPCO_PT;
25 }
26
27 testcase tc_HelloW() runs on MTCType system MTCType
28 {
29 map(mtc:MyPCO_PT, system:MyPCO_PT);
30 MyPCO_PT.send("Hello, world!");
31 setverdict(pass);
32 }
33
34 function f_tmpl(in template integer pt1, out template integer pt2, inout template integer pt3) {
35 for( var integer iii := 1, j:=10 ;iii<j;iii:=iii+1 ){
36 var integer myi;
37 myi := iii;
38 log("ii:",iii, j);
39 }
40 }
41
42 altstep as() runs on MTCType {
43 [] MyPCO_PT.receive { setverdict(fail); }
44 }
45
46 testcase tc_HelloW2() runs on MTCType system MTCType
47 {
48
49
50 for (var integer i:=0; i < 100; i := i + 1) {
51 i := 5;
52 var integer b := 5;
53
54 b := b + 6;
55
56 }
57
58 timer TL_T := 15.0;
59 map(mtc:MyPCO_PT, system:MyPCO_PT);
60 MyPCO_PT.send("Hello, world!");
61 var integer i := 5;
62 TL_T.start;
63 alt {
64 [i == 5] MyPCO_PT.receive("Hello, TTCN-3!") { TL_T.stop; setverdict(pass); }
65 [] TL_T.timeout { setverdict(inconc); }
66 [] MyPCO_PT.receive { TL_T.stop; setverdict(fail); }
67 }
68
69 as();
70 }
71
72 control
73 {
74 //action(tsp_valami);
75 // execute(tc_HelloW());
76 //execute(tc_HelloW2());
77 }
78 }