/***************************************************
 ** @author   STF 433
 ** @version  0.0.1
 ** @purpose  1:22.2.3, Ensure that the IUT correctly handles message trigger operations
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

module Sem_220203_TriggerOperation_003 {


    type port loopbackPort message {
	  inout integer
	}


type component GeneralComp {
	  port loopbackPort messagePort
}

testcase TC_Sem_220203_TriggerOperation_003() runs on GeneralComp {
 var integer v_received:=0;
 timer t_timeout:=5.0;

 messagePort.send(2);
 t_timeout.start;

    alt {
     [] messagePort.trigger(integer:?) -> value v_received {
       if(v_received==2) {  //check that correct value has been stored
        setverdict(pass);
       }
       else {
        setverdict(fail);
       }
     }
     [] messagePort.receive {
        setverdict(fail);
     }
     [] t_timeout.timeout {
        setverdict(pass);
     }
    }
}

control{
    execute(TC_Sem_220203_TriggerOperation_003());
}

}
