aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorcampbeb <bpcampbell@gmail.com>2012-01-12 00:01:18 +0900
committercampbeb <bpcampbell@gmail.com>2012-01-12 00:01:18 +0900
commit5c57d5e19cb7de67f4c6af252982240037bfafe4 (patch)
tree374179989460b40257ed8bacda0af39e3d25e94c /tests
parent943ae4421d1363fb465367250b9eb96b8944da08 (diff)
downloadcgeo-5c57d5e19cb7de67f4c6af252982240037bfafe4.zip
cgeo-5c57d5e19cb7de67f4c6af252982240037bfafe4.tar.gz
cgeo-5c57d5e19cb7de67f4c6af252982240037bfafe4.tar.bz2
Check if using metric units so we compare to the correct result expected
from getHumanDistance
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/cgBaseTest.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/src/cgeo/geocaching/cgBaseTest.java b/tests/src/cgeo/geocaching/cgBaseTest.java
index f7a6f45..f286fb6 100644
--- a/tests/src/cgeo/geocaching/cgBaseTest.java
+++ b/tests/src/cgeo/geocaching/cgBaseTest.java
@@ -90,7 +90,12 @@ public class cgBaseTest extends AndroidTestCase {
public static void testHumanDistance() {
assertEquals("?", cgBase.getHumanDistance(null));
- assertEquals("123 km", cgBase.getHumanDistance(123.456f));
+ if (Settings.isUseMetricUnits()) {
+ assertEquals("123 km", cgBase.getHumanDistance(123.456f));
+ }
+ else {
+ assertEquals("77 mi", cgBase.getHumanDistance(123.456f));
+ }
}
public static void testWaypointsFromNote() {