!******************************************************************************!
! Test case for gvalue maxVal infinity while minVal is negative
!
! Arguments: None
!
! @bug      NXM-3224 GCONTROL xVAL to unlimited
! @since    3.9.3
! @author:  Kevin Esterheld
!******************************************************************************!
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)

  if interAct then
    set instructions "Check that the gcontrol values do not go greater than &
                      the max or less than the minimum"

    pipe on
      panel/msgid=MAIN/setup/controls=gc
      gcontrol label macro "Test MACRO"
      gcontrol menu  main "Exit with Status =" "PASS,FAIL" TABLE={ItemColors={PASS="GREEN",FAIL="RED"}} /tleft
      gcontrol text  idtext "Instructions" instructions 24 8 /title
      gcontrol XVAL dval1 "Maximum = Infinity, Minimum = -5" 0 -5 -1 1           /msg=yes
      gcontrol XVAL dval2 "Maximum = -2, Minimum = -5" 0 -5 -2 1           /msg=yes
      gcontrol XVAL dval3 "Maximum = 5, Minimum = -5" 0 -5 5 1           /msg=yes

      ! TODO: other GConrols, Graphical Commands, Commands, etc. (otherwise remove this line)
    pipe off

  endif
endmacro

!******************************************************************************!
! Main process message for this macro. Should be right after the ENDMACRO.
!******************************************************************************!
procedure processMessage m:msg
  if msg.name eqs "MAIN" then
    assert/text="^reg.main.name: User indicated tests" msg.data eqss "PASS"
    pipe stop
  endif
return

!******************************************************************************!
! If an unexpected exception is caught, mark test as failed, unless it is expected
!******************************************************************************!
procedure processException m:emsg
  if expectedException REXISTS then
    assert/text="^reg.main.name: Expected ERROR starts with: ^{expectedException}" expectedException EQSS emsg.data.message
    remove expectedException
  else
    assert/text="^reg.main.name: Caught unexpected exception ^{emsg.data}" "FALSE" isTrue
    if "Trace" SUBS ENV.DEBUG then invoke ,, emsg.data.printStackTrace()
  endif
return
