/***************************************************
 ** @author   STF 487 (updated by STF 521)
 ** @version  0.0.2
 ** @purpose  1:5.4.1, verify that compatibility rules are used for passing out parameters
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

// The following requirement is tested:
// If parameters are passed by value (i.e. in case of in and out parameters), type compatibility
// rules specified in 6.3 apply.

module Sem_050401_top_level_017 {

	type component GeneralComp {
	}

    type record R1 {
        integer field1,
        integer field2
    }

    type record R2 {
        integer option1,
        integer option2
    }

	function f(out R2 p_rec) {
        p_rec.option1 := 1;
        p_rec.option2 := 2;
	}

	testcase TC_Sem_050401_top_level_017() runs on GeneralComp {
        var R1 v_rec;
		f(v_rec);
        if (match(v_rec, {1, 2})) { setverdict(pass); }
        else { setverdict(fail, "v_rec value not matching ", v_rec, R1:{1, 2}); }
	}

	control{
		execute(TC_Sem_050401_top_level_017());
	}
}
