/*****************************************************************
 ** @author   STF 470
 ** @version  0.0.1
 ** @purpose  1:22.3.2, Verify that error occurs when using index redirection in any port.getcall operation
 ** @verdict  pass reject
 *****************************************************************/
// The following requirements are tested:
// Restriction h
// The index redirection shall only be used when the operation is used on an any from
// port array construct.
module NegSyn_220302_getcall_operation_002 {

	signature S();

	type port P procedure {
		inout S;
	}

    type component GeneralComp
	{
		port P p;
	}

	function f() runs on GeneralComp
	{
		var integer v_index;
        alt
		{
        	[] any port.getcall -> @index value v_index { setverdict(pass); }
			[else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); }
		}
	}

    testcase TC_NegSyn_220302_getcall_operation_002() runs on GeneralComp system GeneralComp {
        var GeneralComp v_ptc := GeneralComp.create;
		connect(self:p, v_ptc:p);
		p.call(S:{}, nowait);
		v_ptc.start(f());
		v_ptc.done;
    }

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