Commit ef11936e authored by stancakapost's avatar stancakapost
Browse files

moved template declaration before statements

parent df147b82
......@@ -6,62 +6,55 @@
***************************************************/
module Sem_1508_TemplateRestrictions_049 {
module Sem_1508_TemplateRestrictions_049 {
type record MessageType {
hexstring payload
}
type record MessageType {
hexstring payload
}
type record Mymessage {
integer field1,
bitstring field2 optional
}
type record Mymessage {
integer field1,
bitstring field2 optional
}
type port loopbackPort message{inout MessageType};
type port loopbackPort message{inout MessageType};
type component GeneralComp {
port loopbackPort messagePort
}
type component GeneralComp {
port loopbackPort messagePort
}
testcase TC_Sem_1508_TemplateRestrictions_049() runs on GeneralComp {
testcase TC_Sem_1508_TemplateRestrictions_049() runs on GeneralComp {
var bitstring v_enc;
var Mymessage v_testMessage;
var MessageType Message;
template (present) MessageType mw_matchingTemplate := {
payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B}
}
v_testMessage:= {
field1 := 10,
field2 := '1001'B
}
v_testMessage := {
field1 := 10,
field2 := '1001'B
}
Message.payload := bit2hex(encvalue(v_testMessage)); //encode message to payload
Message.payload := bit2hex(encvalue(v_testMessage)); //encode message to payload
template (present) MessageType mw_matchingTemplate:=
{
payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B}
}
messagePort.send(Message); //send message
messagePort.send(Message); //send message
alt {
[] messagePort.receive(mw_matchingTemplate) {
[] messagePort.receive(mw_matchingTemplate) {
setverdict(pass);
}
[] messagePort.receive {
}
[] messagePort.receive {
setverdict(fail,mw_matchingTemplate);
}
}
}
}
}
control{
control{
execute(TC_Sem_1508_TemplateRestrictions_049());
}
}
}
\ 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