conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / B_matching_incoming_values / B01_template_matching / B0104_matching_attributes_of_values / B010402_ifPresent_indicator / Sem_B010402_ifPresent_indicator_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.4.2, Ensure that the IUT correctly handles template matching of ifpresent indicators
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16 module Sem_B010402_ifPresent_indicator_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 optional,
34 charstring field2 optional,
35 RecordType field3,
36 UnionType field4 optional
37 }
38
39 type port loopbackPort message {
40 inout MessageType
41 } with {extension "internal"}
42
43 type component GeneralComp {
44 port loopbackPort messagePort
45 }
46
47 testcase TC_Sem_B010402_ifPresent_indicator_001() runs on GeneralComp {
48
49 var MessageType v_testMessage;
50
51 template MessageType mw_matchingTemplate:= {
52 field1 := (0..2) ifpresent,
53 field2 := "[a-f]" ifpresent,
54 field3 := {a:=1,b:=(0..2) ifpresent,c:=true},
55 field4 := {a:=(0..2)} ifpresent
56 }
57
58 v_testMessage:= {
59 field1 := omit,
60 field2 := omit,
61 field3 := {a:=1,b:=omit,c:=true},
62 field4 := omit
63 }
64
65 connect(self:messagePort, self:messagePort);
66 messagePort.send(v_testMessage);
67
68 alt {
69 [] messagePort.receive(mw_matchingTemplate) {
70 setverdict(pass);
71 }
72 [] messagePort.receive {
73 setverdict(fail);
74 }
75 }
76 }
77
78 control{
79 execute(TC_Sem_B010402_ifPresent_indicator_001());
80 }
81
82 }
83
This page took 0.034158 seconds and 5 git commands to generate.