conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / B_matching_incoming_values / B01_template_matching / B0102_matching_mechanisms / B010209_decoded_content / Sem_B010209_decoded_content_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.2.8, Ensure that the IUT correctly handles content decoding
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16 //Restriction a)
17 /*It can be assigned to templates and template fields of bitstring, hexstring, octetstring,
18 charstring and universal charstring types.*/
19
20 module Sem_B010209_decoded_content_002 {
21
22 type record MessageType {
23 hexstring payload
24 }
25
26 type record Mymessage {
27 integer field1,
28 bitstring field2 optional
29 }
30
31 type port loopbackPort message {
32 inout MessageType
33 } with {extension "internal"}
34
35 type component GeneralComp {
36 port loopbackPort messagePort
37 }
38
39 testcase TC_Sem_B010209_decoded_content_002() runs on GeneralComp {
40 var bitstring v_enc;
41 var Mymessage v_testMessage;
42 var MessageType Message;
43
44 v_testMessage:= {
45 field1 := 10,
46 field2 := '1001'B
47 }
48
49 Message.payload := bit2hex(encvalue(v_testMessage)); //encode message to payload, hexstring
50
51 template MessageType mw_matchingTemplate:= {
52 payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B}
53 }
54
55 connect(self:messagePort, self:messagePort);
56 messagePort.send(Message); //send message
57
58 alt {
59 [] messagePort.receive(mw_matchingTemplate) {
60 setverdict(pass);
61 }
62 [] messagePort.receive {
63 setverdict(fail);
64 }
65 }
66
67 }
68
69 control{
70 execute(TC_Sem_B010209_decoded_content_002());
71 }
72
73 }
74
This page took 0.063694 seconds and 5 git commands to generate.