conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / B_matching_incoming_values / B01_template_matching / B0105_matching_character_pattern / B010506_case_sensitive_pattern_matching / Sem_B010506_case_sensitive_pattern_matching_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.5.6, Ensure that the IUT correctly handles character pattern compatibility rules of template case sensitive matching (@nocase)
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16 /* The following requirements are tested:
17 When the "@nocase" modifier is used after the pattern keyword, the matching is evaluated in a case insensitive way
18 */
19
20 module Sem_B010506_case_sensitive_pattern_matching_001 {
21
22 modulepar {
23 charstring MOD_REF:="modulepar reference";
24 }
25
26 type record MessageType {
27 universal charstring field1,
28 universal charstring field2,
29 universal charstring field3,
30 universal charstring field4,
31 universal charstring field5,
32 universal charstring field6,
33 universal charstring field7,
34 universal charstring field8
35 }
36
37 type port loopbackPort message {
38 inout MessageType
39 } with {extension "internal"}
40
41 const charstring c_Ref:="constant reference";
42
43
44 type component GeneralComp {
45 port loopbackPort messagePort
46 }
47
48 testcase TC_Sem_B010506_case_sensitive_pattern_matching_001(charstring p_Ref) runs on GeneralComp {
49
50 var MessageType v_testMessage;
51 var charstring v_Ref:="variable reference";
52 template charstring m_Ref:= pattern "{c_Ref}";
53 template charstring m_RefExp_p1 := "{m_";
54 template charstring m_RefExp_p2 := "Ref}!";
55
56 template MessageType mw_matchingTemplate:= {
57 field1 := pattern @nocase "{v_Ref}",
58 field2 := pattern @nocase"{c_Ref}",
59 field3 := pattern @nocase"{MOD_REF}",
60 field4 := pattern @nocase"{p_Ref}",
61 field5 := pattern @nocase"{m_Ref}",
62 field6 := pattern @nocase"{m_"&"Ref}!",
63 field7 := pattern @nocase"{m_RefExp_p1}{m_RefExp_p2}",
64 field8 := pattern @nocase"var*?e"
65 }
66
67 v_testMessage:= {
68 field1 := "VaRiAbLe ReFeReNcE",
69 field2 := "conSTant ReFeReNcE",
70 field3 := "modulepar ReFeReNcE",
71 field4 := "PARAMETER ReFeReNcE",
72 field5 := "CONStant ReFeReNcE",
73 field6 := "consTANT ReFeReNcE!",
74 field7 := "{m_ref}!",
75 field8 := "VaRiAbLe ReFeReNcE"
76 }
77
78 connect(self:messagePort, self:messagePort);
79 messagePort.send(v_testMessage);
80
81 alt {
82 [] messagePort.receive(mw_matchingTemplate) {
83 setverdict(pass,v_testMessage);
84 }
85 [] messagePort.receive {
86 setverdict(fail,v_testMessage);
87 }
88 }
89 }
90
91 control{
92 execute(TC_Sem_B010506_case_sensitive_pattern_matching_001("parameter reference"));
93 }
94
95 }
96
This page took 0.032284 seconds and 5 git commands to generate.