+++ /dev/null
-/*****************************************************************\r
- ** @author STF 470\r
- ** @version 0.0.1\r
- ** @purpose 1:8.2.3.1, Verify that identifiers of parameter types are not imported together with external functions\r
- ** @verdict pass reject\r
- *****************************************************************/\r
-\r
-#include "NegSem_08020301_GeneralFormatOfImport_031_import.hh"\r
-\r
-namespace NegSem__08020301__GeneralFormatOfImport__032__import\r
-{\r
- void f__test()\r
- { \r
- MyType p = 1;\r
- return p;\r
- }\r
-}\r
type record Mymessage {
integer field1,
bitstring field2 optional
- }
+ } with { variant " "};
type port loopbackPort message
execute(TC_NegSem_1508_TemplateRestrictions_050());
}
-}
+} with { encode "RAW"}
type record Mymessage {
integer field1,
bitstring field2 optional
- }
+ } with { variant " "};
type port loopbackPort message
- {inout MessageType} {extension "internal"};
+ {inout MessageType} with {extension "internal"};
type component GeneralComp {
port loopbackPort messagePort
execute(TC_NegSem_1508_TemplateRestrictions_051());
}
-}
+} with { encode "RAW"}
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
+//RAW encoding adds extra bits, up to 8 bit, to a bitstring because it encodes anything into an octetstring
module Sem_1508_TemplateRestrictions_049 {
type record Mymessage {
integer field1,
bitstring field2 optional
- }
+ } with { variant " "};
type port loopbackPort message
var bitstring v_enc;
var Mymessage v_testMessage;
var MessageType Message;
+
+ var MessageType got;
+ var Mymessage dec_got;
v_testMessage:= {
field1 := 10,
template (present) MessageType mw_matchingTemplate:=
{
- payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B}
+ payload := decmatch Mymessage: {field1:= 10, field2 := '00001001'B}
}
+ connect(self:messagePort, self:messagePort);
messagePort.send(Message); //send message
+ var bitstring bitpayload := hex2bit(Message.payload);
+
+ var integer v_res := decvalue(bitpayload, dec_got);
+
alt {
[] messagePort.receive(mw_matchingTemplate) {
setverdict(pass);
}
- [] messagePort.receive {
- setverdict(fail,mw_matchingTemplate);
+ [] messagePort.receive(MessageType:?) -> value got {
+ setverdict(fail,"exepted: ", mw_matchingTemplate, " recieved: ", dec_got);
}
}
execute(TC_Sem_1508_TemplateRestrictions_049());
}
-}
+} with { encode "RAW"}
/*It can be assigned to templates and template fields of bitstring, hexstring, octetstring,
charstring and universal charstring types.*/
+//RAW encoding adds extra bits, up to 8 bit, to a bitstring because it encodes anything into an octetstring
+
module Sem_B010209_decoded_content_001 {
type record MessageType {
type record Mymessage {
integer field1,
bitstring field2 optional
- }
+ } with { variant " "};
type port loopbackPort message {
Message.payload := encvalue(v_testMessage); //encode message to payload
template MessageType mw_matchingTemplate:= {
- payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B}
+ payload := decmatch Mymessage: {field1:= 10, field2 := '00001001'B}
}
connect(self:messagePort, self:messagePort);
execute(TC_Sem_B010209_decoded_content_001());
}
-}
+} with { encode "RAW"}
/*It can be assigned to templates and template fields of bitstring, hexstring, octetstring,
charstring and universal charstring types.*/
+//RAW encoding adds extra bits, up to 8 bit, to a bitstring because it encodes anything into an octetstring
+
module Sem_B010209_decoded_content_002 {
type record MessageType {
type record Mymessage {
integer field1,
bitstring field2 optional
- }
+ } with { variant " "};
type port loopbackPort message {
inout MessageType
Message.payload := bit2hex(encvalue(v_testMessage)); //encode message to payload, hexstring
template MessageType mw_matchingTemplate:= {
- payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B}
+ payload := decmatch Mymessage: {field1:= 10, field2 := '00001001'B}
}
connect(self:messagePort, self:messagePort);
execute(TC_Sem_B010209_decoded_content_002());
}
-}
+} with { encode "RAW"}
/*It can be assigned to templates and template fields of bitstring, hexstring, octetstring,
charstring and universal charstring types.*/
+//RAW encoding adds extra bits, up to 8 bit, to a bitstring because it encodes anything into an octetstring
+
module Sem_B010209_decoded_content_003 {
type record MessageType {
type record Mymessage {
integer field1,
bitstring field2 optional
- }
+ } with { variant " "};
- type port loopbackPort message{inout MessageType};
+ type port loopbackPort message {
+ inout MessageType
+ } with {extension "internal"};
-
type component GeneralComp {
port loopbackPort messagePort
}
Message.payload := bit2oct(encvalue(v_testMessage))//encode message to payload, octetstring
template MessageType mw_matchingTemplate:= {
- payload := decmatch Mymessage: {field1:= 10, field2 := '1001'B}
+ payload := decmatch Mymessage: {field1:= 10, field2 := '00001001'B}
}
connect(self:messagePort, self:messagePort);
execute(TC_Sem_B010209_decoded_content_003());
}
-}
+} with { encode "RAW"}
charstring payload
}
- type integer MyInt with { encode "32bit" }
+ type integer MyInt with { variant "32 bit" }
type port loopbackPort message{
inout MessageType
const MyInt c_input := 1633837665;
template MessageType mw_matchingTemplate:= {
- payload := decmatch MyInt:c_input
- }
+ payload := decmatch MyInt:c_input
+ }
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
+ var MessageType got;
+
+ v_message.payload := oct2char(bit2oct(encvalue(c_input)));
connect(self:messagePort, self:messagePort);
messagePort.send(v_message); //send message
-
+
alt {
[] messagePort.receive(mw_matchingTemplate) {
setverdict(pass);
}
- [] messagePort.receive {
- setverdict(fail,mw_matchingTemplate);
+ [] messagePort.receive(MessageType:?) -> value got {
+ setverdict(fail,"exepted: ", mw_matchingTemplate, " recieved: ", got);
}
}
}
execute(TC_Sem_B010209_decoded_content_004());
}
-}
+} with { encode "RAW"}
universal charstring payload
}
- type integer MyInt with { encode "32bit" }
+ type integer MyInt with { variant "32 bit" };
type port loopbackPort message{
inout MessageType
testcase TC_Sem_B010209_decoded_content_005() runs on GeneralComp {
var MessageType v_message;
+ var MessageType got;
v_message.payload := encvalue_unichar(c_input); //encode message to payload, charstring
connect(self:messagePort, self:messagePort);
messagePort.send(v_message); //send message
+
alt {
[] messagePort.receive(mw_matchingTemplate) {
setverdict(pass);
}
- [] messagePort.receive {
- setverdict(fail,mw_matchingTemplate);
+ [] messagePort.receive(MessageType:?) -> value got {
+ setverdict(fail,"exepted: ", mw_matchingTemplate, " recieved: ", got);
}
}
execute(TC_Sem_B010209_decoded_content_005());
}
-}
+} with { encode "RAW"}
Sem_1508_TemplateRestrictions_021.control
Sem_1508_TemplateRestrictions_022.control
Sem_1508_TemplateRestrictions_023.control
+Sem_1508_TemplateRestrictions_049.control
Sem_1509_MatchOperation_001.control
Sem_1509_MatchOperation_002.control
Sem_1509_MatchOperation_003.control
Sem_B010208_omit_value_002.control
Sem_B010208_omit_value_003.control
Sem_B010208_omit_value_004.control
+Sem_B010209_decoded_content_001.control
+Sem_B010209_decoded_content_002.control
+Sem_B010209_decoded_content_003.control
+Sem_B010209_decoded_content_004.control
+Sem_B010209_decoded_content_005.control
Sem_B010301_any_element_001.control
Sem_B010301_any_element_002.control
Sem_B010301_any_element_003.control
<!-- <FileResource projectRelativePath="15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_046.ttcn" relativeURI="15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_046.ttcn"/>-->
<!-- <FileResource projectRelativePath="15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_047.ttcn" relativeURI="15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_047.ttcn"/> -->
<!-- <FileResource projectRelativePath="15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_048.ttcn" relativeURI="15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_048.ttcn"/>-->
-<!-- <FileResource projectRelativePath="15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_049.ttcn" relativeURI="15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_049.ttcn"/>-->
+ <FileResource projectRelativePath="15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_049.ttcn" relativeURI="15_templates/1508_template_restrictions/Sem_1508_TemplateRestrictions_049.ttcn"/>
<FileResource projectRelativePath="15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_001.ttcn" relativeURI="15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_001.ttcn"/>
<FileResource projectRelativePath="15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_002.ttcn" relativeURI="15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_002.ttcn"/>
<FileResource projectRelativePath="15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_003.ttcn" relativeURI="15_templates/1508_template_restrictions/Syn_1508_TemplateRestrictions_003.ttcn"/>
<FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_002.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_002.ttcn"/>
<FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_003.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_003.ttcn"/>
<FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_004.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010208_omit_value/Sem_B010208_omit_value_004.ttcn"/>
-<!-- <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_001.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_001.ttcn"/>-->
-<!-- <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_002.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_002.ttcn"/>-->
-<!-- <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_003.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_003.ttcn"/>-->
-<!-- <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_004.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_004.ttcn"/>-->
-<!-- <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_005.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_005.ttcn"/>-->
+ <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_001.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_001.ttcn"/>
+ <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_002.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_002.ttcn"/>
+ <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_003.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_003.ttcn"/>
+ <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_004.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_004.ttcn"/>
+ <FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_005.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0102_matching_mechanisms/B010209_decoded_content/Sem_B010209_decoded_content_005.ttcn"/>
<FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_001.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_001.ttcn"/>
<FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_002.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_002.ttcn"/>
<FileResource projectRelativePath="B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_003.ttcn" relativeURI="B_matching_incoming_values/B01_template_matching/B0103_matching_inside_values/B010301_any_element/Sem_B010301_any_element_003.ttcn"/>