Commit 63ad22e0 authored by urbant's avatar urbant
Browse files

Correction in tests for decoded content (correct encoding procedure)

parent 102caaf9
......@@ -12,60 +12,45 @@ charstring and universal charstring types.*/
module Sem_B010209_decoded_content_004 {
type record MessageType {
charstring payload
}
type record Mymessage {
integer field1,
bitstring field2 optional
type record MessageType {
charstring payload
}
type integer MyInt with { encode "32bit" }
type port loopbackPort message{inout MessageType};
type component GeneralComp {
port loopbackPort messagePort
}
testcase TC_Sem_B010209_decoded_content_004() runs on GeneralComp {
var bitstring v_enc;
var Mymessage v_testMessage;
var MessageType Message;
type component GeneralComp {
port loopbackPort messagePort
}
const MyInt c_input := 1633837665;
v_testMessage:= {
field1 := 10,
field2 := '1001'B
}
template MessageType mw_matchingTemplate:= {
payload := decmatch MyInt:c_input
}
Message.payload := bit2str(encvalue(v_testMessage)); //encode message to payload, charstring
testcase TC_Sem_B010209_decoded_content_004() runs on GeneralComp {
var MessageType v_message;
v_message.payload := encvalue_unichar(c_input); //encode message to payload, charstring
messagePort.send(v_message); //send message
template MessageType mw_matchingTemplate:=
{
payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B}
}
messagePort.send(Message); //send message
alt {
[] messagePort.receive(mw_matchingTemplate) {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail,mw_matchingTemplate);
}
alt {
[] messagePort.receive(mw_matchingTemplate) {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail,mw_matchingTemplate);
}
}
}
}
control{
execute(TC_Sem_B010209_decoded_content_004());
}
control{
execute(TC_Sem_B010209_decoded_content_004());
}
}
\ No newline at end of file
......@@ -12,57 +12,45 @@ charstring and universal charstring types.*/
module Sem_B010209_decoded_content_005 {
type record MessageType {
universal charstring payload
}
type record Mymessage {
integer field1,
universal charstring field2 optional
type record MessageType {
universal charstring payload
}
type integer MyInt with { encode "32bit" }
type port loopbackPort message{inout MessageType};
type component GeneralComp {
port loopbackPort messagePort
}
testcase TC_Sem_B010209_decoded_content_005() runs on GeneralComp {
type component GeneralComp {
port loopbackPort messagePort
}
var Mymessage v_testMessage;
var MessageType Message;
const MyInt c_input := 1633837665;
v_testMessage:= {1,"A"} ;
Message.payload :=any2unistr(v_testMessage); //encode message to payload,universal charstring UTF-8
template MessageType mw_matchingTemplate:= {
payload := decmatch MyInt:c_input
}
testcase TC_Sem_B010209_decoded_content_005() runs on GeneralComp {
var MessageType v_message;
template MessageType mw_matchingTemplate:=
{
payload := decmatch("UTF-8") Mymessage: {1,"A"}
}
messagePort.send(Message); //send message
alt {
[] messagePort.receive(mw_matchingTemplate) {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail,mw_matchingTemplate.payload);
}
v_message.payload := encvalue_unichar(c_input); //encode message to payload, charstring
messagePort.send(v_message); //send message
alt {
[] messagePort.receive(mw_matchingTemplate) {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail,mw_matchingTemplate);
}
}
}
}
control{
execute(TC_Sem_B010209_decoded_content_005());
}
control{
execute(TC_Sem_B010209_decoded_content_005());
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment