Changeset 6226 in josm for trunk/test


Ignore:
Timestamp:
2013-09-09T01:12:38+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #9057 - see #8987 - fix Coordinate.hashCode() broken in r6162

Location:
trunk/test/unit/org/openstreetmap/josm/data
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/coor/LatLonTest.java

    r4580 r6226  
    2121           };
    2222   
     23    /**
     24     * Test of {@link LatLon#roundToOsmPrecisionStrict}
     25     */
    2326    @Test
    24     public void roundingTests() {
     27    public void testRoundToOsmPrecisionStrict() {
    2528       
    2629        for (double value : sampleValues) {
     
    7477    }
    7578   
     79    /**
     80     * Test of {@link LatLon#toIntervalLon}
     81     */
    7682    @Test
    77     public void toIntervalLonTests() {
     83    public void testToIntervalLon() {
    7884        assertEquals(-180.0, LatLon.toIntervalLon(-180.0), 0);
    7985        assertEquals(0.0, LatLon.toIntervalLon(0.0), 0);
     
    95101        assertEquals(179.0, LatLon.toIntervalLon(-541.0), 0);
    96102    }
     103
     104    /**
     105     * Test of {@link LatLon#equals}
     106     */
     107    @Test
     108    public void testEquals() {
     109        for (int i = 1; i < sampleValues.length; i++) {
     110            LatLon a = new LatLon(sampleValues[i-1], sampleValues[i]);
     111            LatLon b = new LatLon(sampleValues[i-1], sampleValues[i]);
     112            assertEquals(a, b);
     113        }
     114    }
     115
     116    /**
     117     * Test of {@link LatLon#hashCode}
     118     */
     119    @Test
     120    public void testHashCode() {
     121        for (int i = 1; i < sampleValues.length; i++) {
     122            LatLon a = new LatLon(sampleValues[i-1], sampleValues[i]);
     123            LatLon b = new LatLon(sampleValues[i-1], sampleValues[i]);
     124            assertEquals(a.hashCode(), b.hashCode());
     125        }
     126    }
    97127}
Note: See TracChangeset for help on using the changeset viewer.