Skip to content

Commit

Permalink
locus Updates
Browse files Browse the repository at this point in the history
Add mappings for
- CacheType.ADVLAB
- WaypointType.GENERATED

Add tests
  • Loading branch information
bekuno committed Sep 2, 2023
1 parent 71e541e commit c058090
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 8 additions & 7 deletions main/src/main/java/cgeo/geocaching/apps/AbstractLocusApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,18 @@ static int toLocusType(final CacheType ct) {
return GeocachingData.CACHE_TYPE_GC_HQ_BLOCK_PARTY;
case LOCATIONLESS:
return GeocachingData.CACHE_TYPE_LOCATIONLESS;
// Benchmark, not published over API from Locus (state: locus-api-android:0.9.21)
case ADVLAB:
return GeocachingData.CACHE_TYPE_LAB_CACHE;
// Benchmark, not c:geo cache type - removed from geocaching.com
// case BENCHMARK:
// return GeocachingData.CACHE_TYPE_BENCHMARK;
// Maze Exhibit, not published over API from Locus (state: locus-api-android:0.9.21)
// Maze Exhibit, not supported c:geo cache type
// case MAZE_EXHIBIT:
// return GeocachingData.CACHE_TYPE_MAZE_EXHIBIT;
// Waymark, not published over API from Locus (state: locus-api-android:0.9.21)
// Waymark, not supported c:geo cache type
// case WAYMARK:
// return GeocachingData.CACHE_TYPE_WAYMARK;
// Lab cache, not published over API from Locus (state: locus-api-android:0.9.21)
// case LAB_CACHE:
// return GeocachingData.CACHE_TYPE_LAB_CACHE;
// special map types to CACHE_TYPE_UNDEFINED
// special types are mapped to CACHE_TYPE_UNDEFINED
case USER_DEFINED:
case UNKNOWN:
case ALL:
Expand Down Expand Up @@ -378,6 +377,8 @@ static String toLocusWaypoint(final WaypointType wt) {
return GeocachingWaypoint.CACHE_WAYPOINT_TYPE_REFERENCE;
case ORIGINAL:
return GeocachingWaypoint.CACHE_WAYPOINT_TYPE_REFERENCE;
case GENERATED:
return GeocachingWaypoint.CACHE_WAYPOINT_TYPE_REFERENCE;
}
// unknown waypoint type
return GeocachingWaypoint.CACHE_WAYPOINT_TYPE_REFERENCE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public void testToLocusTypeOk() {
final HashMap<CacheType, Integer> testTypeList = new HashMap<>();
testTypeList.put(CacheType.TRADITIONAL, GeocachingData.CACHE_TYPE_TRADITIONAL);
testTypeList.put(CacheType.VIRTUAL, GeocachingData.CACHE_TYPE_VIRTUAL);
testTypeList.put(CacheType.ADVLAB, GeocachingData.CACHE_TYPE_LAB_CACHE);
testTypeList.put(CacheType.USER_DEFINED, GeocachingData.CACHE_TYPE_UNDEFINED);
testTypeList.put(CacheType.UNKNOWN, GeocachingData.CACHE_TYPE_UNDEFINED);

Expand Down Expand Up @@ -77,6 +78,7 @@ public void testToLocusWaypointOk() {
final HashMap<WaypointType, String> testWaypointList = new HashMap<>();
testWaypointList.put(WaypointType.FINAL, GeocachingWaypoint.CACHE_WAYPOINT_TYPE_FINAL);
testWaypointList.put(WaypointType.ORIGINAL, GeocachingWaypoint.CACHE_WAYPOINT_TYPE_REFERENCE);
testWaypointList.put(WaypointType.GENERATED, GeocachingWaypoint.CACHE_WAYPOINT_TYPE_REFERENCE);

final ArrayList<WaypointType> testCgeoWpts = new ArrayList<>(testWaypointList.keySet());
final ArrayList<String> testLoWapts = new ArrayList<>(testWaypointList.values());
Expand Down

0 comments on commit c058090

Please sign in to comment.