Ejemplo n.º 1
0
 public void testBufferFieldWriteNonNULL() {
   if (!Platform.HAS_BUFFERS) return;
   BufferStructure bs = new BufferStructure();
   bs.buffer = ByteBuffer.allocateDirect(16);
   bs.dbuffer = ((ByteBuffer) bs.buffer).asDoubleBuffer();
   bs.write();
 }
Ejemplo n.º 2
0
 public void testBufferFieldReadChangedToNULL() {
   if (!Platform.HAS_BUFFERS) return;
   BufferStructure bs = new BufferStructure();
   bs.buffer = ByteBuffer.allocateDirect(16);
   bs.dbuffer = ((ByteBuffer) bs.buffer).asDoubleBuffer();
   bs.read();
   assertNull("Structure Buffer field should be set null", bs.buffer);
   assertNull("Structure DoubleBuffer field should be set null", bs.dbuffer);
 }
Ejemplo n.º 3
0
 public void testBufferFieldReadUnchanged() {
   if (!Platform.HAS_BUFFERS) return;
   BufferStructure bs = new BufferStructure();
   Buffer b = ByteBuffer.allocateDirect(16);
   bs.buffer = b;
   bs.dbuffer = ((ByteBuffer) bs.buffer).asDoubleBuffer();
   bs.write();
   bs.read();
   assertEquals("Buffer field should be unchanged", b, bs.buffer);
 }
Ejemplo n.º 4
0
 public void testBufferFieldReadChanged() {
   if (!Platform.HAS_BUFFERS) return;
   BufferStructure bs = new BufferStructure();
   if (Pointer.SIZE == 4) {
     bs.getPointer().setInt(0, 0x1);
   } else {
     bs.getPointer().setLong(0, 0x1);
   }
   try {
     bs.read();
     fail("Structure read should fail if Buffer pointer was set");
   } catch (IllegalStateException e) {
   }
   bs.buffer = ByteBuffer.allocateDirect(16);
   try {
     bs.read();
     fail("Structure read should fail if Buffer pointer has changed");
   } catch (IllegalStateException e) {
   }
 }
Ejemplo n.º 5
0
 public void testBufferFieldWriteNULL() {
   if (!Platform.HAS_BUFFERS) return;
   BufferStructure bs = new BufferStructure();
   bs.write();
 }