aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/util
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2011-07-01 16:29:04 +0000
committerNick Burch <nick@apache.org>2011-07-01 16:29:04 +0000
commit3fc8c3b1b799457c2432adb29c6cb2065306027e (patch)
tree663060b36fe6894cac4a304a04a802676a49cb13 /src/testcases/org/apache/poi/util
parent5d2797bff25b4d0fe861a6dcb86576165fe126ba (diff)
downloadpoi-3fc8c3b1b799457c2432adb29c6cb2065306027e.tar.gz
poi-3fc8c3b1b799457c2432adb29c6cb2065306027e.zip
Apply patch from bug #51458 - Correct BitField wrapping when setting large values
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1141977 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/util')
-rw-r--r--src/testcases/org/apache/poi/util/TestBitField.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/util/TestBitField.java b/src/testcases/org/apache/poi/util/TestBitField.java
index ef55ab7451..a5c953a435 100644
--- a/src/testcases/org/apache/poi/util/TestBitField.java
+++ b/src/testcases/org/apache/poi/util/TestBitField.java
@@ -188,4 +188,13 @@ public final class TestBitField extends TestCase {
assertEquals(bf_single.clearShort(( short ) -1),
bf_single.setShortBoolean(( short ) -1, false));
}
+
+ public void testSetLargeValues() {
+ final BitField bf1 = new BitField(0xF), bf2 = new BitField(0xF0000000);
+ int a = 0;
+ a = bf1.setValue(a, 9);
+ a = bf2.setValue(a, 9);
+ assertEquals(9, bf1.getValue(a));
+ assertEquals(9, bf2.getValue(a));
+ }
}