aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-04-20 15:57:37 +0200
committerSamuel Tardieu <sam@rfc1149.net>2012-04-20 16:08:20 +0200
commit57983a04e198c76cf15f8e9bbf2debc0d07564b9 (patch)
tree792057b8b213a82dfe1035fb3820c43c5529ba1b /tests/src
parent70b01595e9f054bceb0d28d3ada958d375c7618b (diff)
downloadcgeo-57983a04e198c76cf15f8e9bbf2debc0d07564b9.zip
cgeo-57983a04e198c76cf15f8e9bbf2debc0d07564b9.tar.gz
cgeo-57983a04e198c76cf15f8e9bbf2debc0d07564b9.tar.bz2
Refactoring: do not get through an extra Geopoint when not required
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/cgeo/geocaching/cgeoApplicationTest.java10
-rw-r--r--tests/src/cgeo/geocaching/geopoint/ViewportTest.java2
2 files changed, 6 insertions, 6 deletions
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<cgeoapplication> {
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<cgeoapplication> {
// 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<cgeoapplication> {
// 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<cgeoapplication> {
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);