Commit 10cf371b authored by stancakapost's avatar stancakapost
Browse files

always decode the same type as the one that was encoded

parent 031a7abf
/***************************************************
** @author STF 487
** @version 0.0.1
** @version 0.0.1
** @purpose 1:16.1.2, Ensure that predefined decvalue_unichar function works properly
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
//NOT working with TestCast 6.8.2.5 -test fails
/* The following requirements are tested:
......@@ -20,19 +22,19 @@ module Sem_160102_predefined_functions_071 {
testcase TC_Sem_160102_predefined_functions_071 () runs on GeneralComp {
var universal charstring v_test := "AbC";
var universal charstring v_test_dec;
//encoded text:
var universal charstring v_enc := encvalue_unichar(v_test,"UTF-8");
var universal charstring v_enc := encvalue_unichar("aBcDeF","UTF-8");
//decode:
var charstring v_test_dec;
var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-8"); //decode (UTF-8)
if (v_res == 0) {
setverdict(pass, "Decoded ", v_test_dec , " with result ", v_res);
setverdict(pass, "Decoded ", v_enc , " with result ", v_res);
} else {
setverdict(fail, "Unexpected decoding result: Decoded ", v_test_dec , " with result ", v_res);
setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res);
}
}
......
......@@ -5,6 +5,7 @@
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
//NOT working with TestCast 6.8.2.5 -test fails
/* The following requirements are tested:
......@@ -22,17 +23,17 @@ module Sem_160102_predefined_functions_075 {
//encoded text:
var universal charstring v_test := "aBcDe";
var universal charstring v_enc := encvalue_unichar(v_test,"UTF-32"); //encode UTF-32
var universal charstring v_enc := encvalue_unichar("aBc","UTF-32"); //encode UTF-32
//decode:
var charstring v_test_dec;
var integer v_res:= decvalue_unichar(v_test,v_test_dec,"UTF-32"); //decode (UTF-32)
var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-32"); //decode (UTF-32)
if (v_res == 0) {
setverdict(pass, "Decoded ", v_test_dec , " with result ", v_res);
setverdict(pass, "Decoded ", v_enc , " with result ", v_res);
} else {
setverdict(fail, "Unexpected decoding result: Decoded ", v_test_dec , " with result ", v_res);
setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res);
}
}
......
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