! This tests the contlab1 macro for the Macro Control Lab 1
!
! Author:  Neon Ngo
! Version: $Id: test_contlab1.mm,v 1.1 2007/07/24 22:51:29 ntn Exp $
!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE
  switch BASELINE    baseline GET DEF=FALSE SDEF=TRUE

  if interAct then
    res inst "Verify the EXPECTED OUTPUT against the ACTUAL OUTPUT."

    pipe on
      panel/msgid=MAIN/setup/controls=gc
      gcontrol text idtext "Instructions" "^inst" 24 4 /title
      gcontrol menu main "Exit with Status = " "PASS,FAIL" /tleft
      set gc.main.itemColors {PASS=GREEN,FAIL=RED}

      shellgui/attach
      say ""
      say "EXPECTED OUTPUT:"
      say "Count is -9 (odd)"
      say "Count is -6 (even)"
      say "Count is -3 (odd)"
      say "Count is 0 (zero)"
      say "Count is 3 (odd)"
      say "Count is 6 (even)"
      say "Count is 9 (odd)"
      say "0nmi = 0.0km"
      say "1nmi = 1.852km"
      say "2nmi = 3.704km"
      say "3nmi = 5.556km"
      say "4nmi = 7.408km"
      say "5nmi = 9.26km"
      say "KEY=A VALUE=1"
      say "KEY=B VALUE=2"
      say "KEY=C VALUE=3"
      say ""
      say "ACTUAL OUTPUT:"
      say "nM> contlab1 {A=1,B=2,C=3}"
      contlab1 {A=1,B=2,C=3}
    pipe off
  endif
endmacro

procedure processMessage m:msg
  if msg.name eqs "MAIN" then
    assert/text="^reg.main.name: Tests for CONTLAB1" msg.data eqss "PASS"
    pipe stop
  else
    say "^reg.main.name: Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  endif
return
