Commit aca52280 authored by kovacsa's avatar kovacsa
Browse files

STF 521 fixes

parent 6df65f93
......@@ -17,9 +17,9 @@ module Sem_060101_TopLevel_012 {
testcase TC_Sem_060101_TopLevel_012() runs on GeneralComp {
var octetstring v_a := '1234\
567'O;
56'O;
if (match(v_a,'1234567'O))
if (match(v_a,'123456'O))
{
setverdict(pass,"v_a:",v_a);
}
......
......@@ -18,15 +18,14 @@ module Sem_060101_TopLevel_013 {
testcase TC_Sem_060101_TopLevel_013() runs on GeneralComp {
var octetstring v_a := '12\
34\
56\
7'O;
if (match(lengthof(v_a), 7))
56'O; // 3 octets
if (match(lengthof(v_a), 3))
{
setverdict(pass,"Size of v_a is:",lengthof(v_a));
setverdict(pass,"Size of v_a is: ",lengthof(v_a));
}
else {
setverdict(fail,"Size of v_a is:",lengthof(v_a));
setverdict(fail,"Size of v_a is: ",lengthof(v_a));
}
}
......
......@@ -5,7 +5,7 @@
** @verdict pass accept, ttcn3verdict:pass
*****************************************************************/
// The following requirements are tested:
/*Two enumerated values are equal if and only if they are associated
/* Two enumerated values are equal if and only if they are associated
* with the same integer value. Otherwise, they are ordered using the
* mathematical order on the associated integer values.*/
......@@ -27,7 +27,7 @@ testcase TC_Sem_070103_RelationalOperators_050() runs on GeneralComp {
var MyEnumType1 v_first := e_monday;
var MyEnumType2 v_second := e_monday(2);
if (v_first == v_second) {
if (match(enum2int(v_first),enum2int(v_second))) {
setverdict(pass);
} else {
setverdict(fail);
......
......@@ -18,10 +18,10 @@ module NegSem_160102_predefined_functions_039 {
};
testcase TC_NegSem_160102_predefined_functions_039() runs on GeneralComp {
var EDays v_enum := Friday;
var integer v_day := int2enum(6,v_enum); // error: not allowed value
var EDays v_enum := Friday(3);
int2enum(6,v_enum); // error: not allowed value
if (match(enum2int(v_day),4)) {
if (match(enum2int(v_enum),6)) {
setverdict(pass);
} else {
setverdict(fail);
......
......@@ -18,10 +18,10 @@ module NegSem_160102_predefined_functions_040 {
};
testcase TC_NegSem_160102_predefined_functions_040() runs on GeneralComp {
var EDays v_enum := Friday;
var integer v_day := int2enum(3,v_enum); // value already occupied
var EDays v_enum := Wednesday;
int2enum(3,v_enum); // value already occupied
if (match(enum2int(v_day),4)) {
if (match(enum2int(v_enum),2)) {
setverdict(pass);
} else {
setverdict(fail);
......
......@@ -18,10 +18,11 @@ module Sem_160102_predefined_functions_093 {
};
testcase TC_Sem_160102_predefined_functions_093() runs on GeneralComp {
var EDays v_enum := Friday;
var integer v_day := int2enum(4,v_enum);
var EDays v_enum := Thursday;
int2enum(4,v_enum); // new value for v_enum is Friday(4)
if (match(enum2int(v_day),4)) {
if (match(enum2int(v_enum),4) and match(v_enum,Friday(4))) {
setverdict(pass);
} else {
setverdict(fail);
......
......@@ -7,22 +7,24 @@
// The following requirements are tested: Using ischosen for anytype
module Sem_160102_predefined_functions_096 {
type union U { integer f1, octetstring f2 }
type component GeneralComp {
}
type union U { integer f1, charstring f2 };
testcase TC_Sem_160102_predefined_functions_096 () runs on GeneralComp {
template U m_u4 := ({ f1 := 2 }, {f2 := 'AB'O });
template anytype mw_anytype := { U := m_u4 }
var boolean v_i;
template anytype mw_anytype := { U.f1:=1};
var boolean v_i, v_j;
v_i:=ischosen(mw_anytype.integer); //function returns false
v_i:=ischosen(mw_anytype.U.integer); //function returns false value
if(match(v_i,false)) {
setverdict(pass);
} else {
setverdict(fail, "Unexpected decoding result");
setverdict(fail, "Unexpected result for ischosen()");
}
}
......
......@@ -21,18 +21,17 @@ module Sem_160102_predefined_functions_100 {
var charstring v_test := "abc";
//Encoding:
//Encoding:
var universal charstring v_test_enc_8 := encvalue_unichar(v_test,"UTF-8", "encoding_info_text"); //encode to universal charstring UTF-8
//Decoding:
var integer v_test_dec;
var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-8", "encoding_info_text"); //decode (UTF-8)
var integer v_res:= decvalue_unichar(v_test_enc_8,v_test_dec,"UTF-8", "encoding_info_text"); //decode (UTF-8)
if (v_res == 0) {
setverdict(pass, "Decoded ", v_enc , " with result ", v_res);
setverdict(pass, "Decoded ", v_test_enc_8 , " with result ", v_res);
} else {
setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res);
setverdict(fail, "Unexpected decoding result: Decoded ", v_test_enc_8 , " with result ", v_res);
}
}
......
......@@ -9,16 +9,32 @@
module Sem_210302_Start_test_component_012 {
type component GeneralComp { }
altstep a_myBehaviour(in integer v_in) runs on GeneralComp {}
type port myPortType message {
inout integer;
}
type component GeneralCompSystem { }
type component GeneralComp {
port myPortType myPort;
}
altstep a_myBehaviour() runs on GeneralComp {
[] any port.receive {
setverdict(pass);
}
}
testcase TC_Sem_210302_Start_test_component_012() runs on GeneralComp system GeneralComp {
testcase TC_Sem_210302_Start_test_component_012() runs on GeneralComp system GeneralCompSystem {
var GeneralComp ptc;
var integer v_var := 5;
ptc:=GeneralComp.create alive;
ptc.start(a_myBehaviour(v_var));
connect(mtc:myPort, ptc:myPort);
myPort.send(1);
ptc.start(a_myBehaviour());
ptc.done;
setverdict(pass);
......
......@@ -2,7 +2,7 @@
** @author STF 521
** @version 0.0.1
** @purpose 1:B.1.2.1, Ensure that the IUT correctly handles template list corretly
** @verdict pass accept, ttcn3verdict:pass
** @verdict pass accept reject
***************************************************/
// The following requirements are tested:
......
......@@ -11,21 +11,28 @@
module Sem_B010210_enumerated_value_list_001 {
type enumerated MyFirstEnum {
First_enum(0), Second_enum(1), other_enum(2..200)
}
type port messagePortType message {
inout MyFirstEnum;
}
template integer m_Int :=(10..100);
type component GeneralComp { }
type component GeneralComp {
port messagePortType messagePort;
}
testcase TC_Sem_B010210_enumerated_value_list_001() runs on GeneralComp {
template MyFirstEnum mw_matchingTemplate:= other_enum(m_Int); // matches other_enum(10..100)
template MyFirstEnum mw_matchingTemplate:= other_enum(m_Int); // matches other_enum(10..100)
var MyFirstEnum v_message := other_enum(88);
var MyFirstEnum v_message := other_enum(11);
messagePort.send(v_message); //send message
......@@ -34,7 +41,7 @@ module Sem_B010210_enumerated_value_list_001 {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail,mw_matchingTemplate);
setverdict(fail, mw_matchingTemplate);
}
}
}
......
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