diff options
Diffstat (limited to 'tests/src/cgeo/geocaching/geopoint/GeopointTest.java')
-rw-r--r-- | tests/src/cgeo/geocaching/geopoint/GeopointTest.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/src/cgeo/geocaching/geopoint/GeopointTest.java b/tests/src/cgeo/geocaching/geopoint/GeopointTest.java index ef1955b..068b8cc 100644 --- a/tests/src/cgeo/geocaching/geopoint/GeopointTest.java +++ b/tests/src/cgeo/geocaching/geopoint/GeopointTest.java @@ -7,16 +7,15 @@ import android.test.AndroidTestCase; import junit.framework.Assert; -@SuppressWarnings("static-method") public class GeopointTest extends AndroidTestCase { - public void testCreation() { + public static void testCreation() { final Geopoint gp = new Geopoint(48.2, 3.5); Assert.assertEquals(48.2, gp.getLatitude(), 1e-8); Assert.assertEquals(3.5, gp.getLongitude(), 1e-8); } - public void testCreationAtLimit() { + public static void testCreationAtLimit() { // No exception should be raised at limits. final Geopoint gp1 = new Geopoint(90.0, 10.0); Assert.assertEquals(90, gp1.getLatitude(), 1e-8); @@ -41,33 +40,33 @@ public class GeopointTest extends AndroidTestCase { } } - public void testCreationFails() { + public static void testCreationFails() { createShouldFail(90.1, 0.0); createShouldFail(-90.1, 0.0); createShouldFail(0.0, 180.1); createShouldFail(0.0, -180.1); } - public void testEqual() { + public static void testEqual() { final Geopoint gp1 = new Geopoint(48.2, 2.31); Assert.assertTrue(gp1.equals(gp1)); final Geopoint gp2 = new Geopoint(48.3, 2.31); Assert.assertFalse(gp1.equals(gp2)); } - public void testCreateE6() { + public static void testCreateE6() { final Geopoint gp1 = new Geopoint(48.2, 2.34); final Geopoint gp2 = new Geopoint(48200000, 2340000); Assert.assertTrue(gp1.isEqualTo(gp2, 1e-6)); } - public void testGetE6() { + public static void testGetE6() { final Geopoint gp = new Geopoint(41.2, -3.4); Assert.assertEquals(41200000.0, gp.getLatitudeE6(), 1e-6); Assert.assertEquals(-3400000.0, gp.getLongitudeE6(), 1e-6); } - public void testBearingDistance() { + public static void testBearingDistance() { final Geopoint gp1 = new Geopoint(-30.4, -1.2); final Geopoint gp2 = new Geopoint(-30.1, -2.3); |