aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/geopoint/ViewportTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/cgeo/geocaching/geopoint/ViewportTest.java')
-rw-r--r--tests/src/cgeo/geocaching/geopoint/ViewportTest.java17
1 files changed, 5 insertions, 12 deletions
diff --git a/tests/src/cgeo/geocaching/geopoint/ViewportTest.java b/tests/src/cgeo/geocaching/geopoint/ViewportTest.java
index 60766b4..11f78ad 100644
--- a/tests/src/cgeo/geocaching/geopoint/ViewportTest.java
+++ b/tests/src/cgeo/geocaching/geopoint/ViewportTest.java
@@ -2,6 +2,8 @@ package cgeo.geocaching.geopoint;
import cgeo.geocaching.ICoordinates;
+import org.eclipse.jdt.annotation.NonNull;
+
import android.test.AndroidTestCase;
import java.util.Collections;
@@ -11,7 +13,8 @@ import java.util.Set;
public class ViewportTest extends AndroidTestCase {
- final private static Viewport vpRef = new Viewport(new Geopoint(-1.0, -2.0), new Geopoint(3.0, 4.0));
+ final private static @NonNull
+ 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);
@@ -49,7 +52,7 @@ public class ViewportTest extends AndroidTestCase {
public static void testInViewport() {
assertFalse(vpRef.contains(new Geopoint(-2.0, -2.0)));
assertFalse(vpRef.contains(new Geopoint(4.0, 4.0)));
- assertTrue(vpRef.contains(new Geopoint(0.0, 0.0)));
+ assertTrue(vpRef.contains(Geopoint.ZERO));
assertTrue(vpRef.contains(new Geopoint(-1.0, -2.0)));
assertTrue(vpRef.contains(new Geopoint(3.0, 4.0)));
}
@@ -86,16 +89,6 @@ public class ViewportTest extends AndroidTestCase {
assertFalse(vpRef.includes(vpRef.resize(2.0)));
}
- public static void testExpands() {
- assertEquals(vpRef, vpRef.expand(new Geopoint(0, 0)));
- final Viewport vp1 = vpRef.expand(new Geopoint(-4.0, 0.0));
- assertEquals(new Geopoint(-4.0, -2.0), vp1.bottomLeft);
- assertEquals(new Geopoint(3.0, 4.0), vp1.topRight);
- final Viewport vp2 = vpRef.expand(new Geopoint(-10.0, 10.0));
- assertEquals(new Geopoint(-10.0, -2.0), vp2.bottomLeft);
- assertEquals(new Geopoint(3.0, 10.0), vp2.topRight);
- }
-
public static void testContaining() {
assertNull(Viewport.containing(Collections.singleton((ICoordinates) null)));
final Set<Geopoint> points = new HashSet<Geopoint>();