From 1481041c869097eab7899e3f898fce6e9212c1bb Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Tue, 27 Jan 2015 00:20:29 +0100 Subject: fix #4620: wrong location when on home coordinates --- tests/src/cgeo/geocaching/location/GeoPointParserTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/src/cgeo/geocaching/location/GeoPointParserTest.java b/tests/src/cgeo/geocaching/location/GeoPointParserTest.java index e9e002d..a2b916d 100644 --- a/tests/src/cgeo/geocaching/location/GeoPointParserTest.java +++ b/tests/src/cgeo/geocaching/location/GeoPointParserTest.java @@ -2,8 +2,6 @@ package cgeo.geocaching.location; import static org.assertj.core.api.Assertions.assertThat; -import cgeo.geocaching.location.Geopoint; -import cgeo.geocaching.location.GeopointParser; import cgeo.geocaching.utils.Formatter; import android.test.AndroidTestCase; @@ -43,6 +41,12 @@ public class GeoPointParserTest extends AndroidTestCase { assertThat(point).isNull(); } + public static void testCoordinateMissingDegree() { + // Some home coordinates on geocaching.com lack the degree part. + final Geopoint point = GeopointParser.parse("N 51° 23.123' W ° 17.123"); + assertThat(point).isEqualTo(new Geopoint("N", "51", "23", "123", "W", "0", "17", "123")); + } + public static void testSouth() { assertEquals(-refLatitude, GeopointParser.parseLatitude("S 49° 56.031"), 1e-8); } -- cgit v1.1