diff options
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java index 7151af156a..8b042bd67c 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/BlockListTest.java @@ -282,6 +282,24 @@ public class BlockListTest { } @Test + public void testAddAllFromOtherList() { + BlockList<Integer> src = new BlockList<Integer>(4); + int cnt = BlockList.BLOCK_SIZE * 2; + + for (int i = 0; i < cnt; i++) + src.add(Integer.valueOf(42 + i)); + src.add(Integer.valueOf(1)); + + BlockList<Integer> dst = new BlockList<Integer>(4); + dst.add(Integer.valueOf(255)); + dst.addAll(src); + assertEquals(cnt + 2, dst.size()); + for (int i = 0; i < cnt; i++) + assertEquals(Integer.valueOf(42 + i), dst.get(i + 1)); + assertEquals(Integer.valueOf(1), dst.get(dst.size() - 1)); + } + + @Test public void testFastIterator() { BlockList<Integer> list = new BlockList<Integer>(4); int cnt = BlockList.BLOCK_SIZE * 3; |