/*****************************************************************
 ** @author   STF 451
 ** @version  0.0.1
 ** @purpose  1:11.2, Ensure that partially initialized templates are evaluated correctly.
 ** @verdict  pass reject
 *****************************************************************/

module NegSem_1102_TemplateVars_002 {

 type set IntegerSet {
  integer a1 optional,
  integer a2 optional,
  integer a3 optional
 };

    type port loopbackPort message {
	  inout IntegerSet
	}


type component GeneralComp {
	  port loopbackPort messagePort
}

testcase TC_NegSem_1102_TemplateVars_002() runs on GeneralComp {
	var template IntegerSet mw_pattern := {a1:=1,a2:=*};
	var IntegerSet v_set := {a1:=1,a2:=2,a3:=3}

 messagePort.send(v_set);

    alt {
     [] messagePort.receive(mw_pattern) {	//attempted matching of partially initialized template
        setverdict(pass);
     }
     [] messagePort.receive {
        setverdict(fail);
     }
    }

}

control{
    execute(TC_NegSem_1102_TemplateVars_002());
}

}
