diff options
| author | Michael Keppler <michael.keppler@gmx.de> | 2014-04-23 19:44:33 +0200 |
|---|---|---|
| committer | Michael Keppler <michael.keppler@gmx.de> | 2014-04-23 19:44:33 +0200 |
| commit | 80dd0dffefe10eec518fae8043cad760fb313744 (patch) | |
| tree | 60e12cd5567b86eb96fe9ee96ac2ff45a74c3832 /tests/src/cgeo/geocaching/utils/MiscUtilsTest.java | |
| parent | 2da062dbc8804d31b4ab229ea032f08258fb0ff3 (diff) | |
| download | cgeo-80dd0dffefe10eec518fae8043cad760fb313744.zip cgeo-80dd0dffefe10eec518fae8043cad760fb313744.tar.gz cgeo-80dd0dffefe10eec518fae8043cad760fb313744.tar.bz2 | |
avoid findbugs finding for dead store
Diffstat (limited to 'tests/src/cgeo/geocaching/utils/MiscUtilsTest.java')
| -rw-r--r-- | tests/src/cgeo/geocaching/utils/MiscUtilsTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/src/cgeo/geocaching/utils/MiscUtilsTest.java b/tests/src/cgeo/geocaching/utils/MiscUtilsTest.java index 8678d75..2e170d2 100644 --- a/tests/src/cgeo/geocaching/utils/MiscUtilsTest.java +++ b/tests/src/cgeo/geocaching/utils/MiscUtilsTest.java @@ -10,8 +10,8 @@ import junit.framework.TestCase; public class MiscUtilsTest extends TestCase { public static void testBufferEmpty() { - for (@SuppressWarnings("unused") - final List<String> s : MiscUtils.buffer(new LinkedList<String>(), 10)) { + for (final List<String> s : MiscUtils.buffer(new LinkedList<String>(), 10)) { + assertThat(s).isNotNull(); // only to silence findbugs and the compiler fail("empty collection should not iterate"); } } @@ -24,10 +24,10 @@ public class MiscUtilsTest extends TestCase { int count = 0; for (final List<Integer> subList: MiscUtils.buffer(list, 10)) { assertThat(subList).hasSize(10); - assertEquals("sublist has the right content", count * 10, (int) subList.get(0)); + assertThat(subList.get(0)).as("sublist content").isEqualTo(count * 10); count++; } - assertEquals("there are the right number of sublists", 5, count); + assertThat(count).isEqualTo(5); } public static void testNonMultiple() { |
