aboutsummaryrefslogtreecommitdiffstats
path: root/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java')
-rwxr-xr-xsrc/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java62
1 files changed, 50 insertions, 12 deletions
diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java
index ee2c85502..4a1e65a8d 100755
--- a/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java
+++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java
@@ -37,11 +37,12 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.junit.AfterClass;
+import org.junit.After;
import org.junit.Assert;
+import org.junit.Assume;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import org.junit.After;
import org.junit.Test;
import javax.media.opengl.*;
@@ -97,7 +98,13 @@ public class TestOffscreen01NEWT {
glWindow.addGLEventListener(demo);
while ( glWindow.getTotalFrames() < 2) {
- glWindow.display();
+ try {
+ glWindow.display();
+ } catch (Throwable t) {
+ // stop test and ignore if pbuffer cannot be used
+ t.printStackTrace();
+ Assume.assumeNoException(t);
+ }
}
if(null!=glWindow) {
@@ -190,10 +197,16 @@ public class TestOffscreen01NEWT {
glWindows[i].addGLEventListener(demos[i]);
}
- while ( glWindows[0].getTotalFrames() < 2) {
- for(i=0; i<winnum; i++) {
- glWindows[i].display();
+ try {
+ while ( glWindows[0].getTotalFrames() < 2) {
+ for(i=0; i<winnum; i++) {
+ glWindows[i].display();
+ }
}
+ } catch (Throwable t) {
+ // stop test and ignore if pbuffer cannot be used
+ t.printStackTrace();
+ Assume.assumeNoException(t);
}
for(i=0; i<winnum; i++) {
@@ -243,12 +256,19 @@ public class TestOffscreen01NEWT {
glWindows[i].addGLEventListener(demos[i]);
}
- while ( glWindows[0].getTotalFrames() < 2) {
- for(i=0; i<winnum; i++) {
- glWindows[i].display();
+ try {
+ while ( glWindows[0].getTotalFrames() < 2) {
+ for(i=0; i<winnum; i++) {
+ glWindows[i].display();
+ }
}
+ } catch (Throwable t) {
+ // stop test and ignore if pbuffer cannot be used
+ t.printStackTrace();
+ Assume.assumeNoException(t);
}
+
for(i=0; i<winnum; i++) {
if(null!=glWindows[i]) {
glWindows[i].destroy();
@@ -293,7 +313,13 @@ public class TestOffscreen01NEWT {
GLEventListener demo = new RedSquare();
Assert.assertNotNull(demo);
- WindowUtilNEWT.run(glWindow, demo, windowOnScreen, wl, ml, ul, 2, true /*snapshot*/, false /*debug*/);
+ try {
+ WindowUtilNEWT.run(glWindow, demo, windowOnScreen, wl, ml, ul, 2, true /*snapshot*/, false /*debug*/);
+ } catch (Throwable t) {
+ // stop test and ignore if pbuffer cannot be used
+ t.printStackTrace();
+ Assume.assumeNoException(t);
+ }
if(null!=windowOnScreen) {
windowOnScreen.destroy();
@@ -337,7 +363,13 @@ public class TestOffscreen01NEWT {
glWindow.addGLEventListener(demo);
while ( glWindow.getTotalFrames() < 2) {
- glWindow.display();
+ try {
+ glWindow.display();
+ } catch (Throwable t) {
+ // stop test and ignore if pixmap cannot be used
+ t.printStackTrace();
+ Assume.assumeNoException(t);
+ }
}
if(null!=glWindow) {
@@ -384,7 +416,13 @@ public class TestOffscreen01NEWT {
GLEventListener demo = new RedSquare();
Assert.assertNotNull(demo);
- WindowUtilNEWT.run(glWindow, demo, windowOnScreen, wl, ml, ul, 2, true /*snapshot*/, false /*debug*/);
+ try {
+ WindowUtilNEWT.run(glWindow, demo, windowOnScreen, wl, ml, ul, 2, true /*snapshot*/, false /*debug*/);
+ } catch (Throwable t) {
+ // stop test and ignore if pixmap cannot be used
+ t.printStackTrace();
+ Assume.assumeNoException(t);
+ }
if(null!=windowOnScreen) {
windowOnScreen.destroy();