/*****************************************************************
 ** @author   STF 572
 ** @version  0.0.1
 ** @purpose  1:21.3.10, call operation calling a function with timeout
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

// The following requirements are tested:
// A timeout duration in seconds can be given explicitly in the form of a SimpleExpression as
// an additional parameter to the call operation. If no timeout duration is given, an infinite
// timeout duration is used.

module Sem_210310_call_test_component_operation_003 {

    type component GeneralComp {}

	function f() runs on GeneralComp {
	    timer t := 1.0;
		t.start;
		t.timeout;
		setverdict(pass);
	}

    testcase TC_Sem_210310_call_test_component_operation_003() runs on GeneralComp system GeneralComp {
        var GeneralComp v_ptc := GeneralComp.create;
        v_ptc.call(f(), 2.0);
		if (v_ptc.running) {
		    setverdict(fail);
		} else {
		    setverdict(pass);
		}
    }

    control {
        execute(TC_Sem_210310_call_test_component_operation_003(), 5.0);
    }
}