Ignore:
Timestamp:
2014-05-06T01:24:41+02:00 (9 years ago)
Author:
Don-vip
Message:

test cleanup

File:
1 edited

Legend:

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

    r6226 r7068  
    66import org.junit.Test;
    77
    8 /**
    9  * @author Vincent
    10  *
    11  */
    128public class LatLonTest {
    139
    14     protected static final double[] sampleValues = new double[]{
     10    public static final double[] SAMPLE_VALUES = new double[]{
    1511            -180.0, -179.9, -179.6, -179.5, -179.4, -179.1, -179.0, -100.0, -99.9, -10.0, -9.9, -1.0, -0.1,
    1612            180.0,  179.9,  179.6,  179.5,  179.4,  179.1,  179.0,  100.0,  99.9,  10.0,  9.9,  1.0,  0.1,
     
    2016            100.12, 100.123, 100.1234, 100.12345, 100.123456, 100.1234567
    2117           };
    22    
     18
    2319    /**
    2420     * Test of {@link LatLon#roundToOsmPrecisionStrict}
     
    2622    @Test
    2723    public void testRoundToOsmPrecisionStrict() {
    28        
    29         for (double value : sampleValues) {
     24
     25        for (double value : SAMPLE_VALUES) {
    3026            assertEquals(LatLon.roundToOsmPrecisionStrict(value), value, 0);
    3127        }
    32        
     28
    3329        assertEquals(LatLon.roundToOsmPrecisionStrict(0.0), 0.0, 0);
    3430        assertEquals(LatLon.roundToOsmPrecisionStrict(-0.0), 0.0, 0);
    35        
     31
    3632        assertEquals(LatLon.roundToOsmPrecisionStrict(0.12345678),  0.1234568, 0);
    3733        assertEquals(LatLon.roundToOsmPrecisionStrict(0.123456789), 0.1234568, 0);
     
    7672        assertEquals(LatLon.roundToOsmPrecisionStrict(99.9999999),  99.9999999, 0);
    7773    }
    78    
     74
    7975    /**
    8076     * Test of {@link LatLon#toIntervalLon}
     
    107103    @Test
    108104    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]);
     105        for (int i = 1; i < SAMPLE_VALUES.length; i++) {
     106            LatLon a = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
     107            LatLon b = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
    112108            assertEquals(a, b);
    113109        }
     
    119115    @Test
    120116    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]);
     117        for (int i = 1; i < SAMPLE_VALUES.length; i++) {
     118            LatLon a = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
     119            LatLon b = new LatLon(SAMPLE_VALUES[i-1], SAMPLE_VALUES[i]);
    124120            assertEquals(a.hashCode(), b.hashCode());
    125121        }
Note: See TracChangeset for help on using the changeset viewer.