diff options
author | Sven Gothel <[email protected]> | 2010-07-17 04:26:43 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-07-17 04:26:43 +0200 |
commit | 932005c606cda7ab5aed364ff8de803fdc7b852c (patch) | |
tree | c3f7c4ca263a201080404bfbbd94dd3b6abab43e | |
parent | 7f1f12304f4c143b1656f79ee58311508fe00d1b (diff) |
Junit: Avoid possible forever loop in test
-rw-r--r-- | src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java b/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java index 53100eca7..3e7228aba 100644 --- a/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java +++ b/src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java @@ -107,7 +107,8 @@ public class TestGLWindows01NEWT { glWindow.setVisible(true); Assert.assertEquals(true,glWindow.isVisible()); Assert.assertEquals(true,glWindow.isNativeWindowValid()); - while(glWindow.getTotalFrames()<1) { Thread.sleep(100); } + int wait=0; + while(wait<10 && glWindow.getTotalFrames()<1) { Thread.sleep(100); wait++; } System.out.println("Frames for initial setVisible(true): "+glWindow.getTotalFrames()); Assert.assertTrue(0<glWindow.getTotalFrames()); // native expose .. // Assert.assertEquals(width,glWindow.getWidth()); |