! This tests the proclab1 macro for the Macro Procedures Lab 1
!
! Author:  Neon Ngo
! Version: $Id: test_proclab1.mm,v 1.2 2008/02/18 23:16:01 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 "00:00:00.000: 136'55'17.921W 017'42'53.010N  25152090m"
      say "02:00:00.000: 128'19'14.927W 057'02'56.486N  20001890m"
      say "04:00:00.000: 041'58'50.918W 030'10'07.824N  14310786m"
      say "06:00:00.000: 020'13'14.114W 050'43'45.819S  16789154m"
      say "08:00:00.000: 056'13'10.695E 052'01'49.926S  23076766m"
      say "10:00:00.000: 055'28'49.007E 016'59'38.182S  26278971m"
      say "12:00:00.000: 042'53'30.995E 018'19'05.710N  25097732m"
      say ""
      say "ACTUAL OUTPUT:"
      say "nM> proclab1 sv3.prm 00:00:00 12:00:00 2:00:00"
      proclab1 sv3.prm 00:00:00 12:00:00 2:00:00
      say ""
    pipe off
  endif
endmacro

procedure processMessage m:msg
  if msg.name eqs "MAIN" then
    assert/text="^reg.main.name: Tests for PROCLAB1" 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
