From 57983a04e198c76cf15f8e9bbf2debc0d07564b9 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Fri, 20 Apr 2012 15:57:37 +0200 Subject: Refactoring: do not get through an extra Geopoint when not required --- tests/src/cgeo/geocaching/cgeoApplicationTest.java | 10 +++++----- tests/src/cgeo/geocaching/geopoint/ViewportTest.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/src') diff --git a/tests/src/cgeo/geocaching/cgeoApplicationTest.java b/tests/src/cgeo/geocaching/cgeoApplicationTest.java index 4a1fcb0..30dba33 100644 --- a/tests/src/cgeo/geocaching/cgeoApplicationTest.java +++ b/tests/src/cgeo/geocaching/cgeoApplicationTest.java @@ -233,7 +233,7 @@ public class cgeoApplicationTest extends ApplicationTestCase { deleteCacheFromDB(mockedCache.getGeocode()); final String[] tokens = GCBase.getTokens(); - final Viewport viewport = new Viewport(mockedCache.getCoords(), 0.003, 0.003); + final Viewport viewport = new Viewport(mockedCache, 0.003, 0.003); // check coords for DETAILED Settings.setLiveMapStrategy(Strategy.DETAILED); @@ -248,7 +248,7 @@ public class cgeoApplicationTest extends ApplicationTestCase { // check update after switch strategy to FAST Settings.setLiveMapStrategy(Strategy.FAST); - GCBase.removeFromTileCache(mockedCache.getCoords()); + GCBase.removeFromTileCache(mockedCache); search = ConnectorFactory.searchByViewport(viewport, tokens); assertNotNull(search); @@ -283,9 +283,9 @@ public class cgeoApplicationTest extends ApplicationTestCase { // non premium cache MockedCache cache = new GC2CJPF(); deleteCacheFromDBAndLogout(cache.getGeocode()); - GCBase.removeFromTileCache(cache.getCoords()); + GCBase.removeFromTileCache(cache); - Viewport viewport = new Viewport(cache.getCoords(), 0.003, 0.003); + Viewport viewport = new Viewport(cache, 0.003, 0.003); SearchResult search = ConnectorFactory.searchByViewport(viewport, tokens); assertNotNull(search); @@ -302,7 +302,7 @@ public class cgeoApplicationTest extends ApplicationTestCase { cache = new GC2JVEH(); deleteCacheFromDBAndLogout(cache.getGeocode()); - viewport = new Viewport(cache.getCoords(), 0.003, 0.003); + viewport = new Viewport(cache, 0.003, 0.003); search = ConnectorFactory.searchByViewport(viewport, tokens); assertNotNull(search); diff --git a/tests/src/cgeo/geocaching/geopoint/ViewportTest.java b/tests/src/cgeo/geocaching/geopoint/ViewportTest.java index 3ba98de..ac32468 100644 --- a/tests/src/cgeo/geocaching/geopoint/ViewportTest.java +++ b/tests/src/cgeo/geocaching/geopoint/ViewportTest.java @@ -10,7 +10,7 @@ import java.util.Set; public class ViewportTest extends AndroidTestCase { - final private static Viewport vpRef = new Viewport(new Geopoint(-1.0, 3.0), new Geopoint(-2.0, 4.0)); + final private static Viewport vpRef = new Viewport(new Geopoint(-1.0, -2.0), new Geopoint(3.0, 4.0)); public static void assertBounds(final Viewport vp) { assertEquals(new Geopoint(1.0, 1.0), vp.center); -- cgit v1.1