summaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-02-01 12:41:53 +0100
committerSven Gothel <[email protected]>2013-02-01 12:41:53 +0100
commitfeebfdea24f8ac98282751824aa4d3569bb71d93 (patch)
treefb4cf4ffca10223f0eccabbe547cc1baed120405 /src/test/com/jogamp/opengl
parenta37dc59993dc6f3ad925d7ba1a2febccd8ee5e9d (diff)
Fix Animator resume() wait-condition (drawablesEmpty didn't wait for pausedIssued); Update TestGLWindows02NEWTAnimated (isPaused())
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java46
1 files changed, 28 insertions, 18 deletions
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 6f4ced53c..64c5e9c8d 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
@@ -132,7 +132,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
animator.remove(window);
Assert.assertEquals(false, animator.isAnimating());
- Assert.assertEquals(false, animator.isPaused());
+ Assert.assertEquals(true, animator.isPaused()); // zero drawables
Assert.assertEquals(true, animator.isStarted());
Assert.assertTrue(animator.stop());
}
@@ -142,21 +142,24 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
GLCapabilities caps = new GLCapabilities(glp);
Assert.assertNotNull(caps);
GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */, true /* vsync */);
- Animator animator = new Animator(window);
+ Animator animator = new Animator();
animator.setUpdateFPSFrames(1, null);
Assert.assertTrue(animator.start());
+ Assert.assertEquals(false, animator.isAnimating()); // zero drawables
+ Assert.assertEquals(true, animator.isPaused()); // zero drawables
+ animator.add(window);
while(animator.isAnimating() && animator.getTotalFPSDuration()<durationPerTest) {
Thread.sleep(100);
}
destroyWindow(window);
destroyWindow(window);
Assert.assertEquals(true, animator.isAnimating());
- Assert.assertEquals(false, animator.isPaused());
Assert.assertEquals(true, animator.isStarted());
+ Assert.assertEquals(false, animator.isPaused());
animator.remove(window);
Assert.assertEquals(false, animator.isAnimating());
- Assert.assertEquals(false, animator.isPaused());
Assert.assertEquals(true, animator.isStarted());
+ Assert.assertEquals(true, animator.isPaused()); // zero drawables
Assert.assertTrue(animator.stop());
}
@@ -181,13 +184,13 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
Animator animator = new Animator();
animator.setUpdateFPSFrames(1, null);
Assert.assertEquals(false, animator.isStarted());
- Assert.assertEquals(false, animator.isAnimating());
- Assert.assertEquals(false, animator.isPaused());
+ Assert.assertEquals(false, animator.isAnimating()); // zero drawables
+ Assert.assertEquals(false, animator.isPaused()); // zero drawables, but not started
Assert.assertTrue(animator.start());
Assert.assertEquals(true, animator.isStarted());
- Assert.assertEquals(false, animator.isAnimating());
- Assert.assertEquals(false, animator.isPaused());
+ Assert.assertEquals(false, animator.isAnimating()); // zero drawables
+ Assert.assertEquals(true, animator.isPaused()); // zero drawables
animator.add(window1);
Assert.assertEquals(true, animator.isStarted());
@@ -214,8 +217,8 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
window2.destroy();
animator.remove(window2);
Assert.assertEquals(true, animator.isStarted());
- Assert.assertEquals(false, animator.isAnimating());
- Assert.assertEquals(false, animator.isPaused());
+ Assert.assertEquals(false, animator.isAnimating()); // zero drawables
+ Assert.assertEquals(true, animator.isPaused()); // zero drawables
Assert.assertTrue(animator.stop());
}
@@ -250,8 +253,8 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
Assert.assertTrue(animator.start());
Assert.assertEquals(true, animator.isStarted());
- Assert.assertEquals(false, animator.isAnimating());
- Assert.assertEquals(false, animator.isPaused());
+ Assert.assertEquals(false, animator.isAnimating()); // zero drawables
+ Assert.assertEquals(true, animator.isPaused()); // zero drawables
animator.add(window1);
Assert.assertEquals(true, animator.isStarted());
@@ -275,21 +278,28 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
while(animator.isAnimating() && animator.getTotalFPSDuration()<durationPerTest+durationPerTest/10) {
Thread.sleep(100);
}
- destroyWindow(window2);
- animator.remove(window2);
- Assert.assertEquals(true, animator.isStarted());
- Assert.assertEquals(false, animator.isAnimating());
+
+ Assert.assertEquals(true, animator.isStarted());
+ Assert.assertEquals(true, animator.isAnimating());
Assert.assertEquals(false, animator.isPaused());
-
+
Assert.assertEquals(true, animator.pause());
+
Assert.assertEquals(true, animator.isStarted());
Assert.assertEquals(false, animator.isAnimating());
Assert.assertEquals(true, animator.isPaused());
Assert.assertEquals(true, animator.resume());
+
Assert.assertEquals(true, animator.isStarted());
- Assert.assertEquals(false, animator.isAnimating());
+ Assert.assertEquals(true, animator.isAnimating());
Assert.assertEquals(false, animator.isPaused());
+
+ destroyWindow(window2);
+ animator.remove(window2);
+ Assert.assertEquals(true, animator.isStarted());
+ Assert.assertEquals(false, animator.isAnimating()); // zero drawables
+ Assert.assertEquals(true, animator.isPaused()); // zero drawables
Assert.assertTrue(animator.stop());
Assert.assertEquals(false, animator.isStarted());