Sem_160102_predefined_functions_071.ttcn 1.2 KB
Newer Older
kovacsa's avatar
kovacsa committed
/***************************************************
 ** @author   STF 487
kovacsa's avatar
kovacsa committed
 ** @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 

kovacsa's avatar
kovacsa committed

/* The following requirements are tested:  

 * this test focuses on the predefined functions decvalue_unichar (utf-8) with charstring input*/



module Sem_160102_predefined_functions_071 {
    
    type component GeneralComp {

    }

    testcase TC_Sem_160102_predefined_functions_071 () runs on GeneralComp {

kovacsa's avatar
kovacsa committed
    //encoded text:
   var universal charstring v_enc := encvalue_unichar("aBcDeF","UTF-8");
    var charstring v_test_dec;
kovacsa's avatar
kovacsa committed
    var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-8"); //decode (UTF-8)
    
    if (v_res == 0) {
          setverdict(pass, "Decoded ", v_enc , " with result ", v_res);
kovacsa's avatar
kovacsa committed
    } else {
          setverdict(fail, "Unexpected decoding result: Decoded ", v_enc , " with result ", v_res);
kovacsa's avatar
kovacsa committed
    }

   }

    control{

        execute(TC_Sem_160102_predefined_functions_071());

    }

}