Commit 439d0480 authored by balaskoa's avatar balaskoa
Browse files

universal charstring tests have been mapped from titan.core


Signed-off-by: default avatarbalaskoa <Jeno.Balasko@ericsson.com>
parent bf1a568b
......@@ -10,24 +10,29 @@
[MODULE_PARAMETERS]
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.
[EXECUTE]
all_from_with_functions #TODO: JSON enc-dec function handling,
encdec_OK #TODO: JSON, BER encoder
TbitstrOper.tc__value_list_bs #fails
[ORDERED_INCLUDE]
### cfgFile ###
#"src/cfgFile/define/macro_reference/TSTM_macro_test_main.cfg" #nok, it went 57 pass but now stops with StackOverflowError
#"src/cfgFile/define/structured/structured.cfg" #nok, stops with StackOverflowError
#"src/cfgFile/module_parameters/nested/nested.cfg" #TODO; it is simplified and reported in NestedRoI; RT2 bugfix it! Dot notation problem! Reported
#"src/cfgFile/module_parameters/references/references.cfg" #TODO: mp:=mp+1
#"src/cfgFile/ordered_include/oi_after_list1.cfg" #Error while setting parameter field 'tsp_c' to '0': Type mismatch: charstring value was expected instead of null.
#"src/cfgFile/testport_parameters/array_index.cfg" #compiled, not runnining, it shall be excluded anyway!!!
#First edit the cfg file! Line 21 should active
"src/assignmentNotation/TassignmentNotation.cfg" #Verdict Statistics: 0 none (0 %), 7 pass (100 %), 0 inconc (0 %), 0 fail (0 %), 0 error (0 %)
#"src/assignmentNotation/TassignmentNotation.cfg" #Verdict Statistics: 0 none (0 %), 7 pass (100 %), 0 inconc (0 %), 0 fail (0 %), 0 error (0 %)
#HACK: escaped double quote added, ass. not. nok Error message:
# Error while setting parameter field 'tsp_editor' to 'vim': Referenced module parameter cannot be found. Module `vim' does not exist, and no parameter with name `vim' exists in any module.
"src/ucharstrOper/config.cfg"
[EXECUTE]
#all_from_with_functions #TODO: JSON enc-dec function handling,
#encdec_OK #TODO: JSON, BER encoder
#TbitstrOper.tc__value_list_bs #fails
cstr_content.tc_unichar_utf8_mp2
### cfgFile ###
"src/cfgFile/define/macro_reference/TSTM_macro_test_main.cfg" #nok, it went 57 pass but now stops with StackOverflowError
"src/cfgFile/define/structured/structured.cfg" #nok, stops with StackOverflowError
"src/cfgFile/module_parameters/nested/nested.cfg" #TODO; it is simplified and reported in NestedRoI; RT2 bugfix it! Dot notation problem! Reported
"src/cfgFile/module_parameters/references/references.cfg" #TODO: mp:=mp+1
"src/cfgFile/ordered_include/oi_after_list1.cfg" #Error while setting parameter field 'tsp_c' to '0': Type mismatch: charstring value was expected instead of null.
#"src/cfgFile/testport_parameters/array_index.cfg" #compiled, not runnining, it shall be excluded anyway!!!
[LOGGING]
# In this section you can specify the name of the log file and the classes of events
......
......@@ -134,6 +134,9 @@ RAW_integer_test
#RAW/ustr
ustr.control
RAWCodingAttributes.control
#cont here ....
#ucharstrOper #pass, see in [ORDERED_INCLUDE] "src/ucharstrOper/config.cfg"
#################
#functions.control
......@@ -202,6 +205,7 @@ TsetofOper.control
#"src/cfgFile/ordered_include/oi_after_list1.cfg" #Error while setting parameter field 'tsp_c' to '0': Type mismatch: charstring value was expected instead of null.
#"src/cfgFile/testport_parameters/array_index.cfg" #compiled, not runnining, it shall be excluded anyway!!!
"src/ucharstrOper/config.cfg" # Bugfixed: UTF8Testcases.control stops with error
[LOGGING]
# In this section you can specify the name of the log file and the classes of events
# you want to log into the file or display on console (standard error).
......
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Kovacs, Ferenc
* Szabados, Kristof
*
******************************************************************************/
module TucharstrOper
{
type component ucharstrOper_comptype { }
type universal charstring myustr0
type myustr0 myustr1
type myustr0 myustr2 (char(0, 0, 0, 1)..char(0, 0, 1, 0))
type myustr0 myustr3 (char(0, 0, 0, 0), char(0, 0, 0, 1), char(0, 0, 1, 0))
type myustr0 myustr4 (char(0, 0, 0, 0) & char(0, 0, 0, 0), c_myustr0)
type myustr0 myustr5 (c_myustr0..c_myustr0) length(lengthof(c_myustr0))
type universal charstring myustr6 (pattern "abc?\q{0, 0, 0, 65}")
type myustr0 myustr7 (pattern "abc*xyz")
type myustr7 myustr8 length(0) // It should be an empty set.
type myustr1 myustr9 length(2)
type universal charstring MyUCharString1 ("a".."z")
type universal charstring MyUCharString2 (char(0, 0, 1, 111)..char(0, 0, 1, 113))
type universal charstring myustr10 (myustr2, myustr3)
type universal charstring myustr11 length(0..infinity) // Full set.
const myustr0 c_myustr0 := char(0, 0, 0, 0)
const myustr7 c_myustr1 := "abcxyz"
const myustr10 c_myustr2 := char(0, 0, 0, 1)
template myustr0 t_myustr0 := char(0, 0, 0, 0)
template myustr7 t_myustr1 := "abc" & c_myustr1 & "xyz"
template myustr3 t_myustr2 := pattern char(0, 0, 0, 1)
template myustr10 t_myustr3 := c_myustr2
template myustr2 t_myustr4 := char(0, 0, 0, 1) length(1)
function f_ustr1() return myustr7 {
if (lengthof(t_myustr1) > lengthof(c_myustr1)) { return valueof(t_myustr1) }
else { return c_myustr1 }
}
testcase ucharstrSubtypes() runs on ucharstrOper_comptype {
var template myustr2 vt_myustr1 := char(0, 0, 0, 1) // Value range.
var template myustr3 vt_myustr2 := vt_myustr1 // Value list.
var template myustr5 vt_myustr3 := char(0, 0, 0, 0) // Length and value range.
var template myustr9 vt_myustr4 := valueof(vt_myustr3) & valueof(vt_myustr3) // Length only.
var myustr2 v_myustr1 := char(0, 0, 0, 1)
var myustr3 v_myustr2 := v_myustr1
var myustr5 v_myustr3 := char(0, 0, 0, 0)
var myustr9 v_myustr4 := v_myustr3 & v_myustr3
if (valueof(vt_myustr1) == v_myustr1 and v_myustr2 == valueof(vt_myustr2)) { setverdict(pass) }
else { setverdict(fail) }
if (valueof(vt_myustr3) == v_myustr3 and v_myustr4 == valueof(vt_myustr4)) { setverdict(pass) }
else { setverdict(fail) }
if (f_ustr1() == "abc" & c_myustr1 & "xyz") { setverdict(pass) }
else { setverdict(fail) }
}
testcase ucharstrIsvalue() runs on ucharstrOper_comptype {
var universal charstring us := "foo";
var universal charstring un;
var template universal charstring ust := "bar";
if ( isvalue(us) ) { setverdict(pass); } else { setverdict(fail); };
if ( isvalue(un) ) { setverdict(fail); } else { setverdict(pass); };
if ( isvalue(ust) ) { setverdict(pass); } else { setverdict(fail); };
}
testcase ucharstrIsbound() runs on ucharstrOper_comptype {
var universal charstring us := "foo";
var universal charstring un;
var template universal charstring ust := "bar";
if ( isbound(un) ) { setverdict(fail); } else { setverdict(pass); };
if ( isbound(un[0]) ) { setverdict(fail); } else { setverdict(pass); };
if ( isbound(us) ) { setverdict(pass); } else { setverdict(fail); };
if ( isbound(ust) ) { setverdict(pass); } else { setverdict(fail); };
}
testcase CR_TR00018474() runs on ucharstrOper_comptype {
// Indexing of string template variables.
var template universal charstring vtu1 := "fisherman"
var template universal charstring vtu2 := char(0, 0, 0, 65) & "F" & char(0, 0, 0, 65)
vtu1[0] := "F"
if (match(char(0, 0, 0, 70) & char(0, 0, 0, 105) & char(0, 0, 0, 115) & char(0, 0, 0, 104) & char(0, 0, 0, 101) & char(0, 0, 0, 114) & char(0, 0, 0, 109) & char(0, 0, 0, 97) & char(0, 0, 0, 110), vtu1)) { setverdict(pass) } else { setverdict(fail) }
vtu1[0] := "F" // Indexed assignment notation cannot be used here.
vtu1[1] := "i" // Still works, nothing special.
if (match(char(0, 0, 0, 70) & char(0, 0, 0, 105) & char(0, 0, 0, 115) & char(0, 0, 0, 104) & char(0, 0, 0, 101) & char(0, 0, 0, 114) & char(0, 0, 0, 109) & char(0, 0, 0, 97) & char(0, 0, 0, 110), vtu1)) { setverdict(pass) } else { setverdict(fail) }
vtu2[0] := "B"
if (match("BF" & char(0, 0, 0, 65), vtu2)) { setverdict(pass) } else { setverdict(fail) }
}
control {
const universal charstring cl_1 := char(0, 0, 0, 0)
const universal charstring cl_2 := "abcxyz"
var universal charstring vl_1 := char(0, 0, 0, 0)
var universal charstring vl_2 := "abcxyz"
execute(ucharstrSubtypes());
execute(ucharstrIsvalue());
execute(ucharstrIsbound());
execute(CR_TR00018474());
}
}
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Szabo, Bence Janos – initial implementation
*
******************************************************************************/
module Any2Unistr
{
type component EmptyCT {}
testcase tc_any2unistr() runs on EmptyCT {
var integer v_int1 := 5, v_int2;
var template integer vmw_int1 := ?;
var template integer vmw_int2 := -1 ifpresent;
var universal charstring v_chr1, v_chr2, v_chr3, v_chr4;
v_chr1 := any2unistr(v_int1); // after the assignment v_chr1 will be "5"
v_chr2 := any2unistr(v_int2); // after the assignment v_chr2 will be "<unbound>"
v_chr3 := any2unistr(vmw_int1); // after the assignment v_chr3 will be "?"
v_chr4 := any2unistr(vmw_int2); // after the assignment v_chr3 will be "-1 ifpresent"
var universal charstring v_chr1_exp, v_chr2_exp, v_chr3_exp, v_chr4_exp;
v_chr1_exp := "5";
v_chr2_exp := "<unbound>";
v_chr3_exp := "?";
v_chr4_exp := "-1 ifpresent";
if(match(v_chr1,v_chr1_exp) and match(v_chr2,v_chr2_exp) and
match(v_chr3,v_chr3_exp) and match(v_chr4,v_chr4_exp)) {
setverdict(pass);
} else {
setverdict(fail);
}
}
control
{
execute(tc_any2unistr());
}
}
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Baranyi, Botond
*
******************************************************************************/
// This module tests the following functions:
// encode_base64
// decode_base64
module Base64Testcases {
import from Common all;
type record of charstring RoCS;
const RoCS base64table := {
"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P",
"Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f",
"g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v",
"w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"
}
function f_base64_encdec_positivetest(octetstring os, boolean use_linebreaks := false) {
var charstring cs :=encode_base64(os);
var octetstring os2:=''O;
if(use_linebreaks==false) {
if(cs == encode_base64(os,use_linebreaks)){
setverdict(pass);
} else {
setverdict(fail);
}
}
log("Encoded:",cs)
var charstring expected := f_my_encode_base64(os);
if(cs == expected) {
setverdict(pass, "Encoding ok")
} else {
setverdict(fail,"Encoding nok")
}
os2 := decode_base64(cs);
log(os2);
if(os2 == os){
setverdict(pass, "Encoding->decoding gives back the original value")
} else {
setverdict(fail, "Encoding->decoding does not give back the original value")
}
}
function f_my_encode_base64(in octetstring os, in boolean linebreaks := false) return charstring {
var integer remainder := lengthof(os) mod 3;
var integer extraBytes;
var charstring cs_tail:=""; //this will be added to the charstring
select(remainder) {
case(0){
cs_tail:="";
extraBytes:=0;
}
case(1){
cs_tail := "==";
extraBytes:=2;
os := os & '0000'O;
}
case(2){
cs_tail := "=";
extraBytes := 1;
os := os & '00'O;
}
}
var bitstring bs := oct2bit(os);
var charstring cs :="";
var integer N := lengthof(bs)-extraBytes*6;
var charstring temp;
var integer tempi;
for( var integer i:=0; i<N; i:=i+6 ) {
cs := cs & base64table[bit2int(substr(bs,i,6))];
}
cs := cs & cs_tail;
var charstring cs_modified :="";
if(linebreaks==true){
//insert line breaks:
var integer len := lengthof(cs);
for(var integer i:=0; i<len; i:=i+1) {
cs_modified := cs_modified & cs[i];
if( ((i+1) mod 76) == 0) {
cs_modified := cs_modified & "\r\n";
}
}
log("Result2:",cs_modified);
return cs_modified;
} else {
log("Result: ",cs);
return cs;
}
}
//checks if the error is the expected.
//If expectedError is the empty string, the error message is not checked
function f_base64_decode_negative(
in charstring cs,
in charstring expectedError:=""
) {
@try {
var octetstring os := decode_base64(cs);
setverdict(fail,"Unexpected successful decoding, expected error")
}
@catch(err_str) {
var template charstring expectedErrorTempl := pattern "*{expectedError}";
if(expectedError==""){
setverdict(pass,"Error, as expected: ",err_str)
} else if(match(err_str, expectedErrorTempl)) {
setverdict(pass,"expected error, expected: ", expectedError, " got: ", err_str)
} else {
setverdict(fail, "not expected error, expected: ", expectedError, " got: ", err_str)
}
}
}
type record of octetstring RoOS;
testcase tc_base64_encdec() runs on MTC {
var RoOS r := {'01'O, '0102'O, '010203'O, '0102030405'O}
var integer len:=lengthof(r);
for( var integer i:=0;i<len;i:=i+1) {
f_base64_encdec_positivetest(r[i],false);
f_base64_encdec_positivetest(r[i],true);
}
}
//This testcase is based on examples from the spec.
testcase tc_base64_enc_examples() runs on MTC {
var RoCS inputcs:= {
"Man",
"any carnal pleasure.",
"any carnal pleasure",
"Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure."
}
var RoOS r := {char2oct("any carnal pleasure.")}
var integer lencs:= lengthof(inputcs);
for(var integer i:=0;i<lencs;i:=i+1){
r[i]:=char2oct(inputcs[i]);
}
var RoCS expectedResults :={
"TWFu",
"YW55IGNhcm5hbCBwbGVhc3VyZS4=",
"YW55IGNhcm5hbCBwbGVhc3VyZQ==",
"TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="
}
//var RoOS r := {'01'O, '0102'O, '010203'O, '0102030405'O}
var integer len:=lengthof(r);
var charstring encoded;
for( var integer i:=0;i<len;i:=i+1) {
log(f_my_encode_base64(r[i]));
encoded := encode_base64(r[i]);
log(encoded);
log(expectedResults[i]);
if(encoded == expectedResults[i] ) {
setverdict(pass,"base64 encoding is the expected");
} else {
setverdict(fail, "base64 encoding is not the expected");
}
if(encoded == f_my_encode_base64(r[i],false)){
setverdict(pass,"base64 encoding is the expected");
} else {
setverdict(fail, "base64 encoding is not the expected");
}
//decoding:
//var octetstring os := decode_base64(encoded);
if( decode_base64(encoded) == r[i]) {
setverdict(pass,"base64 decoding i the expected");
} else {
setverdict(fail,"base64 decodong is not the expected");
}
}
}
testcase tc_base64_enc_examples_with_linebreaks() runs on MTC {
var RoCS inputcs:= {
"Man",
"any carnal pleasure.",
"any carnal pleasure",
"Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure."
}
var RoOS r := {char2oct("any carnal pleasure.")}
var integer lencs:= lengthof(inputcs);
for(var integer i:=0;i<lencs;i:=i+1){
r[i]:=char2oct(inputcs[i]);
}
var RoCS expectedResults :={
"TWFu",
"YW55IGNhcm5hbCBwbGVhc3VyZS4=",
"YW55IGNhcm5hbCBwbGVhc3VyZQ==",
"TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz\r\nIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg\r\ndGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu\r\ndWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo\r\nZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="
}
//var RoOS r := {'01'O, '0102'O, '010203'O, '0102030405'O}
var integer len:=lengthof(r);
var charstring encoded;
for( var integer i:=0;i<len;i:=i+1) {
encoded := encode_base64(r[i],true);
//log(encoded);
//log(expectedResults[i]);
if(encoded == expectedResults[i] ) {
setverdict(pass,"base64 encoding is the expected");
} else {
setverdict(fail, "base64 encoding is not the expected. Expected: ",expectedResults[i]," got: ",encoded );
}
if(encoded == f_my_encode_base64(r[i],true) ){
setverdict(pass,"base64 encoding is the expected by me");
} else {
setverdict(fail, "base64 encoding is not the expected by me");
}
//decoding:
if(decode_base64(encoded) == r[i]) {
setverdict(pass,"base64 decoding i the expected");
} else {
setverdict(fail,"base64 decodong is not the expected");
}
}
}
//This testcase is based on encoding-decoding of octetstrings.
//The octetstring is a concatenation of the first N integers converted to one length octetstring
testcase tc_base64_generated_strings_1() runs on MTC {
var octetstring os:=''O ;
var integer N:=256;
for( var integer i:=0; i<N; i:=i+1){
os := os & int2oct(i,1);
log("======================");
log("i: ",i," os: ",os);
f_base64_encdec_positivetest(os,false);
}
}
//This testcase is based on encoding-decoding of octetstrings.
//The octetstring is a concatenation of the first N integers converted to two length octetstring
testcase tc_base64_generated_strings_2() runs on MTC {
var octetstring os:=''O ;
var integer N:=256*256;
for( var integer i:=0; i<N; i:=i+254){
os := os & int2oct(i,2);
log("======================");
log("i: ",i," os: ",os);
f_base64_encdec_positivetest(os,false);
}
}
testcase tc_base64_decode_negative_with_checkingErrorMessage() runs on MTC {
var RoCS rofcs := { " ","!", "#","$","%","&","'","(",")","*",":", "<",">", "{", "}", "~" };
var integer len := lengthof(rofcs);
for(var integer i:=0;i<len;i:=i+1) {
f_base64_decode_negative(rofcs[i],"Error: Invalid character in Base64 encoded data: 0x"& oct2str(char2oct(rofcs[i])));
}
}
testcase tc_base64_decode_negative_without_checkingErrorMessage() runs on MTC {
var RoCS rofcs := { " Baba","Baba!", "ba#ba","bla$%bla","bla ","&","'","(",")","*",":", "<",">", "{", "}", "~" };
var integer len := lengthof(rofcs);
for(var integer i:=0;i<len;i:=i+1) {
f_base64_decode_negative(rofcs[i],"");
}
}
control {
execute(tc_base64_encdec());
execute(tc_base64_enc_examples());
execute(tc_base64_enc_examples_with_linebreaks());
execute(tc_base64_generated_strings_1());
execute(tc_base64_generated_strings_2());
execute(tc_base64_decode_negative_with_checkingErrorMessage());
execute(tc_base64_decode_negative_with_checkingErrorMessage());
}
}
/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Baranyi, Botond
*
******************************************************************************/
// This module contain the common constants, types and functions for testing the following functions:
// oct2unichar
// unichar2oct
// get_stringencoding
module Common {
const octetstring c_BOM_UTF8 :='EFBBBF'O;
const octetstring c_BOM_UTF16BE :='FEFF'O
const octetstring c_BOM_UTF16LE :='FFFE'O
const octetstring c_BOM_UTF32BE :='0000FEFF'O;
const octetstring c_BOM_UTF32LE :='FFFE0000'O;
const universal charstring c_arvizturo := char(0,0,0,193)&"rv"&char(0,0,0,237)&"zt"&char(0,0,1,113)&"r"&char(0,0,1,81) & " t" & char(0,0,0,252)&"k"&char(0,0,0,246)&"rf"&char(0,0,0,250)&"r"&char(0,0,0,243)&"g"&char(0,0,0,233)&"p";
type component MTC {}
type record of universal charstring RoUCS;
type record of octetstring RoOS;
function f_check_string_encoding( in octetstring os, in charstring expectedEncoding) {
var charstring c := get_stringencoding(os);
log(c);
if( c == expectedEncoding ) {
setverdict(pass,"encoding type ok");
} else {
setverdict(fail,"encoding type nok, expected: " & expectedEncoding & " got: " & c );
}
}
function f_oct2unichar_positivetest(
in octetstring inputOs,
in charstring encType,
in universal charstring expectedUCS,
in charstring expectedEncType,
in octetstring expectedOs :=''O
) {
var universal charstring u;
@try{
u := oct2unichar( inputOs, encType );
log("Unicode result:",u);
if(match(u,expectedUCS)) {
setverdict(pass,"oct2unichar() conversion is the expected");
} else {
setverdict(fail,"unmatched :", match(u,expectedUCS));
}
}
@catch(err_str) {
//setverdict(fail,"oct2unichar(",inputOs , ", ", encType ," ) unexpectedly failed:" , err_str );