Changeset 11838 in josm for trunk/test


Ignore:
Timestamp:
2017-04-04T16:50:06+02:00 (8 years ago)
Author:
bastiK
Message:

see #7427 - fix unit tests

Location:
trunk/test
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java

    r11324 r11838  
    112112        component.zoomTo(new LatLon(10, 10));
    113113        Point2D shouldBeCenter = component.getPoint2D(new LatLon(10, 10));
    114         assertThat(shouldBeCenter, CustomMatchers.is(new Point2D.Double(WIDTH / 2, HEIGHT / 2)));
     114        // center may move 0.5 pixels for alignment, see {@link NavigatableComponent#zoomTo(EastNorth, double, boolean)}
     115        assertEquals(shouldBeCenter.getX(), WIDTH / 2., 0.5);
     116        assertEquals(shouldBeCenter.getY(), HEIGHT / 2., 0.5);
    115117    }
    116118
     
    126128        component.zoomToFactor(0.5);
    127129        assertEquals(initialScale / 2, component.getScale(), 0.00000001);
    128         assertEquals(center, component.getCenter());
     130        assertThat(component.getCenter(), CustomMatchers.is(center));
    129131        component.zoomToFactor(2);
    130132        assertEquals(initialScale, component.getScale(), 0.00000001);
    131         assertEquals(center, component.getCenter());
     133        assertThat(component.getCenter(), CustomMatchers.is(center));
    132134
    133135        // zoomToFactor(EastNorth, double)
Note: See TracChangeset for help on using the changeset viewer.