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

	type integer address;

	type port P message {
		inout integer;
	}

    type component GeneralComp {
		port P p1, p2;
	}

	testcase TC_Sem_2204_the_check_operation_014() runs on GeneralComp {
		var integer v_val;
		p2.send(integer:1) to 80;
        alt
		{
        	[] any port.check(receive(integer:?) from address:(20..40) -> value v_val) {
				setverdict(fail, "Incorrect match");
			}
			[] any port.receive {
				if (not isbound(v_val)) { setverdict(pass, "As expected, the check operation didn't match"); }
				else { setverdict(fail, "The value should still be undefined at this point"); }
			}
		}
    }

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