/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:B.1.5, Ensure that the IUT correctly handles template quadruple and USI-like syntax matching of character pattern definitions
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

module Sem_B0105_toplevel_002 {


	type record MessageType {
  	 universal charstring  	field1,
  	 universal charstring	field2,
     universal charstring	field3
	}

    type port loopbackPort message {
	  inout MessageType
	}


type component GeneralComp {
	  port loopbackPort messagePort
}

testcase TC_Sem_B0105_toplevel_002() runs on GeneralComp {

    var MessageType v_testMessage;

 template MessageType mw_matchingTemplate:=
 {
  field1 := pattern "\q{0,0,1,113}",                      //"quadruple" notation for character "ű"
  field2 := pattern "\q{0,0,1,113}*\q{0,0,1,116}",        //"quadruple" notation for character "ű" and "Ŵ"
  field3 := pattern "\q{U0171}"                           // USI like notation for character "ű"
 }

 v_testMessage:=  {
  field1 := "ű",
  field2 := "ű1234Ŵ",
  field3 := "ű"
 }

 messagePort.send(v_testMessage);

    alt {
     [] messagePort.receive(mw_matchingTemplate) {
        setverdict(pass,v_testMessage);
     }
     [] messagePort.receive {
        setverdict(fail,"Unexpected decoding result:",v_testMessage);
     }
    }
}

control{
    execute(TC_Sem_B0105_toplevel_002());
}

}
