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 //RAW encoding adds extra bits, up to 8 bit, to a bitstring because it encodes anything into an octetstring
22 module Sem_B010209_decoded_content_003 {
24 type record MessageType {
28 type record Mymessage {
30 bitstring field2 optional
31 } with { variant " "};
33 type port loopbackPort message {
35 } with {extension "internal"};
37 type component GeneralComp {
38 port loopbackPort messagePort
41 testcase TC_Sem_B010209_decoded_content_003() runs on GeneralComp {
43 var Mymessage v_testMessage;
44 var MessageType Message;
51 Message.payload := bit2oct(encvalue(v_testMessage))//encode message to payload, octetstring
53 template MessageType mw_matchingTemplate:= {
54 payload := decmatch Mymessage: {field1:= 10, field2 := '00001001'B}
57 connect(self:messagePort, self:messagePort);
58 messagePort.send(Message); //send message
61 [] messagePort.receive(mw_matchingTemplate) {
64 [] messagePort.receive {
72 execute(TC_Sem_B010209_decoded_content_003());
75 } with { encode "RAW"}