Changeset 10052 in josm


Ignore:
Timestamp:
2016-03-26T22:12:43+01:00 (22 months ago)
Author:
Don-vip
Message:

see #11924 - reduce double precision in unit tests to avoid tiny differences with JDK9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java

    r9958 r10052  
    4444        final DataSet ds = performTest("name=ClosedWay");
    4545        final Way way = ds.getSelectedWays().iterator().next();
    46         assertEquals(new LatLon(8.538808176881814, 55.72978898396922), way.getNode(0).getCoor());
    47         assertEquals(new LatLon(8.539618224318104, 55.73039799489563), way.getNode(1).getCoor());
    48         assertEquals(new LatLon(8.538993302766201, 55.73124794515577), way.getNode(2).getCoor());
    49         assertEquals(new LatLon(8.538183254003354, 55.730638934229376), way.getNode(3).getCoor());
     46        assertEquals(new LatLon(8.5388082, 55.7297890), way.getNode(0).getCoor().getRoundedToOsmPrecision());
     47        assertEquals(new LatLon(8.5396182, 55.7303980), way.getNode(1).getCoor().getRoundedToOsmPrecision());
     48        assertEquals(new LatLon(8.5389933, 55.7312479), way.getNode(2).getCoor().getRoundedToOsmPrecision());
     49        assertEquals(new LatLon(8.5381833, 55.7306389), way.getNode(3).getCoor().getRoundedToOsmPrecision());
    5050        verifyRectangleClockwise(way);
    5151    }
     
    6565        final DataSet ds = performTest("name=ClosedWayWithReferenceNodes");
    6666        final Way way = ds.getSelectedWays().iterator().next();
    67         assertEquals(new LatLon(8.534711427, 55.73000670312), way.getNode(0).getCoor());
    68         assertEquals(new LatLon(8.53547720918594, 55.73067141759374), way.getNode(1).getCoor());
    69         assertEquals(new LatLon(8.534835495633061, 55.73142735279376), way.getNode(2).getCoor());
    70         assertEquals(new LatLon(8.53406971216, 55.73076263832), way.getNode(3).getCoor());
     67        assertEquals(new LatLon(8.5347114, 55.7300067), way.getNode(0).getCoor().getRoundedToOsmPrecision());
     68        assertEquals(new LatLon(8.5354772, 55.7306714), way.getNode(1).getCoor().getRoundedToOsmPrecision());
     69        assertEquals(new LatLon(8.5348355, 55.7314274), way.getNode(2).getCoor().getRoundedToOsmPrecision());
     70        assertEquals(new LatLon(8.5340697, 55.7307626), way.getNode(3).getCoor().getRoundedToOsmPrecision());
    7171        verifyRectangleClockwise(way);
    7272    }
     
    7777                "name=NodeToRectify-01", "name=NodeToRectify-02", "name=NodeToRectify-03", "name=NodeToRectify-04");
    7878        final List<Node> nodes = new ArrayList<>(ds.getSelectedNodes());
    79         assertEquals(new LatLon(8.532735415272217, 55.72986948949525), nodes.get(0).getCoor());
    80         assertEquals(new LatLon(8.533520827858515, 55.73043325105434), nodes.get(1).getCoor());
    81         assertEquals(new LatLon(8.532914283300173, 55.73129729115582), nodes.get(2).getCoor());
    82         assertEquals(new LatLon(8.532055019939826, 55.73068052126457), nodes.get(3).getCoor());
     79        assertEquals(new LatLon(8.5327354, 55.7298695), nodes.get(0).getCoor().getRoundedToOsmPrecision());
     80        assertEquals(new LatLon(8.5335208, 55.7304333), nodes.get(1).getCoor().getRoundedToOsmPrecision());
     81        assertEquals(new LatLon(8.5329143, 55.7312973), nodes.get(2).getCoor().getRoundedToOsmPrecision());
     82        assertEquals(new LatLon(8.5320550, 55.7306805), nodes.get(3).getCoor().getRoundedToOsmPrecision());
    8383    }
    8484
Note: See TracChangeset for help on using the changeset viewer.