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 / B010401_length_restrictions / NegSem_B010401_length_restrictions_002.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.1, Ensure that the IUT correctly handles template matching of value length definitions
13 ** @verdict pass reject
14 ***************************************************/
15
16 module NegSem_B010401_length_restrictions_002 {
17
18
19 type record MessageType {
20 charstring field1,
21 bitstring field2,
22 hexstring field3,
23 charstring field4,
24 bitstring field5,
25 hexstring field6
26 }
27
28 type port loopbackPort message {
29 inout MessageType
30 } with {extension "internal"}
31
32
33 type component GeneralComp {
34 port loopbackPort messagePort
35 }
36
37 testcase TC_NegSem_B010401_length_restrictions_002() runs on GeneralComp {
38
39 var MessageType v_testMessage;
40
41 template MessageType mw_matchingTemplate:= {
42 field1 := pattern "test s*g" length (6 .. 15),
43 field2 := '10*'B length (3 .. 5),
44 field3 := '89?AB'H length (6), //pattern is shorter than length restriction
45 field4 := pattern "tes?" length (4 .. 13),
46 field5 := '10?'B length (3 .. 5),
47 field6 := '89?ABC'H length (6)
48 }
49
50 v_testMessage:= {
51 field1 := "test string",
52 field2 := '10101'B,
53 field3 := '89ABC'H,
54 field4 := "test",
55 field5 := '101'B,
56 field6 := '899ABC'H
57 }
58
59 connect(self:messagePort, self:messagePort);
60 messagePort.send(v_testMessage);
61
62 alt {
63 [] messagePort.receive(mw_matchingTemplate) {
64 setverdict(fail);
65 }
66 [] messagePort.receive {
67 setverdict(pass);
68 }
69 }
70 }
71
72 control{
73 execute(TC_NegSem_B010401_length_restrictions_002());
74 }
75
76 }
77
This page took 0.031548 seconds and 5 git commands to generate.