conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / B_matching_incoming_values / B01_template_matching / B0101_matching_specific_values / B0101_toplevel / Sem_B0101_matching_specific_value_005.ttcn
1 /******************************************************************************
2 * Copyright (c) 2000-2016 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 * Contributors:
9 * Adrien Kirjak – initial implementation
10 *
11 ** @version 0.0.1
12 ** @purpose 1:B.1.1, Ensure that the IUT correctly handles template matching of specific values
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16 module Sem_B0101_matching_specific_value_005 {
17
18 type enumerated EnumeratedType {e_black, e_white};
19
20 type record RecordType {
21 integer a optional,
22 integer b optional,
23 boolean c
24 }
25
26 type set SetType {
27 integer a optional,
28 integer b optional,
29 boolean c
30 }
31
32 type record length (1..2) of integer IntegerList;
33
34 type set length (1..2) of integer IntegerUList;
35
36 type union UnionType {
37 integer a,
38 EnumeratedType b,
39 boolean c
40 }
41
42 type record MessageType {
43 integer field1,
44 charstring field2,
45 boolean field3,
46 integer field4[4],
47 EnumeratedType field5,
48 RecordType field6,
49 SetType field7,
50 UnionType field8,
51 IntegerList field9,
52 IntegerUList field10
53 }
54
55 type port loopbackPort message {
56 inout MessageType
57 } with {extension "internal"}
58
59 type component GeneralComp {
60 port loopbackPort messagePort
61 }
62
63 testcase TC_Sem_B0101_matching_specific_value_005() runs on GeneralComp {
64
65 var MessageType v_testMessage;
66
67 template MessageType mw_matchingTemplate:=
68 {
69 field1 := 1,
70 field2 := "test string",
71 field3 := true,
72 field4 := {1,2,3,5}, //mismatching value
73 field5 := e_black,
74 field6 := {a:=1,b:=2,c:=true},
75 field7 := {a:=1,b:=2,c:=true},
76 field8 := {a:=1},
77 field9 := {1},
78 field10 := {1,2}
79 }
80
81 v_testMessage:= {
82 field1 := 1,
83 field2 := "test string",
84 field3 := true,
85 field4 := {1,2,3,4},
86 field5 := e_black,
87 field6 := {a:=1,b:=2,c:=true},
88 field7 := {a:=1,b:=2,c:=true},
89 field8 := {a:=1},
90 field9 := {1},
91 field10 := {1,2}
92 }
93
94 connect(self:messagePort, self:messagePort);
95
96 messagePort.send(v_testMessage);
97
98 alt {
99 [] messagePort.receive(mw_matchingTemplate) {
100 setverdict(fail);
101 }
102 [] messagePort.receive {
103 setverdict(pass);
104 }
105 }
106 }
107
108 control{
109 execute(TC_Sem_B0101_matching_specific_value_005());
110 }
111
112 }
This page took 0.033655 seconds and 5 git commands to generate.