diff options
author | PJ Fanning <fanningpj@apache.org> | 2024-09-29 07:12:48 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2024-09-29 07:12:48 +0000 |
commit | 52039e220d9b485f9f5fb83e0aa56ced73aaf83a (patch) | |
tree | 8830bd7f14a4e8908cd31b45960eb3656db1636b /poi/src/test/java | |
parent | a3d9bb7e3541e90340aaf6e1265767daf9b51462 (diff) | |
download | poi-52039e220d9b485f9f5fb83e0aa56ced73aaf83a.tar.gz poi-52039e220d9b485f9f5fb83e0aa56ced73aaf83a.zip |
[bug-69351] fix issues with removing items from IntList
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1921017 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi/src/test/java')
-rw-r--r-- | poi/src/test/java/org/apache/poi/util/TestIntList.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/poi/src/test/java/org/apache/poi/util/TestIntList.java b/poi/src/test/java/org/apache/poi/util/TestIntList.java index 4c4317ad0e..6978c7425d 100644 --- a/poi/src/test/java/org/apache/poi/util/TestIntList.java +++ b/poi/src/test/java/org/apache/poi/util/TestIntList.java @@ -510,4 +510,30 @@ final class TestIntList { assertEquals(a5[j], list.get(j)); } } + + @Test + void bug69351() { + final int size = 10; + final IntList list = new IntList(size); + assertEquals(0, list.size()); + for (int i = 0; i < size; i++) { + list.add(i); + } + assertEquals(size, list.size()); + assertTrue(list.removeValue(size - 2)); + assertEquals(size - 1, list.size()); + } + + @Test + void testRemove69351() { + final int size = 10; + final IntList list = new IntList(size); + assertEquals(0, list.size()); + for (int i = 0; i < size; i++) { + list.add(i); + } + assertEquals(size, list.size()); + assertEquals(size - 2, list.remove(size - 2)); + assertEquals(size - 1, list.size()); + } } |