aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/test
diff options
context:
space:
mode:
authorStephan Merker <merker.stephan@googlemail.com>2011-09-25 14:24:24 +0200
committerStephan Merker <merker.stephan@googlemail.com>2011-09-25 14:24:24 +0200
commit82e7186ec1215c4c61600f2aabec2b497a9c7e44 (patch)
tree4596afcd1e468161d3bceee88a38315426d6a1d3 /tests/src/cgeo/geocaching/test
parent438a697275a1fa6023088f77d599fc74742cb690 (diff)
downloadcgeo-82e7186ec1215c4c61600f2aabec2b497a9c7e44.zip
cgeo-82e7186ec1215c4c61600f2aabec2b497a9c7e44.tar.gz
cgeo-82e7186ec1215c4c61600f2aabec2b497a9c7e44.tar.bz2
map waypoint type pocket query waypoints file to WaypointType
... so that proper icons are shown for waypoints
Diffstat (limited to 'tests/src/cgeo/geocaching/test')
-rw-r--r--tests/src/cgeo/geocaching/test/GPXParserTest.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/src/cgeo/geocaching/test/GPXParserTest.java b/tests/src/cgeo/geocaching/test/GPXParserTest.java
index d596d5c..c539e9c 100644
--- a/tests/src/cgeo/geocaching/test/GPXParserTest.java
+++ b/tests/src/cgeo/geocaching/test/GPXParserTest.java
@@ -6,7 +6,9 @@ import cgeo.geocaching.cgSearch;
import cgeo.geocaching.cgWaypoint;
import cgeo.geocaching.cgeoapplication;
import cgeo.geocaching.enumerations.CacheSize;
+import cgeo.geocaching.enumerations.WaypointType;
import cgeo.geocaching.files.GPX10Parser;
+import cgeo.geocaching.files.GPXParser;
import cgeo.geocaching.geopoint.Geopoint;
import android.content.res.Resources;
@@ -112,6 +114,17 @@ public class GPXParserTest extends InstrumentationTestCase {
assertEquals(0, caches.size());
}
+ public void testConvertWaypointSym2Type() {
+ assertEquals(WaypointType.WAYPOINT, GPXParser.convertWaypointSym2Type("unknown sym"));
+
+ assertEquals(WaypointType.PKG, GPXParser.convertWaypointSym2Type("parking area"));
+ assertEquals(WaypointType.STAGE, GPXParser.convertWaypointSym2Type("stages of a multicache"));
+ assertEquals(WaypointType.PUZZLE, GPXParser.convertWaypointSym2Type("question to answer"));
+ assertEquals(WaypointType.TRAILHEAD, GPXParser.convertWaypointSym2Type("trailhead"));
+ assertEquals(WaypointType.FLAG, GPXParser.convertWaypointSym2Type("final location"));
+ assertEquals(WaypointType.WAYPOINT, GPXParser.convertWaypointSym2Type("reference point"));
+ }
+
private void assertGc31j2h(final cgCache cache) throws ParseException {
assertEquals("GC31J2H", cache.getGeocode());
assertEquals("Hockenheimer City-Brunnen", cache.getName());
@@ -153,7 +166,7 @@ public class GPXParserTest extends InstrumentationTestCase {
assertEquals("---", wp.lookup);
assertEquals("Parkplatz", wp.name);
assertEquals("Kostenfreies Parken (je nach Parkreihe Parkscheibe erforderlich)", wp.note);
- assertEquals("parking area", wp.type);
+ assertEquals(WaypointType.PKG.id, wp.type);
assertEquals(49.317517, wp.coords.getLatitude(), 0.000001);
assertEquals(8.545083, wp.coords.getLongitude(), 0.000001);
assertEquals("N 49° 19.051", wp.latitudeString);
@@ -165,7 +178,7 @@ public class GPXParserTest extends InstrumentationTestCase {
assertEquals("---", wp.lookup);
assertEquals("Station 1", wp.name);
assertEquals("Ein zweiter Wegpunkt, der nicht wirklich existiert sondern nur zum Testen gedacht ist.", wp.note);
- assertEquals("stages of a multicache", wp.type);
+ assertEquals(WaypointType.STAGE.id, wp.type);
assertEquals(49.317500, wp.coords.getLatitude(), 0.000001);
assertEquals(8.545100, wp.coords.getLongitude(), 0.000001);
}