aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-04-24 09:15:58 +0200
committerSamuel Tardieu <sam@rfc1149.net>2014-04-24 09:19:23 +0200
commit06cd3b2c0e6d7e0a8eb6f495f932068120cd3dab (patch)
treefae9668812169e009c0a7aad46e1593b28cbd763 /tests
parent0fa22217a447ff4191e4e3b8a6d8932d86f91863 (diff)
downloadcgeo-06cd3b2c0e6d7e0a8eb6f495f932068120cd3dab.zip
cgeo-06cd3b2c0e6d7e0a8eb6f495f932068120cd3dab.tar.gz
cgeo-06cd3b2c0e6d7e0a8eb6f495f932068120cd3dab.tar.bz2
Revert "fix #3759: OOM while loading caches"
This reverts commit 2f3e8ddd18303123a1b81995357f27461fa1d586, as the symptom of the out of memory error might not be its cause, and it slows down the loading of lists.
Diffstat (limited to 'tests')
-rw-r--r--tests/src/cgeo/geocaching/utils/MiscUtilsTest.java57
1 files changed, 0 insertions, 57 deletions
diff --git a/tests/src/cgeo/geocaching/utils/MiscUtilsTest.java b/tests/src/cgeo/geocaching/utils/MiscUtilsTest.java
deleted file mode 100644
index 2e170d2..0000000
--- a/tests/src/cgeo/geocaching/utils/MiscUtilsTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package cgeo.geocaching.utils;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-public class MiscUtilsTest extends TestCase {
-
- public static void testBufferEmpty() {
- 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");
- }
- }
-
- public static void testMultiple() {
- final List<Integer> list = new LinkedList<Integer>();
- for (int i = 0; i < 50; i++) {
- list.add(i);
- }
- int count = 0;
- for (final List<Integer> subList: MiscUtils.buffer(list, 10)) {
- assertThat(subList).hasSize(10);
- assertThat(subList.get(0)).as("sublist content").isEqualTo(count * 10);
- count++;
- }
- assertThat(count).isEqualTo(5);
- }
-
- public static void testNonMultiple() {
- final List<Integer> list = new LinkedList<Integer>();
- for (int i = 0; i < 48; i++) {
- list.add(i);
- }
- int count = 0;
- for (final List<Integer> subList: MiscUtils.buffer(list, 10)) {
- assertThat(subList.size()).overridingErrorMessage("each sublist has no more than the allowed number of arguments").isLessThanOrEqualTo(10);
- count += subList.size();
- }
- assertEquals("all the elements were seen", 48, count);
- }
-
- public static void testArguments() {
- try {
- MiscUtils.buffer(new LinkedList<Integer>(), 0);
- fail("an exception should be raised");
- } catch (final IllegalArgumentException e) {
- // Ok
- } catch (final Exception e) {
- fail("bad exception raised: " + e);
- }
- }
-
-}