/***************************************************
 ** @author   STF 487 (updated by STF 521)
 ** @version  0.0.2
 ** @purpose  1:16.1.2, Ensure that predefined decvalue_unichar function works properly
 ** @verdict  pass accept, ttcn3verdict:pass

 ***************************************************/

/* The following requirements are tested:

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



module Sem_160102_predefined_functions_073 {

    type component GeneralComp {

    }

    type universal charstring UStr with { variant "UTF-16LE" }
    testcase TC_Sem_160102_predefined_functions_073 () runs on GeneralComp {


    //encoded text:
    var UStr v_test := "aBcDe";
    var universal charstring v_enc := encvalue_unichar(v_test,"UTF-16LE");

    //decode:
    var UStr v_test_dec;
    var integer v_res:= decvalue_unichar(v_enc,v_test_dec,"UTF-16LE"); //decode (UTF-16LE)

    if (v_res == 0) {
          setverdict(pass, "Decoded ", v_test_dec , " with result ", v_res);
    } else {
          setverdict(fail, "Unexpected decoding result: Decoded ", v_test_dec, " with result ", v_res);
    }

   }

    control{

        execute(TC_Sem_160102_predefined_functions_073());

    }

}