Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / ASN1 / Test330 / Test330T.ttcn
CommitLineData
970ed795 1/******************************************************************************
3abe9331 2 * Copyright (c) 2000-2015 Ericsson Telecom AB
970ed795
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 ******************************************************************************/
8module Test330T
9{
10
11import from Test330A all;
12/*
13// start of simulated import from ASN
14//note : the following commented out section should be equivalent to
15//the sequences imported from ASN1
16type union MyUnion {
17 boolean bOOLEAN ,
18 bitstring bIT_STRING ,
19 octetstring oCTET_STRING }
20
21type record MyExampleMessageType1
22{
23integer field1 , //Type
24
25MyUnion field2
26
27}
28//end of simulated import from ASN
29*/
30
31template MyExampleMessageType1 myExampleMessage1 :=
32{
33field1 := ?,
34
35field2 := ?
36}
37
38template MyExampleMessageType1 myExampleMessage2 :=
39{
40field1 := *,
41
42field2 := *
43}
44
45template MyExampleMessageType1 myExampleMessage3 :=
46{
47field1 := 10,
48
49field2 := {bOOLEAN := true} // bOOLEAN????
50}
51
52//*********************************************
53
54const MyExampleMessageType1 myExampleMessage4 :=
55{
56field1 := 6, // has to be integer
57
58field2 := {bOOLEAN := true} // bOOLEAN????
59}
60
61const MyExampleMessageType1 myExampleMessage5 :=
62{
63field1 := 6, // has to be integer
64
65field2 := {bIT_STRING := '001100'B} //bIT_STRING????
66}
67
68const MyExampleMessageType1 myExampleMessage6 :=
69{
70field1 := 6, // has to be integer
71
72field2 := {oCTET_STRING := '1234567890ABCDEF'O} //oCTET_STRING???
73}
74
75//*********************************************
76
77type port MyPort message
78{
79inout MyType
80} with { extension "internal" }
81
82type record MyType
83{
84MyExampleMessageType1 firstfield
85}
86
87template MyType myMessage(template MyExampleMessageType1 par_MyExampleMessageType1) :=
88{
89firstfield := par_MyExampleMessageType1
90}
91
92type component MyMainComponent
93 {
94 port MyPort M_PCO;
95 }
96
97type component MyParallelComponent
98 {
99 port MyPort P_PCO;
100 }
101
102function handle_msg_on_ptc() runs on MyParallelComponent
103{
104
105// AS PARAMETER *********************************************
106P_PCO.receive (myMessage(myExampleMessage1))
107setverdict ( pass );
108
109P_PCO.receive (myMessage(myExampleMessage2))
110setverdict ( pass );
111
112P_PCO.receive (myMessage(myExampleMessage3))
113setverdict ( pass );
114
115P_PCO.receive (myMessage(myExampleMessage4))
116setverdict ( pass );
117
118P_PCO.receive (myMessage(myExampleMessage5))
119setverdict ( pass );
120
121P_PCO.receive (myMessage(myExampleMessage6))
122setverdict ( pass );
123
124P_PCO.receive (myMessage(myExampleMessage1))
125setverdict ( pass );
126
127} // end of function
128
129testcase Test() runs on MyMainComponent
130{
131
132// AS A VARIABLE *********************************************
133var MyExampleMessageType1 myExampleMessage7 := myExampleMessage4
134
135var MyParallelComponent myparallelcomponent := MyParallelComponent.create;
136connect ( mtc:M_PCO, myparallelcomponent: P_PCO );
137 myparallelcomponent.start(handle_msg_on_ptc());
138
139// AS A PARAMETER *********************************************
140M_PCO.send(myMessage(myExampleMessage3))
141
142M_PCO.send(myMessage(myExampleMessage3))
143
144M_PCO.send(myMessage(myExampleMessage3))
145
146M_PCO.send(myMessage(myExampleMessage4))
147
148M_PCO.send(myMessage(myExampleMessage5))
149
150M_PCO.send(myMessage(myExampleMessage6))
151
152M_PCO.send(myMessage(myExampleMessage7))
153
154myparallelcomponent.done;
155}
156
157control
158 {
159 execute (Test())
160 }
161
162} // end of module
This page took 0.032531 seconds and 5 git commands to generate.