conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 15_templates / 1508_template_restrictions / Sem_1508_TemplateRestrictions_049.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:15.8, Ensure that decoded content match is allowed for present template restriction
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16
17 module Sem_1508_TemplateRestrictions_049 {
18
19 type record MessageType {
20 hexstring payload
21 }
22
23 type record Mymessage {
24 integer field1,
25 bitstring field2 optional
26 }
27
28
29 type port loopbackPort message
30 {inout MessageType} with {extension "internal"};
31
32
33 type component GeneralComp {
34 port loopbackPort messagePort
35 }
36
37 testcase TC_Sem_1508_TemplateRestrictions_049() runs on GeneralComp {
38 var bitstring v_enc;
39 var Mymessage v_testMessage;
40 var MessageType Message;
41
42 v_testMessage:= {
43 field1 := 10,
44 field2 := '1001'B
45 }
46
47 Message.payload := bit2hex(encvalue(v_testMessage)); //encode message to payload
48
49 template (present) MessageType mw_matchingTemplate:=
50 {
51 payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B}
52 }
53
54 messagePort.send(Message); //send message
55
56 alt {
57 [] messagePort.receive(mw_matchingTemplate) {
58 setverdict(pass);
59 }
60 [] messagePort.receive {
61 setverdict(fail,mw_matchingTemplate);
62 }
63 }
64
65 }
66
67 control{
68 execute(TC_Sem_1508_TemplateRestrictions_049());
69 }
70
71 }
72
This page took 0.03275 seconds and 5 git commands to generate.