diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-10-07 17:18:44 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-07 17:18:44 +0100 |
commit | 5d2436b504f3329a63d6005d2317faa0dfc2bb89 (patch) | |
tree | 027aa0c04c828aaf48589283953c96c4b9486d89 | |
parent | 3b809f2cd45746bebdc844adec11d157ae4deea1 (diff) | |
download | subsurface-5d2436b504f3329a63d6005d2317faa0dfc2bb89.tar.gz |
Add test for more GPS coordinates
We really should be able to parse the coordinates that we show in our own
HTML export as well as the standard Google format... both have a comma
between the latitude and longitude.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | tests/testgpscoords.cpp | 12 | ||||
-rw-r--r-- | tests/testgpscoords.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/testgpscoords.cpp b/tests/testgpscoords.cpp index c5a4d22a4..50bb4bcdb 100644 --- a/tests/testgpscoords.cpp +++ b/tests/testgpscoords.cpp @@ -101,6 +101,18 @@ void TestGpsCoords::testPrefixNoUnitParse() coord2double(48, 51.491), -coord2double(2, 17.677)); } +void TestGpsCoords::testOurWeb() +{ + testParseOK("12° 8' 0.24\" , -68° 16' 58.44\"", + coord2double(12, 8, 0.24 ), -coord2double(68, 16, 58.44)); +} + +void TestGpsCoords::testGoogle() +{ + testParseOK("12.133400, -68.282900", + coord2double(12, 8, 0.24 ), -coord2double(68, 16, 58.44)); +} + void TestGpsCoords::testParseOK(const QString &txt, double expectedLat, double expectedLon) { diff --git a/tests/testgpscoords.h b/tests/testgpscoords.h index 784bc302e..7815b7d31 100644 --- a/tests/testgpscoords.h +++ b/tests/testgpscoords.h @@ -22,6 +22,8 @@ private slots: void testNoUnitParse(); void testNegativeXmlFormatParse(); void testPrefixNoUnitParse(); + void testOurWeb(); + void testGoogle(); private: static void testParseOK(const QString &txt, double expectedLat, |