/***************************************************
 ** @author   STF 409
 ** @version  0.0.1
 ** @purpose  1:B.1.1.1, Ensure that the IUT correctly handles template matching of omitted values
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

module Sem_B010101_omitting_values_002 {

	type record RecordType {
 	 integer  a optional,
 	 integer  b optional,
 	 boolean  c
	}

	type set SetType {
 	 integer  a optional,
 	 integer  b optional,
 	 boolean  c
	}

	type record MessageType {
  	 RecordType		field1,
  	 SetType		field2
	}

    type port loopbackPort message {
	  inout MessageType
	}


type component GeneralComp {
	  port loopbackPort messagePort
}

testcase TC_Sem_B010101_omitting_values_002() runs on GeneralComp {

    var MessageType v_testMessage;

 template MessageType mw_matchingTemplate:=
 {
  field1 := {a:=1,b:=omit,c:=true},	//value mismatch
  field2 := {a:=1,b:=omit,c:=true}
 }

 v_testMessage:=  {
  field1 := {a:=1,b:=2,c:=true},
  field2 := {a:=1,b:=omit,c:=true}
 }

 messagePort.send(v_testMessage);

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

control{
    execute(TC_Sem_B010101_omitting_values_002());
}

}
