@Test public final void testContextDestroyedGetGL33() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); c0.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextGetGL33(); }
@Test public final void testContextMakeCurrentIsCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); Assert.assertFalse(c0.contextIsCurrent()); c0.contextMakeCurrent(); Assert.assertTrue(c0.contextIsCurrent()); }
@Test public final void testContextIdentities() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); final JCGLContextType c1 = this.newContext("alt"); Assert.assertTrue(c1.contextIsCurrent()); Assert.assertFalse(c0.contextIsCurrent()); Assert.assertFalse(c0.contextIsSharedWith(c1)); Assert.assertSame( c0.contextGetImplementation(), c1.contextGetImplementation()); c1.contextReleaseCurrent(); Assert.assertFalse(c0.contextIsCurrent()); Assert.assertFalse(c1.contextIsCurrent()); Assert.assertEquals("main", c0.contextGetName()); Assert.assertEquals("alt", c1.contextGetName()); }
@Test public final void testContextDestroyedGetShares() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); c0.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextGetShares(); }
@Test public final void testContextDestroyedMakeCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); c0.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextMakeCurrent(); }
@Test public final void testLoadIntegerSigned16_3() throws Exception { final JCGLContextType c = this.newContext("main", 24, 8); final JCGLInterfaceGL33Type g = c.contextGetGL33(); final JCGLScalarType type = JCGLScalarType.TYPE_SHORT; final int component_count = 3; final int vertex_count = 3; final String name = "integer16_3.smft"; this.check(g, type, component_count, vertex_count, name); }
@Test public final void testContextDestroyedDestroy() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); c0.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextDestroy(); }
@Test public final void testContextDestroyedGetImplementation() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); c0.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextGetImplementation(); }
@Test public final void testContextReleaseNotCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); this.expected.expect(JCGLExceptionContextNotCurrent.class); c0.contextReleaseCurrent(); }
@Test public final void testContextIdentitiesShared() { final JCGLSharedContextPair<JCGLContextType> p = this.newSharedContext("main", "alt"); final JCGLContextType c0 = p.getMasterContext(); final JCGLContextType c1 = p.getSlaveContext(); Assert.assertTrue(c0.contextIsSharedWith(c1)); Assert.assertSame( c0.contextGetImplementation(), c1.contextGetImplementation()); Assert.assertTrue(c0.contextGetShares().contains(c1)); }
@Test public final void testContextMakeCurrentAlreadyCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); this.expected.expect(JCGLExceptionContextIsCurrent.class); c0.contextMakeCurrent(); }
@Test public final void testContextSharedDestroyed() { final JCGLSharedContextPair<JCGLContextType> p = this.newSharedContext("main", "alt"); final JCGLContextType c0 = p.getMasterContext(); final JCGLContextType c1 = p.getSlaveContext(); c1.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextIsSharedWith(c1); }
@Test public final void testContextDestroyIsCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); this.expected.expect(JCGLExceptionContextIsCurrent.class); c0.contextDestroy(); } }
@Override public CompletableFuture<Void> shutDown() throws JCGLException { if (this.closing.compareAndSet(false, true)) { JCGLAsyncInterfaceGL33.LOG.debug("scheduling shutdown"); return CompletableFuture.runAsync( () -> { JCGLAsyncInterfaceGL33.LOG.debug( "attempting to release context"); this.context.contextReleaseCurrent(); }, this.exec) .handle((v, ex) -> { JCGLAsyncInterfaceGL33.LOG.debug( "attempting to shut down executor"); this.exec.shutdown(); return v; }); } throw JCGLAsyncInterfaceGL33.alreadyClosing(); }
@Test public final void testLoadIntegerUnsigned8_4() throws Exception { final JCGLContextType c = this.newContext("main", 24, 8); final JCGLInterfaceGL33Type g = c.contextGetGL33(); final JCGLScalarType type = JCGLScalarType.TYPE_UNSIGNED_BYTE; final int component_count = 4; final int vertex_count = 3; final String name = "unsigned8_4.smft"; this.check(g, type, component_count, vertex_count, name); }
@Test public final void testContextDestroyedDestroy() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); c0.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextDestroy(); }
@Test public final void testContextDestroyedMakeCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); c0.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextMakeCurrent(); }
@Test public final void testContextDestroyedGetShares() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); c0.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextGetShares(); }
@Test public final void testContextDestroyedGetImplementation() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); c0.contextDestroy(); this.expected.expect(JCGLExceptionDeleted.class); c0.contextGetImplementation(); }
@Test public final void testContextReleaseNotCurrent() { final JCGLContextType c0 = this.newContext("main"); Assert.assertTrue(c0.contextIsCurrent()); c0.contextReleaseCurrent(); this.expected.expect(JCGLExceptionContextNotCurrent.class); c0.contextReleaseCurrent(); }