summaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-04-24 14:10:46 +0200
committerSven Gothel <[email protected]>2011-04-24 14:10:46 +0200
commit769e370f1c6948a02780466ebbc7f0c509eede26 (patch)
tree65c331ceef5fbf9b213102f7ded533c5cd9fa6fd /src/test/com/jogamp/opengl
parent1687976556fd38178e8dd85bcb0bdc86d8f542fa (diff)
Fix junit tests: Enable FPSCounter (missing from ea819ff768d507c37a981c1ab0bdc0cad32c6a87)
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java2
5 files changed, 10 insertions, 1 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
index 1638d69dd..73e9c63cb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
@@ -43,7 +43,7 @@ public class GLSLMiscHelper {
public static final int frames_perftest = 10000; // frames
public static final int frames_warmup = 500; // frames
- public static GLWindow createWindow() {
+ public static GLWindow createWindow() throws InterruptedException {
GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
GLCapabilities caps = new GLCapabilities(glp);
GLWindow window = GLWindow.create(caps);
@@ -54,6 +54,10 @@ public class GLSLMiscHelper {
GLContext context = window.getContext();
Assert.assertNotNull(context);
context.setSynchronized(true);
+ while(!context.isCreated()) {
+ // wait for context creation via above setVisible
+ Thread.sleep(100);
+ }
context.makeCurrent(); // native context creation
context.release();
Assert.assertTrue(context.isCreated());
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java
index c5e7582d4..2972e30ca 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java
@@ -83,6 +83,7 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
} else {
glWindow = GLWindow.create(caps);
}
+ glWindow.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
GLEventListener demo = new Gears();
setDemoFields(demo, glWindow);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java
index 3691941ed..a441938a4 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java
@@ -76,6 +76,7 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
// Create native windowing resources .. X11/Win/OSX
//
GLWindow glWindow = GLWindow.create(caps);
+ glWindow.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
GLEventListener demo = new Gears();
setDemoFields(demo, glWindow);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java
index d326f124d..0134ea43a 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java
@@ -71,6 +71,7 @@ public class TestGLWindows00NEWT extends UITestCase {
glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
}
+ glWindow.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
GLEventListener demo = new Gears();
glWindow.addGLEventListener(demo);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
index f7aab9efa..336c0fbba 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
@@ -74,6 +74,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
} else {
glWindow = GLWindow.create(caps);
}
+ glWindow.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
Assert.assertNotNull(glWindow);
glWindow.setUndecorated(onscreen && undecorated);
@@ -226,6 +227,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
window2.setPosition(screen2.getWidth()-width, 0);
Animator animator = new Animator();
+ animator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
Assert.assertEquals(false, animator.isStarted());
Assert.assertEquals(false, animator.isAnimating());
Assert.assertEquals(false, animator.isPaused());