aboutsummaryrefslogtreecommitdiffstats
path: root/src/junit/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-08-02 02:09:48 +0200
committerSven Gothel <[email protected]>2015-08-02 02:09:48 +0200
commitfb970d92bc737afe34e23a0667b1737c6b105fde (patch)
tree292e9f38c8b57450ad7bafde7689ab3c4e1c3e47 /src/junit/com/jogamp
parentbea171a16539b16b493acc9cc0e102985e2939a6 (diff)
Fix Bitfield.put(..): Return previous value
Diffstat (limited to 'src/junit/com/jogamp')
-rw-r--r--src/junit/com/jogamp/common/util/TestBitfield00.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/junit/com/jogamp/common/util/TestBitfield00.java b/src/junit/com/jogamp/common/util/TestBitfield00.java
index a2d5d73..bb8ca37 100644
--- a/src/junit/com/jogamp/common/util/TestBitfield00.java
+++ b/src/junit/com/jogamp/common/util/TestBitfield00.java
@@ -320,12 +320,16 @@ public class TestBitfield00 extends SingletonJunitCase {
assertEquals(bf, lowBitnum+1, d.val, d.pattern, oneBitCount);
}
+ // test put() return value (previous value)
+ bf.clearField(false);
+ Assert.assertEquals(msg+", bitpos "+0, false, bf.put(lowBitnum+0, true));
+ Assert.assertEquals(msg+", bitpos "+0, true, bf.put(lowBitnum+0, false));
+
//
// via put
//
- bf.clearField(false);
for(int i=0; i<d.bitSize; i++) {
- bf.put(lowBitnum+i, 0 != ( d.val & ( 1 << i ) ));
+ Assert.assertEquals(msg+", bitpos "+i, false, bf.put(lowBitnum+i, 0 != ( d.val & ( 1 << i ) )));
}
Assert.assertEquals(msg, d.val, bf.get32(lowBitnum, d.bitSize));
for(int i=0; i<d.bitSize; i++) {