/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value omit
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

//Restriction e) The complement of a template list shall not match omit.

module Sem_B010202_complemented_value_list_008 {

type record MyRec{
     integer field1,
     float   field2 optional
    }

    type port loopbackPort message {
	  inout MyRec
	}


type component GeneralComp {
	  port loopbackPort messagePort
}

testcase TC_Sem_B010202_complemented_value_list_008() runs on GeneralComp {

    var MyRec v_testMessage;

 template MyRec mw_matchingTemp:={field1:=1,field2:=omit};

 template MyRec mw_matchingTemplate:=complement(mw_matchingTemp);


 v_testMessage:= {field1:=11,field2:=omit};    // correct, field2 is omit and is not matched


 messagePort.send(v_testMessage);

    alt {
     [] messagePort.receive(mw_matchingTemplate) {
        setverdict(pass);
     }
     [] messagePort.receive {
        setverdict(fail);
     }
    }
}

control{
    execute(TC_Sem_B010202_complemented_value_list_008());
}

}
