diff options
-rwxr-xr-x | make/scripts/tests-win.bat | 6 | ||||
-rw-r--r-- | make/scripts/tests.sh | 3 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java | 3 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/util/NewtTestUtil.java | 23 |
4 files changed, 26 insertions, 9 deletions
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat index e21273fef..a03c40cc5 100755 --- a/make/scripts/tests-win.bat +++ b/make/scripts/tests-win.bat @@ -3,7 +3,7 @@ REM scripts\java-win.bat com.jogamp.newt.opengl.GLWindow REM scripts\java-win.bat com.jogamp.awt.GLCanvas REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLWindowNEWT %* REM scripts\java-win.bat com.jogamp.oculusvr.OVRVersion %* - +REM REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT -time 30000 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es1.newt.TestGearsES1NEWT %* @@ -16,7 +16,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGea REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.DemoGLJPanelPerf02AWT %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT %* -scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestGLCanvasSWTNewtCanvasSWTPosInTabs %* +REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestGLCanvasSWTNewtCanvasSWTPosInTabs %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl3.newt.TestGeomShader01TextureGL3NEWT %* @@ -188,7 +188,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02aN REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.TestScreenMode02bNEWT %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.mm.ManualScreenMode03sNEWT %* -REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle01NEWT +scripts\java-win.bat com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle01NEWT REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.TestCloseNewtAWT REM scripts\java-win.bat testawt com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleES1AWT %* diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 132bfd8ca..d5f7a5a66 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -979,8 +979,9 @@ function testawtswt() { # to re-test: #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLMesaBug658NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestRulerNEWT01 $* -testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $* +#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT $* +testnoawt com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle01NEWT # Linux DRM/GBM # 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 a7a822647..8cd38d4fc 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java @@ -140,7 +140,8 @@ public class TestDisplayLifecycle01NEWT extends UITestCase { window.setVisible(false); Assert.assertEquals(true,window.isNativeValid()); Assert.assertEquals(false,window.isVisible()); - Assert.assertTrue(NewtTestUtil.hasPositionMax2xInsetsOr64Pix(window, xy_pos, xy_pos)); + // Invisible window might have been moved away (Windows 10), informal only: + NewtTestUtil.hasPositionMax2xInsetsOr64Pix(window, xy_pos, xy_pos); // just make the Window visible again window.resetFPSCounter(); diff --git a/src/test/com/jogamp/opengl/test/junit/util/NewtTestUtil.java b/src/test/com/jogamp/opengl/test/junit/util/NewtTestUtil.java index 9ee63dcf8..1c50b7c15 100644 --- a/src/test/com/jogamp/opengl/test/junit/util/NewtTestUtil.java +++ b/src/test/com/jogamp/opengl/test/junit/util/NewtTestUtil.java @@ -45,30 +45,38 @@ public class NewtTestUtil extends TestUtil { AtomicInteger closing = new AtomicInteger(0); AtomicInteger closed = new AtomicInteger(0); + @Override public void reset() { closing.set(0); closed.set(0); } + @Override public int getWindowClosingCount() { return closing.get(); } + @Override public int getWindowClosedCount() { return closed.get(); } + @Override public boolean isWindowClosing() { return 0 < closing.get(); } + @Override public boolean isWindowClosed() { return 0 < closed.get(); } + @Override public void windowDestroyNotify(final WindowEvent e) { closing.incrementAndGet(); System.err.println("NEWTWindowClosingAdapter.windowDestroyNotify: "+this); } + @Override public void windowDestroyed(final WindowEvent e) { closed.incrementAndGet(); System.err.println("NEWTWindowClosingAdapter.windowDestroyed: "+this); } + @Override public String toString() { return "NEWTWindowClosingAdapter[closing "+closing+", closed "+closed+"]"; } @@ -217,12 +225,19 @@ public class NewtTestUtil extends TestUtil { } return hasPosition(win, shouldX, shouldY, maxDX, maxDY); } + /** - * Validates whether the window position is on the given position within the given tolerances. + * Validates whether the window position is within the expected position including given tolerance. */ - public static boolean hasPosition(final Window win, final int shouldX, final int shouldY, final int maxDX, final int maxDY) { - final boolean ok = Math.abs(shouldX - win.getX()) <= maxDX && - Math.abs(shouldY - win.getY()) <= maxDY ; + public static boolean hasPosition(final Window win, final int expX, final int expY, final int maxDX, final int maxDY) { + final int dx = Math.abs(expX - win.getX()); + final int dy = Math.abs(expY - win.getY()); + final boolean ok = dx <= maxDX && dy <= maxDY ; + if( !ok ) { + System.err.println("Position OFF: abs( exp "+expX+"/"+expY+" - has "+win.getX()+"/"+win.getY()+" ) = "+dx+"/"+dy+" > "+maxDX+"/"+maxDY); + } else { + System.err.println("Position OK : abs( exp "+expX+"/"+expY+" - has "+win.getX()+"/"+win.getY()+" ) = "+dx+"/"+dy+" <= "+maxDX+"/"+maxDY); + } return ok; } } |