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
9 * Adrien Kirjak – initial implementation
12 ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles content decoding
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
17 /*It can be assigned to templates and template fields of bitstring, hexstring, octetstring,
18 charstring and universal charstring types.*/
20 module Sem_B010209_decoded_content_002 {
22 type record MessageType {
26 type record Mymessage {
28 bitstring field2 optional
31 type port loopbackPort message {
33 } with {extension "internal"}
35 type component GeneralComp {
36 port loopbackPort messagePort
39 testcase TC_Sem_B010209_decoded_content_002() runs on GeneralComp {
41 var Mymessage v_testMessage;
42 var MessageType Message;
49 Message.payload := bit2hex(encvalue(v_testMessage)); //encode message to payload, hexstring
51 template MessageType mw_matchingTemplate:= {
52 payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B}
55 connect(self:messagePort, self:messagePort);
56 messagePort.send(Message); //send message
59 [] messagePort.receive(mw_matchingTemplate) {
62 [] messagePort.receive {
70 execute(TC_Sem_B010209_decoded_content_002());