! Tests that there is not an outOfMemory error when zooming on Ellipses
!
! Issue: NXM-3394 outOfMemory: when zooming in on a small area of an ellipse
! Since: NextMidas 3.9.1
!
! Author: Kevin Esterheld
!
startmacro

  switch INTERACTIVE   interAct     GET DEF=TRUE  SDEF=TRUE
  switch BASELINE      baseline     GET DEF=FALSE SDEF=TRUE

  if interAct then
    set instructions "Click the 'ZOOM' button and it will zoom in at a very high precision &
                      location. There should not be the following exception: &
                      java.lang.OutOfMemoryError: Java heap space. \n\nIf there is no &
                      exception, pass this test."
    pipe init
      panel/msgid=MAIN/setup/controls=gc
      plot/id=idplot/mousewheelzoom/usemouseposition/READOUT="+OnAxis" ^{datDir}world|^{datDir}ellipse5000

      gcontrol label  macro   "MACRO"
      gcontrol menu main "Exit with Status = " "PASS,FAIL" /tleft
      set gc.main.itemColors {PASS=GREEN,FAIL=RED}
      gcontrol text idtext "Instructions" "^instructions" 24 16 /title
      gcontrol button zoom "" "ZOOM"
    pipe off
  endif

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
  elseif msg.name eqs "ZOOM"  then
    message sendw id=idplot name=ZOOM data={xmin=44.37800400002,xmax=44.37800400003,ymin=395.425750e-3,ymax=395.420675e-3}
    invoke reg.idplot.zoomInAtPoint(44.378004000001,.39542411111,.7)
    invoke reg.idplot.zoomInAtPoint(44.37800455555555,.39542411111,.9)
    invoke reg.idplot.zoomInAtPoint(44.37800455555555,.39542411111,.2)
  else
    say "Unhandled message name=^msg.name info=^msg.info fid=^msg.fid data=^msg.data"
  endif

return