! Tests running multiple pipe sections with panels within a single macro. This
! was written to demonstrate the issue seen with Bug 2725 (Can only run one
! pipe section per macro).
!
! Author:  J. Czechowski IV
! Since:   NeXtMidas 3.3.2
! Version: $Id: test_macro_pipe_section.mm,v 1.1 2013/03/12 23:57:17 jxc Exp $
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE  ! for normal interactive test(s)
  switch BASELINE    baseline GET DEF=FALSE SDEF=TRUE  ! for defects or more obscure test case(s)

  res T:tbl   {1="ERROR",2="ERROR",3="ERROR"}
  res L:count 3

! Remove the next two lines when Bug 2725 is fixed
assert/text="Multiple pipe sections per macro - KNOWN DR (Bug 2725)"/NOOP="N/A"
stop
  if (interAct) then
    foreach key inTable tbl
      pipe on
        res inst "Running pipe section test ^{key} of ^{count}, press PASS."
        
        panel/msgid=MAIN/setup/controls=gc
        gcontrol label macro  "MACRO"
        gcontrol menu  MAIN   "Exit with Status = " "PASS,FAIL" TABLE={ItemColors={PASS=GREEN,FAIL=RED}} /tleft
        gcontrol text  idtext "INSTRUCTIONS" "^{inst}" 24 16 /title
      pipe off
    endfor

    foreach key inTable tbl
      assert/text="Multiple pipe sections per macro - Test ^{key} of ^{count}" tbl.^{key} EQS "PASS"
    endfor
  endif

endmacro

!******************************************************************************!
procedure processMessage m:msg
  say "msg.name ^msg.name, data ^msg.data"

  if (msg.name EQS "MAIN") then
    res tbl.^{key} msg.data
    pipe stop
  else
    say "^reg.main.name: Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  endif
return



