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
9 * Adrien Kirjak – initial implementation
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 ***************************************************/
16 module Sem_B010402_ifPresent_indicator_001 {
18 type enumerated EnumeratedType {e_black, e_white, e_green};
20 type record RecordType {
26 type union UnionType {
32 type record MessageType {
33 integer field1 optional,
34 charstring field2 optional,
36 UnionType field4 optional
39 type port loopbackPort message {
41 } with {extension "internal"}
43 type component GeneralComp {
44 port loopbackPort messagePort
47 testcase TC_Sem_B010402_ifPresent_indicator_001() runs on GeneralComp {
49 var MessageType v_testMessage;
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
61 field3 := {a:=1,b:=omit,c:=true},
65 connect(self:messagePort, self:messagePort);
66 messagePort.send(v_testMessage);
69 [] messagePort.receive(mw_matchingTemplate) {
72 [] messagePort.receive {
79 execute(TC_Sem_B010402_ifPresent_indicator_001());