/***************************************************
 ** @author   STF 409
 ** @version  0.0.1
 ** @purpose  1:B.1.2.5, Ensure that the IUT correctly handles template matching of value range definitions
 ** @verdict  pass reject
 ***************************************************/

module NegSem_B010205_value_range_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,
  	 charstring  	field2,
  	 RecordType		field3,
  	 UnionType		field4
	}

    type port loopbackPort message {
	  inout MessageType
	}


type component GeneralComp {
	  port loopbackPort messagePort
}

testcase TC_NegSem_B010205_value_range_003() runs on GeneralComp {

    var MessageType v_testMessage;

 template MessageType mw_matchingTemplate:=
 {
  field1 := (0..2),
  field2 := ("fff".."aaa"), 	//boundaries in wrong order
  field3 := {a:=1,b:=(0..2),c:=true},
  field4 := {a:=(0..2)}
 }

 v_testMessage:=  {
  field1 := 2,
  field2 := "abc",
  field3 := {a:=1,b:=2,c:=true},
  field4 := {a:=1}
 }

 messagePort.send(v_testMessage);

}

control{
    execute(TC_NegSem_B010205_value_range_003());
}

}
