/***************************************************
 ** @author   STF 409
 ** @version  0.0.1
 ** @purpose  1:B.1.5.3, Ensure that the IUT correctly handles template matching of character pattern expression multiplicity
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

module Sem_B010503_match_n_times_002 {


	type record MessageType {
  	 charstring  	field1,
  	 charstring		field2,
  	 charstring		field3,
  	 charstring		field4,
  	 charstring		field5
	}

    type port loopbackPort message {
	  inout MessageType
	}


type component GeneralComp {
	  port loopbackPort messagePort
}

testcase TC_Sem_B010503_match_n_times_002() runs on GeneralComp {

    var MessageType v_testMessage;

 template MessageType mw_matchingTemplate:=
 {
  field1 := pattern "[e-t]#5",	//mismatching number of characters
  field2 := pattern "[e-t]+",
  field3 := pattern "[e-t]#(3,5)",
  field4 := pattern "[e-t]#(3,)",
  field5 := pattern "[e-t]#(,5)"
 }

 v_testMessage:=  {
  field1 := "test",
  field2 := "test",
  field3 := "test",
  field4 := "test",
  field5 := "test"
 }

 messagePort.send(v_testMessage);

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

control{
    execute(TC_Sem_B010503_match_n_times_002());
}

}
