From 040e11f6c4d69ff337dca9afc1b2cb473d5b5bef Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Tue, 3 Mar 2015 10:37:39 +0100 Subject: Give better explanation of what went wrong in test --- tests/src/cgeo/geocaching/files/GPXImporterTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/src') 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 { -- cgit v1.1