conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / B_matching_incoming_values / B01_template_matching / B0105_matching_character_pattern / B010502_reference_expression / Sem_B010502_reference_expression_005.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.5.2, Ensure that the IUT correctly handles template matching of character pattern reference expressions
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16 module Sem_B010502_reference_expression_005 {
17
18 modulepar {
19 charstring MOD_REF:="modulepar reference";
20 }
21
22 type record MessageType {
23 charstring field1,
24 charstring field2,
25 charstring field3,
26 charstring field4,
27 charstring field5,
28 charstring field6,
29 charstring field7
30 }
31
32 type port loopbackPort message {
33 inout MessageType
34 } with {extension "internal"}
35
36 const charstring c_Ref:="constant reference";
37
38 type component GeneralComp {
39 port loopbackPort messagePort
40 }
41
42 testcase TC_Sem_B010502_reference_expression_005(charstring p_Ref) runs on GeneralComp {
43
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}!";
49
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}"
58 };
59
60 v_testMessage:= {
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"
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_B010502_reference_expression_005("parameter reference"));
85 }
86
87 }
88
This page took 0.03622 seconds and 5 git commands to generate.