diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2012-05-06 15:30:34 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2012-05-06 15:30:34 +0200 |
| commit | 969633ad197c08b5cc28e488c95b349f94f1ba5f (patch) | |
| tree | 9f6e49849a443ba22438425676771791e0978486 | |
| parent | 14a9f219ea54b6bb0d0f997bd8f500ca4ea46a9a (diff) | |
| download | cgeo-969633ad197c08b5cc28e488c95b349f94f1ba5f.zip cgeo-969633ad197c08b5cc28e488c95b349f94f1ba5f.tar.gz cgeo-969633ad197c08b5cc28e488c95b349f94f1ba5f.tar.bz2 | |
Catch divergent messages first
The GPXImporterTest fails intermittently. In order to catch the
difference more precisely, compare the messages as soon as possible and
check their count only at the end.
| -rw-r--r-- | tests/src/cgeo/geocaching/files/GPXImporterTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/src/cgeo/geocaching/files/GPXImporterTest.java b/tests/src/cgeo/geocaching/files/GPXImporterTest.java index ead52f0..66334d7 100644 --- a/tests/src/cgeo/geocaching/files/GPXImporterTest.java +++ b/tests/src/cgeo/geocaching/files/GPXImporterTest.java @@ -119,10 +119,10 @@ public class GPXImporterTest extends AbstractResourceInstrumentationTestCase { } private void assertImportStepMessages(int... importSteps) { - assertEquals(importSteps.length, importStepHandler.messages.size()); - for (int i = 0; i < importSteps.length; i++) { + for (int i = 0; i < Math.min(importSteps.length, importStepHandler.messages.size()); i++) { assertEquals(importSteps[i], importStepHandler.messages.get(i).what); } + assertEquals(importSteps.length, importStepHandler.messages.size()); } public void testImportLoc() throws IOException { |
