conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / B_matching_incoming_values / B01_template_matching / B0102_matching_mechanisms / B010202_complemented_value_list / Sem_B010202_complemented_value_list_007.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.2.2, Ensure that the IUT correctly handles template matching of complemented value listing
13 ** @verdict pass reject
14 ***************************************************/
15
16 module Sem_B010202_complemented_value_list_007 {
17
18 type enumerated EnumeratedType {e_black, e_white, e_green};
19
20 type record RecordType {
21 integer a optional,
22 integer b optional,
23 boolean c
24 }
25
26 type union UnionType {
27 integer a,
28 EnumeratedType b,
29 boolean c
30 }
31
32 type record MessageType {
33 integer field1,
34 charstring field2,
35 EnumeratedType field3,
36 RecordType field4,
37 UnionType field5
38 }
39
40 type record of integer RoI;
41
42 type port loopbackPort message {
43 inout MessageType
44 } with {extension "internal"}
45
46 type component GeneralComp {
47 port loopbackPort messagePort
48 }
49
50 testcase TC_Sem_B010202_complemented_value_list_007() runs on GeneralComp {
51
52 var MessageType v_testMessage;
53
54 template RoI m_RoI1 := {1, 2, (6..9)};
55
56 template MessageType mw_matchingTemplate:=
57 {
58 field1 := complement(all from m_RoI1, 100),//The type of the complemented template list and the member type of the template in the all from clause shall be compatible
59 field2 := complement("test string","something else"),
60 field3 := complement(e_green,e_black),
61 field4 := complement({a:=1,b:=1,c:=false},{a:=1,b:=2,c:=true}),
62 field5 := complement({a:=1},{b:=e_white})
63 }
64
65 v_testMessage:= {
66 field1 := 0,
67 field2 := "test ",
68 field3 := e_white,
69 field4 := {a:=1,b:=2,c:=false},
70 field5 := {a:=2}
71 }
72
73 connect(self:messagePort, self:messagePort);
74 messagePort.send(v_testMessage);
75
76 alt {
77 [] messagePort.receive(mw_matchingTemplate) {
78 setverdict(pass);
79 }
80 [] messagePort.receive {
81 setverdict(fail);
82 }
83 }
84 }
85
86 control{
87 execute(TC_Sem_B010202_complemented_value_list_007());
88 }
89
90 }
91
This page took 0.03412 seconds and 5 git commands to generate.