From 4557b4daaff73274b11c7b153c248f2308737a26 Mon Sep 17 00:00:00 2001
From: Robert Scott <code@humanleg.org.uk>
Date: Thu, 18 Jan 2018 00:27:18 +0000
Subject: [PATCH v1] still with the debugging test commits

---
 src/org/openstreetmap/josm/gui/MapViewState.java           |  9 +++++++++
 .../openstreetmap/josm/gui/dialogs/MinimapDialogTest.java  | 14 ++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/src/org/openstreetmap/josm/gui/MapViewState.java b/src/org/openstreetmap/josm/gui/MapViewState.java
index 0c80dadea..0e1d0444e 100644
--- a/src/org/openstreetmap/josm/gui/MapViewState.java
+++ b/src/org/openstreetmap/josm/gui/MapViewState.java
@@ -158,6 +158,15 @@ public final class MapViewState implements Serializable {
         }
     }
 
+    @Override
+    public String toString() {
+        return getClass().getName() + " [projecting=" + this.projecting
+            + " viewWidth=" + this.viewWidth
+            + " viewHeight=" + this.viewHeight
+            + " scale=" + this.scale
+            + " topLeft=" + this.topLeft + "]";
+    }
+
     /**
      * The scale in east/north units per pixel.
      * @return The scale.
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
index cc22a6da0..559bc9f4b 100644
--- a/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
+++ b/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
@@ -433,16 +433,22 @@ public class MinimapDialogTest {
             mapView.addNotify();
             mapView.doLayout();
             mapView.setBounds(0, 0, 500, 500);
+            System.err.println("MapView bounds 1: " + mapView.getBounds());
         });
+        System.err.println("MapView bounds 2: " + mapView.getBounds());
 
         this.setUpMiniMap();
 
+        System.err.println("MapView bounds 3: " + mapView.getBounds());
+
         // assert "show downloaded areas" checkbox is unchecked
         assertFalse(this.getShowDownloadedAreaMenuItem().isSelected());
 
         // we won't end up with exactly this viewport as it doesn't *precisely* match the aspect ratio
         mapView.zoomTo(new Bounds(51.732, -0.0269, 51.753, 0.0102));
 
+        System.err.println("MapView bounds 4: " + mapView.getBounds());
+
         // an initial paint operation is required to trigger the tile fetches
         this.paintSlippyMap();
 
@@ -478,9 +484,17 @@ public class MinimapDialogTest {
         GuiHelper.runInEDTAndWaitWithException(() -> this.getShowDownloadedAreaMenuItem().doClick());
         assertTrue(this.getShowDownloadedAreaMenuItem().isSelected());
 
+        System.err.println("MapView bounds 5: " + mapView.getBounds());
+
         // assert downloaded areas are drawn
         this.paintSlippyMap();
 
+        System.err.println("Reported bbox: " + MainApplication.getMap().mapView.getState().getViewArea().getLatLonBoundsBox().toString());
+
+        System.err.println("Reported MapViewState: " + MainApplication.getMap().mapView.getState());
+
+        System.err.println("Reported slippyMap bounding box: " + this.slippyMap.getBoundingBox());
+
         ImagePatternMatching.rowMatch(
             paintedSlippyMap,
             paintedSlippyMap.getHeight()/2,
-- 
2.11.0

