Changeset 9727 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r9726 r9727 1318 1318 } 1319 1319 1320 privatestatic String formatTimezone(double timezone) {1320 static String formatTimezone(double timezone) { 1321 1321 StringBuilder ret = new StringBuilder(); 1322 1322 … … 1337 1337 } 1338 1338 1339 privatestatic double parseTimezone(String timezone) throws ParseException {1339 static double parseTimezone(String timezone) throws ParseException { 1340 1340 1341 1341 if (timezone.isEmpty()) … … 1408 1408 } 1409 1409 1410 privatestatic long parseOffset(String offset) throws ParseException {1410 static long parseOffset(String offset) throws ParseException { 1411 1411 String error = tr("Error while parsing offset.\nExpected format: {0}", "number"); 1412 1412 -
trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java
r9726 r9727 4 4 import static org.junit.Assert.assertEquals; 5 5 6 import java.text.ParseException; 6 7 import java.util.Arrays; 7 8 import java.util.Collections; … … 74 75 assertEquals(Pair.create(0.0, -4L), CorrelateGpxWithImages.autoGuess(Collections.singletonList(i0), gpx)); 75 76 } 77 78 @Test 79 public void testFormatTimezone() throws Exception { 80 assertEquals("+1:00", CorrelateGpxWithImages.formatTimezone(1)); 81 assertEquals("+6:30", CorrelateGpxWithImages.formatTimezone(6.5)); 82 assertEquals("-6:30", CorrelateGpxWithImages.formatTimezone(-6.5)); 83 assertEquals("+3:08", CorrelateGpxWithImages.formatTimezone(Math.PI)); 84 assertEquals("+2:43", CorrelateGpxWithImages.formatTimezone(Math.E)); 85 } 86 87 @Test 88 public void testParseTimezone() throws ParseException { 89 assertEquals(1, CorrelateGpxWithImages.parseTimezone("+01:00"), 1e-3); 90 assertEquals(1, CorrelateGpxWithImages.parseTimezone("+1:00"), 1e-3); 91 assertEquals(1.5, CorrelateGpxWithImages.parseTimezone("+01:30"), 1e-3); 92 assertEquals(11.5, CorrelateGpxWithImages.parseTimezone("+11:30"), 1e-3); 93 } 94 95 @Test 96 public void testParseOffest() throws ParseException { 97 assertEquals(0, CorrelateGpxWithImages.parseOffset("0")); 98 assertEquals(4242L, CorrelateGpxWithImages.parseOffset("4242")); 99 assertEquals(-4242L, CorrelateGpxWithImages.parseOffset("-4242")); 100 assertEquals(0L, CorrelateGpxWithImages.parseOffset("-0")); 101 } 76 102 }
Note:
See TracChangeset
for help on using the changeset viewer.