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_003.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 accept, ttcn3verdict:pass
14 ***************************************************/
15
16 module Sem_B010202_complemented_value_list_003 {
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 port loopbackPort message {
41 inout MessageType
42 } with {extension "internal"}
43
44
45 type component GeneralComp {
46 port loopbackPort messagePort
47 }
48
49 testcase TC_Sem_B010202_complemented_value_list_003() runs on GeneralComp {
50
51 var MessageType v_testMessage;
52
53 template MessageType mw_matchingTemplate:=
54 {
55 field1 := complement(1,2),
56 field2 := complement("test string","something else"),
57 field3 := complement(e_green,e_black),
58 field4 := complement({a:=1,b:=1,c:=false},{a:=1,b:=2,c:=true}),
59 field5 := complement({a:=1},{b:=e_white})
60 }
61
62 v_testMessage:= {
63 field1 := 0,
64 field2 := "test string", //mismatching complement in the template
65 field3 := e_white,
66 field4 := {a:=1,b:=2,c:=false},
67 field5 := {a:=2}
68 }
69
70 connect(self:messagePort, self:messagePort);
71 messagePort.send(v_testMessage);
72
73 alt {
74 [] messagePort.receive(mw_matchingTemplate) {
75 setverdict(fail);
76 }
77 [] messagePort.receive {
78 setverdict(pass);
79 }
80 }
81 }
82
83 control{
84 execute(TC_Sem_B010202_complemented_value_list_003());
85 }
86
87 }
88
This page took 0.034474 seconds and 5 git commands to generate.