From 932005c606cda7ab5aed364ff8de803fdc7b852c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 17 Jul 2010 04:26:43 +0200 Subject: Junit: Avoid possible forever loop in test --- src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/junit/com') 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