diff options
Diffstat (limited to 'tests/src/cgeo/geocaching/cgBaseTest.java')
| -rw-r--r-- | tests/src/cgeo/geocaching/cgBaseTest.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/src/cgeo/geocaching/cgBaseTest.java b/tests/src/cgeo/geocaching/cgBaseTest.java index 311cb7a..06654ff 100644 --- a/tests/src/cgeo/geocaching/cgBaseTest.java +++ b/tests/src/cgeo/geocaching/cgBaseTest.java @@ -1,5 +1,6 @@ package cgeo.geocaching; +import cgeo.geocaching.enumerations.LoadFlags; import cgeo.geocaching.enumerations.LogType; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.test.RegExPerformanceTest; @@ -33,6 +34,7 @@ public class cgBaseTest extends AndroidTestCase { Assert.assertEquals(125.663703918457, cgBase.getElevation(new Geopoint(48.0, 2.0)), 0.1); } + @SuppressWarnings("unused") public static void testCompareCaches(ICache expected, cgCache actual) { Assert.assertEquals(expected.getGeocode(), actual.getGeocode()); Assert.assertTrue(expected.getType() == actual.getType()); @@ -72,7 +74,7 @@ public class cgBaseTest extends AndroidTestCase { int actualInventorySize = null != actual.getInventory() ? actual.getInventory().size() : 0; int expectedInventorySize = null != expected.getInventory() ? expected.getInventory().size() : 0; - // don't check inventory, it's to volatile + // the inventory can differ to often. // Assert.assertEquals(expectedInventorySize, actualInventorySize); int actualSpoilersSize = null != actual.getSpoilers() ? actual.getSpoilers().size() : 0; @@ -90,8 +92,8 @@ public class cgBaseTest extends AndroidTestCase { for (MockedCache mockedCache : RegExPerformanceTest.MOCKED_CACHES) { // to get the same results we have to use the date format used when the mocked data was created Settings.setGcCustomDate(mockedCache.getDateFormat()); - ParseResult parseResult = cgBase.parseCacheFromText(mockedCache.getData(), 0, null); - cgCache parsedCache = cgBase.getFirstElementFromSet(parseResult.cacheList); + SearchResult searchResult = cgBase.parseCacheFromText(mockedCache.getData(), 0, null); + cgCache parsedCache = searchResult.getFirstCacheFromResult(LoadFlags.LOADCACHEORDB); cgBaseTest.testCompareCaches(mockedCache, parsedCache); } Settings.setGcCustomDate(gcCustomDate); @@ -159,7 +161,7 @@ public class cgBaseTest extends AndroidTestCase { final MockedCache mockedCache = RegExPerformanceTest.MOCKED_CACHES.get(index); // to get the same results we have to use the date format used when the mocked data was created Settings.setGcCustomDate(mockedCache.getDateFormat()); - final ParseResult parseResult = cgBase.parseCacheFromText(mockedCache.getData(), 0, null); - return cgBase.getFirstElementFromSet(parseResult.cacheList); + final SearchResult searchResult = cgBase.parseCacheFromText(mockedCache.getData(), 0, null); + return searchResult.getFirstCacheFromResult(LoadFlags.LOADCACHEORDB); } }
\ No newline at end of file |
