/***************************************************
 ** @author   STF 470
 ** @version  0.0.1
 ** @purpose  1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value listing
 ** @verdict  pass reject
 ***************************************************/

module NegSem_B010202_complemented_value_list_003 {

//	type enumerated EnumeratedType {e_black, e_white, e_green};

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

//	type union UnionType {
// 	 integer  a,
// 	 EnumeratedType  b,
// 	 boolean  c
//	}

	type record MessageType {
  	 integer        field1,
  	 RoI            field2
	}

    type record of integer RoI;

    type port loopbackPort message {
	  inout MessageType
	}


type component GeneralComp {
	  port loopbackPort messagePort
}

testcase TC_NegSem_B010202_complemented_value_list_003() runs on GeneralComp {

    var MessageType v_testMessage;

    template RoI m_RoI4 := ?;

 template MessageType mw_matchingTemplate:=
 {
  field1 := complement(0, 100),
  field2 := complement(all from m_RoI4)// causes an error because t_RoI4 resolves into a matching mechanism
 }

 v_testMessage:=  {
  field1 := 0,
  field2 := {0,1}
 }

 messagePort.send(v_testMessage);

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

control{
    execute(TC_NegSem_B010202_complemented_value_list_003());
}

}
