aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/src/cgeo/geocaching/Settings.java12
-rw-r--r--tests/src/cgeo/geocaching/SettingsTest.java9
2 files changed, 5 insertions, 16 deletions
diff --git a/main/src/cgeo/geocaching/Settings.java b/main/src/cgeo/geocaching/Settings.java
index 92e96aa..31452af 100644
--- a/main/src/cgeo/geocaching/Settings.java
+++ b/main/src/cgeo/geocaching/Settings.java
@@ -9,7 +9,6 @@ import cgeo.geocaching.utils.CryptUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.mapsforge.android.maps.MapDatabase;
import android.content.Context;
import android.content.SharedPreferences;
@@ -371,17 +370,6 @@ public final class Settings {
return commitResult;
}
- public static boolean isValidMapFile() {
- return checkMapfile(getMapFile());
- }
-
- private static boolean checkMapfile(final String mapFileIn) {
- if (null == mapFileIn) {
- return false;
- }
- return MapDatabase.isValidMapFile(mapFileIn);
- }
-
public static coordInputFormatEnum getCoordInputFormat() {
return coordInputFormatEnum.fromInt(sharedPrefs.getInt(KEY_COORD_INPUT_FORMAT, 0));
}
diff --git a/tests/src/cgeo/geocaching/SettingsTest.java b/tests/src/cgeo/geocaching/SettingsTest.java
index c31e635..27395ec 100644
--- a/tests/src/cgeo/geocaching/SettingsTest.java
+++ b/tests/src/cgeo/geocaching/SettingsTest.java
@@ -1,7 +1,6 @@
package cgeo.geocaching;
-import cgeo.geocaching.Settings;
-import cgeo.geocaching.cgeo;
+import org.mapsforge.android.maps.MapDatabase;
import android.test.ActivityInstrumentationTestCase2;
@@ -21,7 +20,9 @@ public class SettingsTest extends ActivityInstrumentationTestCase2<cgeo> {
* this should work fine without an exception (once there was an exception because of the empty map file string)
*/
public static void testSettingsException() {
- // asserts A OR NOT A, because we don't know what the settings are on any device or emulator
- assertTrue(Settings.isValidMapFile() || !Settings.isValidMapFile());
+ final String mapFile = Settings.getMapFile();
+ assertNotNull(mapFile);
+ // We just want to ensure that it does not throw any exception but we do not know anything about the result
+ MapDatabase.isValidMapFile(mapFile);
}
}