! Tests the SENDTO command
!
! Author : Jay Hallam
! Version: $Id: test_sendto.mm,v 1.2 2013/07/31 13:26:40 ntn Exp $
!******************************************************************************!
startmacro

  SENDTO ID=MAIN NAME=TEST  DATA={B=1,I=2,L=3,D=4.9,S="Old string"}
  SENDTO ID=MAIN NAME=TESTR1 DATA={ONE=1,TWO=2}
  SENDTO ID=MAIN NAME=TESTR2 DATA={ONE=1,TWO=2,TEN=10}
  SENDTO    MAIN TESTQUALS INFO=1 QUALS={A=2775,B="Two"}

endmacro

!******************************************************************************!
procedure processMessage m:msg

  if msg.name EQS "TEST" then
    SENDTO ID=MAIN NAME=TEST2 DATA={S="New string"}
    pause 1
    assert/text="^reg.main.name: timing test" msg.data.s EQS "Old string"

  elseif msg.name EQS "TEST2" then

  elseif msg.name EQS "TESTR1" then
    assert/text="^reg.main.name: Checking nrexists in msg.data" msg.data.ten nrexists

  elseif msg.name EQS "TESTR2" then
    assert/text="^reg.main.name: Checking rexists in msg.data" msg.data.ten rexists

  elseif msg.name EQS "TESTQUALS" then
    assert/text="^reg.main.name: Checking msg.info"    msg.info    eq  1
    assert/text="^reg.main.name: Checking msg.quals"   msg.quals   rexists
    assert/text="^reg.main.name: Checking msg.quals.a" msg.quals.a eq  2775
    assert/text="^reg.main.name: Checking msg.quals.b" msg.quals.b eqs "Two"

  else
    warning "^reg.main.name: Unrecognized message: ^msg"
  endif

return
