Changeset 9726 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-02-03T20:57:12+01:00 (9 years ago)
Author:
simon04
Message:

see #12485 - Wrong GPX Correlation, add unit test

Regression from r9383, confusion between s and ms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java

    r9669 r9726  
    55
    66import java.util.Arrays;
     7import java.util.Collections;
    78import java.util.TimeZone;
    89
     
    1213import org.openstreetmap.josm.data.gpx.GpxData;
    1314import org.openstreetmap.josm.io.GpxReaderTest;
     15import org.openstreetmap.josm.tools.Pair;
    1416import org.openstreetmap.josm.tools.date.DateUtils;
    1517import org.openstreetmap.josm.tools.date.DateUtilsTest;
     
    5961                i2.getPos()); // interpolated
    6062    }
     63
     64    /**
     65     * Tests automatic guessing of timezone/offset
     66     * @throws Exception if an error occurs
     67     */
     68    @Test
     69    public void testAutoGuess() throws Exception {
     70        final GpxData gpx = GpxReaderTest.parseGpxData("data_nodist/2094047.gpx");
     71        final ImageEntry i0 = new ImageEntry();
     72        i0.setExifTime(DateUtils.fromString("2016:01:03 11:59:54")); // 4 sec before start of GPX
     73        i0.createTmp();
     74        assertEquals(Pair.create(0.0, -4L), CorrelateGpxWithImages.autoGuess(Collections.singletonList(i0), gpx));
     75    }
    6176}
Note: See TracChangeset for help on using the changeset viewer.