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.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
16 module Sem_B010502_reference_expression_005 {
19 charstring MOD_REF:="modulepar reference";
22 type record MessageType {
32 type port loopbackPort message {
34 } with {extension "internal"}
36 const charstring c_Ref:="constant reference";
38 type component GeneralComp {
39 port loopbackPort messagePort
42 testcase TC_Sem_B010502_reference_expression_005(charstring p_Ref) runs on GeneralComp {
44 var MessageType v_testMessage;
45 var charstring v_Ref:="variable reference";
46 template charstring m_Ref:= pattern "{c_Ref}";
47 template charstring m_RefExp_p1 := pattern "{m_";
48 template charstring m_RefExp_p2 := pattern "Ref}!";
50 template MessageType mw_matchingTemplate:= {
51 field1 := pattern "{v_Ref}",
52 field2 := pattern "{c_Ref}",
53 field3 := pattern "{MOD_REF}",
54 field4 := pattern "{p_Ref}", //mismatch in this reference
55 field5 := pattern "{m_Ref}",
56 field6 := pattern "{m_"&"Ref}!",
57 field7 := pattern "{v_Ref} and {c_Ref}"
61 field1 := "variable reference",
62 field2 := "constant reference",
63 field3 := "modulepar reference",
64 field4 := "parameter reference ",
65 field5 := "constant reference",
66 field6 := "constant reference!",
67 field7 := "variable reference and constant reference"
70 connect(self:messagePort, self:messagePort);
71 messagePort.send(v_testMessage);
74 [] messagePort.receive(mw_matchingTemplate) {
77 [] messagePort.receive {
84 execute(TC_Sem_B010502_reference_expression_005("parameter reference"));