From 4447232af0d95a4348d09d4ed03fbef48394ca3a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 21 Feb 2014 12:25:36 +0100 Subject: Bug 980: Refine Bitstream API 'signed' and 'unsigned' semantics - readUInt32(..) must return long due to EOF --- src/junit/com/jogamp/common/util/TestBitstream03.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/junit/com/jogamp/common/util/TestBitstream03.java') diff --git a/src/junit/com/jogamp/common/util/TestBitstream03.java b/src/junit/com/jogamp/common/util/TestBitstream03.java index 7eb89e7..3647924 100644 --- a/src/junit/com/jogamp/common/util/TestBitstream03.java +++ b/src/junit/com/jogamp/common/util/TestBitstream03.java @@ -47,7 +47,7 @@ import org.junit.runners.MethodSorters; * Test {@link Bitstream} w/ int16 read/write access w/ semantics * as well as with aligned and unaligned access. * */ @@ -82,7 +82,7 @@ public class TestBitstream03 extends JunitTracer { final Bitstream.ByteBufferStream bbs = new Bitstream.ByteBufferStream(bb); final Bitstream bs = new Bitstream(bbs, false /* outputMode */); { - final short r16 = (short) bs.readInt16(true /* msbFirst */, bigEndian); + final short r16 = (short) bs.readUInt16(true /* msbFirst */, bigEndian); System.err.println("Read16.1 "+r16+", "+toHexBinaryString(r16, 16)); Assert.assertEquals(val16, r16); } @@ -92,7 +92,7 @@ public class TestBitstream03 extends JunitTracer { bs.writeInt16(true /* msbFirst */, bigEndian, val16); bs.setStream(bs.getSubStream(), false /* outputMode */); // switch to input-mode, implies flush() { - final short r16 = (short) bs.readInt16(true /* msbFirst */, bigEndian); + final short r16 = (short) bs.readUInt16(true /* msbFirst */, bigEndian); System.err.println("Read16.2 "+r16+", "+toHexBinaryString(r16, 16)); Assert.assertEquals(val16, r16); } @@ -140,7 +140,7 @@ public class TestBitstream03 extends JunitTracer { bs.setStream(bs.getSubStream(), false /* outputMode */); // switch to input-mode, implies flush() final int rPre = (short) bs.readBits31(true /* msbFirst */, preBits); - final short r16 = (short) bs.readInt16(true /* msbFirst */, bigEndian); + final short r16 = (short) bs.readUInt16(true /* msbFirst */, bigEndian); System.err.println("ReadPre "+rPre+", "+toBinaryString(rPre, preBits)); System.err.println("Read16 "+r16+", "+toHexBinaryString(r16, 16)); Assert.assertEquals(val16, r16); -- cgit v1.2.3