/*****************************************************************
 ** @author   STF 572
 ** @version  0.0.1
 ** @purpose  1:21.3.10, call operation calling an altstep with out and inout parameters
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

// The following requirements are tested:
// After  complete execution of the started behaviour, the out and inout actual parameters given
// to the actual parameter list of the called function or altstep instance will be updated in the
// same manner as if it was a normal function/altstep invocation.

module Sem_210310_call_test_component_operation_007 {
	type port P message {
	    inout integer;
	}
    type component GeneralComp {
	    port P p;
	}

	altstep a_test(out integer p_par1, inout integer p_par2) runs on GeneralComp {
	    [] p.receive {
	        p_par1 := 10;
		    p_par2 := p_par2 * 2;
            setverdict(pass);
		}
	}

    testcase TC_Sem_210310_call_test_component_operation_007() runs on GeneralComp system GeneralComp {
        var GeneralComp v_ptc := GeneralComp.create;
		var integer v_var1 := 0, v_var2 := 3;
        connect(self:p, v_ptc:p);
		p.send(1);
		v_ptc.call(a_test(v_var1, v_var2));
		if (v_var1 == 10 and v_var2 == 6) {
		    setverdict(pass);
		} else {
		    setverdict(fail);
		}
    }

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