aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/cgeo/geocaching/geopoint/GeopointTest.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/src/cgeo/geocaching/geopoint/GeopointTest.java b/tests/src/cgeo/geocaching/geopoint/GeopointTest.java
index e64028f..9e65a02 100644
--- a/tests/src/cgeo/geocaching/geopoint/GeopointTest.java
+++ b/tests/src/cgeo/geocaching/geopoint/GeopointTest.java
@@ -1,10 +1,11 @@
package cgeo.geocaching.geopoint;
-import junit.framework.Assert;
-
+import android.os.Build;
import android.os.Bundle;
import android.test.AndroidTestCase;
+import junit.framework.Assert;
+
public class GeopointTest extends AndroidTestCase {
public static void testCreation() {
@@ -49,7 +50,15 @@ public class GeopointTest extends AndroidTestCase {
final Geopoint gp2 = new Geopoint(-30.1, -2.3);
final float d12 = gp1.distanceTo(gp2);
- Assert.assertEquals(110.967995, d12, 1e-6);
+
+ // broken distance calculation in 4.2.1
+ if (Build.VERSION.SDK_INT == 17) {
+ Assert.assertEquals(110.83107, d12, 1e-6);
+ }
+ else {
+ Assert.assertEquals(110.967995, d12, 1e-6);
+ }
+
Assert.assertEquals(d12, gp2.distanceTo(gp1), 1e-6);
// Bearing in both directions cannot be added, as this is