/*****************************************************************
 ** @author   STF 470
 ** @version  0.0.1
 ** @purpose  1:22.4, Verify behaviour of port.check(catch) in case of unsuccessful match inside alt
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/
module Sem_2204_the_check_operation_081 {

	signature S() exception(integer);
	type port P procedure {
		inout S;
	}

    type component GeneralComp {
		port P p;
	}

	function f() runs on GeneralComp {
		p.getcall;
		setverdict(pass, "Call received");
		p.raise(S, integer:1);
	}

	testcase TC_Sem_2204_the_check_operation_081() 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());
        alt
		{
        	[] p.check(catch(S, integer:(100..200))) { setverdict(fail, "Incorrect match"); }
			[] p.catch { setverdict(pass, "As expected, the check operation didn't match"); }
		}
    }

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