Commit f304b21b authored by kovacsa's avatar kovacsa
Browse files

AKovacs revision

parent b9dcb97b
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C)
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
/*NOTE:
* "UTF-16LE","UTF-16BE", "UTF-32LE" and "UTF-32BE" in not working with TestCast v.6.8.2.5 */
/* The following requirements are tested:
* This function converts an UTF-16 universal charstring value to a Little endian octetstring.*/
module Sem_160102_predefined_functions_030 {
type component GeneralComp {
}
testcase TC_Sem_160102_predefined_functions_030 () runs on GeneralComp {
// universal charstring:
var universal charstring v_0 := "ABC";
// predefined function for universal charstring to octetstring conversion:
var octetstring v_encoded := unichar2oct(v_0, "UTF-16LE"); //"UTF-16" little endian, expected value:'0041 0042 0043'O;
var octetstring v_1 := '004100420043'O;
if( match(v_encoded,v_1)
) {
setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded);
}
else {
setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1);
}
}
control{
execute(TC_Sem_160102_predefined_functions_030());
}
}
\ No newline at end of file
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C)
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
/*NOTE:
* "UTF-16LE","UTF-16BE", "UTF-32LE" and "UTF-32BE" in not working with TestCast v.6.8.2.5 */
/* The following requirements are tested:
* This function converts an UTF-32 universal charstring value to a Little endian octetstring.*/
module Sem_160102_predefined_functions_031 {
type component GeneralComp {
}
testcase TC_Sem_160102_predefined_functions_031 () runs on GeneralComp {
// universal charstring:
var universal charstring v_0 := "ABC";
// predefined function for universal charstring to octetstring conversion:
var octetstring v_encoded := unichar2oct(v_0, "UTF-32LE"); //"UTF-32" little endian, expected value:'0000 0041 0000 0042 0000 0043'O
var octetstring v_1 := '000000410000004200000043'O;
if( match(v_encoded,v_1)
) {
setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded);
}
else {
setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1);
}
}
control{
execute(TC_Sem_160102_predefined_functions_031());
}
}
\ No newline at end of file
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C)
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
/*NOTE:
* "UTF-16LE","UTF-16BE", "UTF-32LE" and "UTF-32BE" in not working with TestCast v.6.8.2.5 */
/* The following requirements are tested:
* This function converts an UTF-16 universal charstring value to a Big endian octetstring.*/
module Sem_160102_predefined_functions_032 {
type component GeneralComp {
}
testcase TC_Sem_160102_predefined_functions_032 () runs on GeneralComp {
// universal charstring:
var universal charstring v_0 := "AB";
// predefined function for universal charstring to octetstring conversion:
var octetstring v_encoded := unichar2oct(v_0, "UTF-16BE"); //"UTF-16" Big endian, expected value:'42004100'O;
var octetstring v_1 := '42004100'O;
if( match(v_encoded,v_1)
) {
setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded);
}
else {
setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1);
}
}
control{
execute(TC_Sem_160102_predefined_functions_032());
}
}
\ No newline at end of file
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C)
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
/*NOTE:
* "UTF-16LE","UTF-16BE", "UTF-32LE" and "UTF-32BE" in not working with TestCast v.6.8.2.5 */
/* The following requirements are tested:
* This function converts an UTF-32 universal charstring value to a Big endian octetstring.*/
module Sem_160102_predefined_functions_033 {
type component GeneralComp {
}
testcase TC_Sem_160102_predefined_functions_033 () runs on GeneralComp {
// universal charstring:
var universal charstring v_0 := "AB";
// predefined function for universal charstring to octetstring conversion:
var octetstring v_encoded := unichar2oct(v_0, "UTF-32BE"); //"UTF-32" Big endian, expected value:'42 00 00 00 41 00 00 00'O
var octetstring v_1 := '4200000041000000'O;
if( match(v_encoded,v_1)
) {
setverdict(pass,"Encoded value for: ",v_0, " is ", v_encoded);
}
else {
setverdict(fail,"encoded value is: ", v_encoded, " expected ", v_1);
}
}
control{
execute(TC_Sem_160102_predefined_functions_033());
}
}
\ No newline at end of file
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C)
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
/* The following requirements are tested:
* This function converts an octetstring to an UTF-16 Little Endian byte order universal charstring.*/
module Sem_160102_predefined_functions_038 {
type component GeneralComp {
}
testcase TC_Sem_160102_predefined_functions_038 () runs on GeneralComp {
//octetstring:
var octetstring v_0 := '004100420043'O;
// predefined function for universal charstring to octetstring conversion:
var universal charstring v_decode := oct2unichar(v_0,"UTF-16LE"); //expected value: ABC
var universal charstring v_1 := "ABC";
if( match(v_decode,v_1)
) {
setverdict(pass,"Decoded value for: ",v_0, " is ", v_decode);
}
else {
setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1);
}
}
control{
execute(TC_Sem_160102_predefined_functions_038());
}
}
\ No newline at end of file
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C)
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
/* The following requirements are tested:
* This function converts an octetstring to an UTF-32 Little Endian byte order universal charstring.*/
module Sem_160102_predefined_functions_039 {
type component GeneralComp {
}
testcase TC_Sem_160102_predefined_functions_039 () runs on GeneralComp {
//octetstring:
var octetstring v_0 := '000000410000004200000043'O;
// predefined function for universal charstring to octetstring conversion:
var universal charstring v_decode := oct2unichar(v_0,"UTF-32LE"); //expected value: ABC
var universal charstring v_1 := "ABC";
if( match(v_decode,v_1)
) {
setverdict(pass,"Decoded value for: ",v_0, " is ", v_decode);
}
else {
setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1);
}
}
control{
execute(TC_Sem_160102_predefined_functions_039());
}
}
\ No newline at end of file
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C)
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
/* The following requirements are tested:
* This function converts an octetstring to an UTF-16 Big Endian byte order universal charstring.*/
module Sem_160102_predefined_functions_040 {
type component GeneralComp {
}
testcase TC_Sem_160102_predefined_functions_040 () runs on GeneralComp {
//octetstring:
var octetstring v_0 := '430042004100'O;
// predefined function for universal charstring to octetstring conversion:
var universal charstring v_decode := oct2unichar(v_0,"UTF-16BE"); //expected value: ABC
var universal charstring v_1 := "ABC";
if( match(v_decode,v_1)
) {
setverdict(pass,"Decoded value for: ",v_0, " is ", v_decode);
}
else {
setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1);
}
}
control{
execute(TC_Sem_160102_predefined_functions_040());
}
}
\ No newline at end of file
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C)
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
/* The following requirements are tested:
* This function converts an octetstring to an UTF-32 Big Endian byte order universal charstring.*/
module Sem_160102_predefined_functions_041 {
type component GeneralComp {
}
testcase TC_Sem_160102_predefined_functions_041 () runs on GeneralComp {
//octetstring:
var octetstring v_0 := '430000004200000041000000'O;
// predefined function for universal charstring to octetstring conversion:
var universal charstring v_decode := oct2unichar(v_0,"UTF-32BE"); //expected value: ABC
var universal charstring v_1 := "ABC";
if( match(v_decode,v_1)
) {
setverdict(pass,"Decoded value for: ",v_0, " is ", v_decode);
}
else {
setverdict(fail,"encoded value is: ", v_decode, " expected ", v_1);
}
}
control{
execute(TC_Sem_160102_predefined_functions_041());
}
}
\ No newline at end of file
......@@ -5,7 +5,6 @@
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
//NOT working with TestCast 6.8.2.5 -test fails
/* The following requirements are tested:
......@@ -23,7 +22,8 @@ module Sem_160102_predefined_functions_073 {
//encoded text:
var universal charstring v_enc := encvalue_unichar("aBcDe","UTF-16");
var universal charstring v_test := "aBcDe";
var universal charstring v_enc := encvalue_unichar(v_test,"UTF-16");
//decode:
......@@ -31,9 +31,9 @@ module Sem_160102_predefined_functions_073 {
var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-16"); //decode (UTF-16)
if (v_res == 0) {
setverdict(pass, "Decoded ", v_enc , " with result ", v_res);
setverdict(pass, "Decoded ", v_test_dec , " 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_dec, " with result ", v_res);
}
}
......
......@@ -5,7 +5,6 @@
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
//NOT working with TestCast 6.8.2.5 -test fails
/* The following requirements are tested:
......@@ -23,17 +22,17 @@ module Sem_160102_predefined_functions_075 {
//encoded text:
var universal charstring v_enc := encvalue_unichar("aBc","UTF-32"); //encode UTF-32
var universal charstring v_test := "aBcDe";
var universal charstring v_enc := encvalue_unichar(v_test,"UTF-32"); //encode UTF-32
//decode:
var charstring v_test_dec;
var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-32"); //decode (UTF-32)
var integer v_res:= decvalue_unichar(v_test,v_test_dec,"UTF-32"); //decode (UTF-32)
if (v_res == 0) {
setverdict(pass, "Decoded ", v_enc , " with result ", v_res);
setverdict(pass, "Decoded ", v_test_dec , " 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_dec , " with result ", v_res);
}
}
......
......@@ -27,13 +27,13 @@ module Sem_160102_predefined_functions_080 {
var integer v_res := decvalue(v_test, v_decoded);
var integer v_res_8 := decvalue_unichar(v_test_enc_8, v_decoded_8, "UTF-8");
if(match(v_res,0)){
if(match(v_res,1)){
setverdict(pass,"Decoded ", v_decoded , " with result ", v_res);
}else{
setverdict(fail,"Decode failed ", v_decoded , " with result ", v_res);
}
if(match(v_res_8,0)){
if(match(v_res_8,1)){
setverdict(pass,"Decoded ", v_decoded_8 , " with result ", v_res_8);
}else{
setverdict(fail,"Decode failed ", v_decoded_8 , " with result ", v_res_8);
......
......@@ -8,8 +8,6 @@
/* The following requirements are tested:
* The get_stringencoding function analyses the encoded_value and returns the UCS encoding scheme.*/
//NOT working with TestCast 6.8.2.5 - function get_stringencoding is unknown.
module Sem_160102_predefined_functions_081 {
......@@ -19,11 +17,11 @@ module Sem_160102_predefined_functions_081 {
testcase TC_Sem_160102_predefined_functions_081 () runs on GeneralComp {
var octetstring v_test :='414243C3A9C3BC'O ; //UTF-8 encoded octetstring. The decoded value is: ABCéü
var octetstring v_test := '414243C3A9C3BC'O; //UTF-8 encoded octetstring. The decoded value is: ABCéü
var charstring v_get := get_stringencoding(v_test); // expected result: v_get := "ABCéü"
var charstring v_get := get_stringencoding(v_test); // expected result: "UTF8"
if (match(v_get , ("ABCéü","<unknown>"))) {
if (match(v_get , ("UTF-8","<unknown>"))) {
setverdict(pass,"Decoded: ",v_get);
} else {
setverdict(fail, "Unexpected result: ", v_get);
......
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