diff options
Diffstat (limited to 'tests/src/cgeo')
-rw-r--r-- | tests/src/cgeo/geocaching/geopoint/GeopointTest.java | 8 | ||||
-rw-r--r-- | tests/src/cgeo/geocaching/geopoint/UnitsTest.java | 33 |
2 files changed, 2 insertions, 39 deletions
diff --git a/tests/src/cgeo/geocaching/geopoint/GeopointTest.java b/tests/src/cgeo/geocaching/geopoint/GeopointTest.java index 8aaeef8..e64028f 100644 --- a/tests/src/cgeo/geocaching/geopoint/GeopointTest.java +++ b/tests/src/cgeo/geocaching/geopoint/GeopointTest.java @@ -1,10 +1,10 @@ package cgeo.geocaching.geopoint; +import junit.framework.Assert; + import android.os.Bundle; import android.test.AndroidTestCase; -import junit.framework.Assert; - public class GeopointTest extends AndroidTestCase { public static void testCreation() { @@ -230,10 +230,6 @@ public class GeopointTest extends AndroidTestCase { Assert.assertEquals(lonSecFrac, gp.getLonSecFrac()); } - public static void testElevation() { - assertEquals(125.663703918457, (new Geopoint(48.0, 2.0)).getElevation(), 0.1); - } - private static void assertParseException(Runnable runnable) { try { runnable.run(); diff --git a/tests/src/cgeo/geocaching/geopoint/UnitsTest.java b/tests/src/cgeo/geocaching/geopoint/UnitsTest.java index 3b7331c..52c5adf 100644 --- a/tests/src/cgeo/geocaching/geopoint/UnitsTest.java +++ b/tests/src/cgeo/geocaching/geopoint/UnitsTest.java @@ -42,39 +42,6 @@ public class UnitsTest extends CGeoTestCase { // Make method non-static so that Settings is initialized @SuppressWarnings("static-method") - public void testElevation() { - final boolean savedImperial = Settings.isUseImperialUnits(); - try { - TestSettings.setUseImperialUnits(false); - assertElevation("↥ 123 m", 122.782f); - assertElevation("↥ 123 m", 123.456f); - assertElevation("↥ 12 m", 12.3456f); - assertElevation("↥ 1 m", 1.23456f); - assertElevation("↥ 2 m", 1.6f); - assertElevation("↥ 0 m", 0.123456f); - assertElevation("↧ 123 m", -122.782f); - assertElevation("↧ 123 m", -123.456f); - assertElevation("↧ 12 m", -12.3456f); - assertElevation("↧ 1 m", -1.23456f); - assertElevation("↧ 2 m", -1.6f); - assertElevation("↧ 0 m", -0.123456f); - TestSettings.setUseImperialUnits(true); - assertElevation("↥ 405 ft", 123.456f); - assertElevation("↥ 41 ft", 12.3456f); - } finally { - TestSettings.setUseImperialUnits(savedImperial); - } - } - - private static void assertElevation(final String expected, final float meters) { - final String actual = Units.getElevation(meters); - if (!StringUtils.equals(expected, actual.replace(',', '.'))) { - fail("elevation " + actual + " does not match expected " + expected); - } - } - - // Make method non-static so that Settings is initialized - @SuppressWarnings("static-method") public void testSpeed() { assertEquals("?", Units.getDistanceFromKilometers(null)); final boolean savedImperial = Settings.isUseImperialUnits(); |