conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / B_matching_incoming_values / B01_template_matching / B0102_matching_mechanisms / B010205_value_range / NegSem_B010205_value_range_001.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.5, Ensure that the IUT correctly handles template matching of value range definitions
13 ** @verdict pass reject
14 ***************************************************/
15
16 module NegSem_B010205_value_range_001 {
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 EnumeratedType field2,
35 RecordType field3,
36 UnionType field4
37 }
38
39 type port loopbackPort message {
40 inout MessageType
41 } with {extension "internal"}
42
43
44 type component GeneralComp {
45 port loopbackPort messagePort
46 }
47
48 testcase TC_NegSem_B010205_value_range_001() runs on GeneralComp {
49
50 var MessageType v_testMessage;
51
52 template MessageType mw_matchingTemplate:=
53 {
54 field1 := (0..2),
55 field2 := (e_black..e_white), //attempt to use range on enumerated type
56 field3 := {a:=1,b:=(0..2),c:=true},
57 field4 := {a:=(0..2)}
58 }
59
60 v_testMessage:= {
61 field1 := 2,
62 field2 := e_black,
63 field3 := {a:=1,b:=2,c:=true},
64 field4 := {a:=1}
65 }
66
67 connect(self:messagePort, self:messagePort);
68 messagePort.send(v_testMessage);
69
70 }
71
72 control{
73 execute(TC_NegSem_B010205_value_range_001());
74 }
75
76 }
77
This page took 0.041885 seconds and 5 git commands to generate.