/***************************************************
 ** @author   STF 548
 ** @version  0.0.1
 ** @purpose  1:16.1.2, Ensure that predefined 'decvalue_o' function works properly in case of decoding an octetstring
 ** @verdict  pass accept, ttcn3verdict:pass

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

/* The following requirements are tested:
The function shall return an integer value to indicate success or failure of the decoding below:
The return value 1 indicates an unspecified cause of decoding failure. This value is also returned if the
encoded_value parameter contains an unitialized value.
- C.5.6 The decoding from octetstring function
*/


module Sem_160102_predefined_functions_106 {

    type component GeneralComp {}

    testcase TC_Sem_160102_predefined_functions_106 () runs on GeneralComp {

    var octetstring v_ref := ''O;	// cannot decode this octetstring

    //Decoding:
    var charstring v_dec;
    var integer v_res := decvalue_o(v_ref, v_dec); // return value 1 indicates an unspecified cause of decoding failure

    if (match(v_res, 1)) {
    	// encoded_value parameter contains an unitialized value.
          setverdict(pass);
    } else {
          setverdict(fail,v_res);
    }

   }

    control{
        execute(TC_Sem_160102_predefined_functions_106());

    }

}