aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/LogTemplateProviderTest.java7
-rw-r--r--tests/src/cgeo/geocaching/files/GPXImporterTest.java5
2 files changed, 9 insertions, 3 deletions
diff --git a/tests/src/cgeo/geocaching/LogTemplateProviderTest.java b/tests/src/cgeo/geocaching/LogTemplateProviderTest.java
index 760dedd..21ce00e 100644
--- a/tests/src/cgeo/geocaching/LogTemplateProviderTest.java
+++ b/tests/src/cgeo/geocaching/LogTemplateProviderTest.java
@@ -1,5 +1,7 @@
package cgeo.geocaching;
+import java.util.Calendar;
+
import junit.framework.TestCase;
public class LogTemplateProviderTest extends TestCase {
@@ -7,7 +9,10 @@ public class LogTemplateProviderTest extends TestCase {
public static void testApplyTemplates() {
final String noTemplates = " no templates ";
assertEquals(noTemplates, LogTemplateProvider.applyTemplates(noTemplates, true));
- assertTrue(LogTemplateProvider.applyTemplates("[DATE]", true).contains("."));
+
+ // This test can occasionally fail if the current year changes right after the next line.
+ final String currentYear = Integer.toString(Calendar.YEAR);
+ assertTrue(LogTemplateProvider.applyTemplates("[DATE]", true).contains(currentYear));
}
}
diff --git a/tests/src/cgeo/geocaching/files/GPXImporterTest.java b/tests/src/cgeo/geocaching/files/GPXImporterTest.java
index 1ac9a75..95f1218 100644
--- a/tests/src/cgeo/geocaching/files/GPXImporterTest.java
+++ b/tests/src/cgeo/geocaching/files/GPXImporterTest.java
@@ -1,5 +1,6 @@
package cgeo.geocaching.files;
+import cgeo.geocaching.Settings;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgSearch;
import cgeo.geocaching.cgeoapplication;
@@ -9,6 +10,7 @@ import cgeo.geocaching.utils.CancellableHandler;
import android.net.Uri;
import android.os.Message;
+import android.util.Log;
import java.io.File;
import java.io.IOException;
@@ -66,8 +68,7 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase {
try {
importThread.join();
} catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ Log.e(Settings.tag, "GPXImporterTest.runImportThread", e);
}
importStepHandler.waitForCompletion();
}