aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2015-03-03 10:37:39 +0100
committerSamuel Tardieu <sam@rfc1149.net>2015-03-03 10:37:39 +0100
commit040e11f6c4d69ff337dca9afc1b2cb473d5b5bef (patch)
treea01d5227ae90f8db4926db8b21ded89b769ec0a7 /tests
parentaa48a1d49e843dda18ea777303bb1014808b72fe (diff)
downloadcgeo-040e11f6c4d69ff337dca9afc1b2cb473d5b5bef.zip
cgeo-040e11f6c4d69ff337dca9afc1b2cb473d5b5bef.tar.gz
cgeo-040e11f6c4d69ff337dca9afc1b2cb473d5b5bef.tar.bz2
Give better explanation of what went wrong in test
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/files/GPXImporterTest.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/src/cgeo/geocaching/files/GPXImporterTest.java b/tests/src/cgeo/geocaching/files/GPXImporterTest.java
index 9426fe8..86fa90d 100644
--- a/tests/src/cgeo/geocaching/files/GPXImporterTest.java
+++ b/tests/src/cgeo/geocaching/files/GPXImporterTest.java
@@ -153,11 +153,11 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase {
assertThat(cache.getName()).isEqualTo("First Aid Station #1");
}
- private void assertImportStepMessages(int... importSteps) {
- assertThat(importStepHandler.messages).hasSize(importSteps.length);
- for (int i = 0; i < importSteps.length; i++) {
+ private void assertImportStepMessages(final int... importSteps) {
+ for (int i = 0; i < Math.min(importSteps.length, importStepHandler.messages.size()); i++) {
assertThat(importStepHandler.messages.get(i).what).isEqualTo(importSteps[i]);
}
+ assertThat(importStepHandler.messages).hasSize(importSteps.length);
}
public void testImportLoc() throws IOException {