@Test public final void testArrayAllocateNegative() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); this.expected.expect(RangeCheckException.class); ga.arrayBufferAllocate(-1L, JCGLUsageHint.USAGE_STATIC_DRAW); Assert.fail(); }
@Test public final void testArrayAllocateNegative() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); this.expected.expect(RangeCheckException.class); ga.arrayBufferAllocate(-1L, JCGLUsageHint.USAGE_STATIC_DRAW); Assert.fail(); }
@Test public final void testArrayReadDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferRead(a, size -> ByteBuffer.allocateDirect((int) size)); Assert.fail(); }
@Test public final void testArrayReadNotBound() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferUnbind(); this.expected.expect(JCGLExceptionBufferNotBound.class); ga.arrayBufferRead(a, size -> ByteBuffer.allocateDirect((int) size)); Assert.fail(); } }
@Test public final void testArrayReadDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferRead(a, size -> ByteBuffer.allocateDirect((int) size)); Assert.fail(); }
@Test public final void testBufferUpdateOutOfRange() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); this.expected.expect(RangeCheckException.class); JCGLBufferUpdates.newUpdateReplacingRange( a, new UnsignedRangeInclusiveL(0L, 200L)); } }
@Test public final void testBufferUpdateOutOfRange() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); this.expected.expect(RangeCheckException.class); JCGLBufferUpdates.newUpdateReplacingRange( a, new UnsignedRangeInclusiveL(0L, 200L)); } }
@Test public final void testArrayDeleteUnbinds() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferBind(a); Assert.assertEquals(Optional.of(a), ga.arrayBufferGetCurrentlyBound()); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); Assert.assertFalse(ga.arrayBufferGetCurrentlyBound().isPresent()); }
@Test public final void testArrayDeleteUnbinds() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferBind(a); Assert.assertEquals(Optional.of(a), ga.arrayBufferGetCurrentlyBound()); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); Assert.assertFalse(ga.arrayBufferGetCurrentlyBound().isPresent()); }
@Test public final void testArrayReallocateNotBound() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferUnbind(); this.expected.expect(JCGLExceptionBufferNotBound.class); ga.arrayBufferReallocate(a); Assert.fail(); }
@Test public final void testArrayUpdateDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLBufferUpdateType<JCGLArrayBufferType> u = JCGLBufferUpdates.newUpdateReplacingAll(a); ga.arrayBufferDelete(a); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferUpdate(u); Assert.fail(); }
@Test public final void testArrayUpdateDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLBufferUpdateType<JCGLArrayBufferType> u = JCGLBufferUpdates.newUpdateReplacingAll(a); ga.arrayBufferDelete(a); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferUpdate(u); Assert.fail(); }
@Test public final void testArrayUpdateNotBound() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLBufferUpdateType<JCGLArrayBufferType> u = JCGLBufferUpdates.newUpdateReplacingAll(a); ga.arrayBufferUnbind(); this.expected.expect(JCGLExceptionBufferNotBound.class); ga.arrayBufferUpdate(u); Assert.fail(); }
@Test public final void testArrayUpdateNotBound() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final JCGLBufferUpdateType<JCGLArrayBufferType> u = JCGLBufferUpdates.newUpdateReplacingAll(a); ga.arrayBufferUnbind(); this.expected.expect(JCGLExceptionBufferNotBound.class); ga.arrayBufferUpdate(u); Assert.fail(); }
@Test public final void testArrayDeleteDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferDelete(a); Assert.fail(); }
@Test public final void testArrayIsBoundDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferIsBound(a); Assert.fail(); }
@Test public final void testArrayBindDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferBind(a); Assert.fail(); }
@Test public final void testArrayDeleteDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferDelete(a); Assert.fail(); }
@Test public final void testArrayBindDeleted() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); ga.arrayBufferDelete(a); Assert.assertTrue(a.isDeleted()); this.expected.expect(JCGLExceptionDeleted.class); ga.arrayBufferBind(a); Assert.fail(); }
@Test public final void testArrayAllocateIdentities() { final JCGLArrayBuffersType ga = this.getArrayBuffers("main"); final JCGLArrayBufferType a = ga.arrayBufferAllocate(100L, JCGLUsageHint.USAGE_STATIC_DRAW); final UnsignedRangeInclusiveL r = a.byteRange(); Assert.assertEquals(0L, r.getLower()); Assert.assertEquals(99L, r.getUpper()); Assert.assertEquals(JCGLUsageHint.USAGE_STATIC_DRAW, a.usageHint()); Assert.assertFalse(a.isDeleted()); }