/***************************************************
 ** @author   STF 470
 ** @version  0.0.1
 ** @purpose  1:16.1.2, Ensure that predefined encvalue function works correctly (as specified in Annex C.5.1)
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

// The following requirements are tested:
// (C.5.1) The encvalue function encodes a value or template into a bitstring. When the actual
// parameter that is passed to inpar is a template, it shall resolve to a specific value (the
// same restrictions apply as for the argument of the send statement). The returned bitstring
// represents the encoded value of inpar, however, the TTCN-3 test system need not make any
// check on its correctness.

module Sem_160102_predefined_functions_016 {
    type integer I with { variant "32 bit"};

    type component GeneralComp {
    }

    testcase TC_Sem_160102_predefined_functions_016 () runs on GeneralComp {
        var template I v_test := 0;
		var bitstring v_res := encvalue(v_test);
		if (lengthof(v_res) == 32) {
			setverdict(pass);
		} else {
			setverdict(fail, "Invalid encoding length");
		}
    }

    control{
        execute(TC_Sem_160102_predefined_functions_016());
    }
}