/*****************************************************************
 ** @author   STF 470
 ** @version  0.0.1
 ** @purpose  1:22.3.6, Verify that error occurs when any from catch is applied to single port
 ** @verdict  pass reject
 *****************************************************************/
// The following requirements are tested:
// Restriction g
// The PortArrayRef shall be a reference to a port array variable identifier.
module NegSem_220306_catch_operation_001 {

	signature S() exception(integer);

	type port P procedure {
		inout S;
	}

    type component GeneralComp
	{
		port P p;
	}

	function f() runs on GeneralComp
	{
		p.getcall(S:?);
		p.raise(S, 10);
	}

    testcase TC_NegSem_220306_catch_operation_001() 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;
        alt
		{
        	[] any from p.catch { setverdict(pass); }
			[else] { setverdict(fail, "The any from catch operation didn't match for some reason"); }
		}
	}

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