From c7e53e52b03afbaa6fe02a2ee5a4c5b6e5ed9f5a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 17 Jun 2013 11:19:05 +0200 Subject: Fix TestNewtKeyEventAutoRepeatAWT (Bug 688): Reduce head/tail event check to 2 events (Windows can't produce AR) --- .../newt/event/TestNewtKeyEventAutoRepeatAWT.java | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/test') diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java index fca1a4d93..b6c15231c 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java @@ -154,8 +154,8 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase { static void testKeyEventAutoRepeat(Robot robot, NEWTKeyAdapter keyAdapter, int loops, int pressDurationMS) { System.err.println("KEY Event Auto-Repeat Test: "+loops); - EventObject[][] first = new EventObject[loops][3]; - EventObject[][] last = new EventObject[loops][3]; + EventObject[][] first = new EventObject[loops][2]; + EventObject[][] last = new EventObject[loops][2]; keyAdapter.reset(); int firstIdx = 0; @@ -175,11 +175,9 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase { final List keyEvents = keyAdapter.getQueued(); first[i][0] = (KeyEvent) keyEvents.get(firstIdx+0); first[i][1] = (KeyEvent) keyEvents.get(firstIdx+1); - first[i][2] = (KeyEvent) keyEvents.get(firstIdx+2); - firstIdx = keyEvents.size() - 3; + firstIdx = keyEvents.size() - 2; last[i][0] = (KeyEvent) keyEvents.get(firstIdx+0); last[i][1] = (KeyEvent) keyEvents.get(firstIdx+1); - last[i][2] = (KeyEvent) keyEvents.get(firstIdx+2); System.err.println("+++ KEY Event Auto-Repeat END Input Loop: "+i); // add a pair of normal press/release in between auto-repeat! @@ -237,22 +235,12 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase { Assert.assertTrue("2nd Shall be RELEASED, but is "+e, KeyEvent.EVENT_KEY_RELEASED == e.getEventType() ); Assert.assertTrue("2nd Shall be AR, but is "+e, 0 != ( InputEvent.AUTOREPEAT_MASK & e.getModifiers() ) ); - e = (KeyEvent) first[i][2]; - Assert.assertTrue("3rd Shall be A, but is "+e, KeyEvent.VK_A == e.getKeyCode() ); - Assert.assertTrue("3rd Shall be PRESSED, but is "+e, KeyEvent.EVENT_KEY_PRESSED == e.getEventType() ); - Assert.assertTrue("3rd Shall be AR, but is "+e, 0 != ( InputEvent.AUTOREPEAT_MASK & e.getModifiers() ) ); - e = (KeyEvent) last[i][0]; - Assert.assertTrue("last-2 Shall be A, but is "+e, KeyEvent.VK_A == e.getKeyCode() ); - Assert.assertTrue("last-2 Shall be RELEASED, but is "+e, KeyEvent.EVENT_KEY_RELEASED == e.getEventType() ); - Assert.assertTrue("last-2 Shall be AR, but is "+e, 0 != ( InputEvent.AUTOREPEAT_MASK & e.getModifiers() ) ); - - e = (KeyEvent) last[i][1]; Assert.assertTrue("last-1 Shall be A, but is "+e, KeyEvent.VK_A == e.getKeyCode() ); Assert.assertTrue("last-1 Shall be PRESSED, but is "+e, KeyEvent.EVENT_KEY_PRESSED == e.getEventType() ); Assert.assertTrue("last-1 Shall be AR, but is "+e, 0 != ( InputEvent.AUTOREPEAT_MASK & e.getModifiers() ) ); - e = (KeyEvent) last[i][2]; + e = (KeyEvent) last[i][1]; Assert.assertTrue("last-0 Shall be A, but is "+e, KeyEvent.VK_A == e.getKeyCode() ); Assert.assertTrue("last-2 Shall be RELEASED, but is "+e, KeyEvent.EVENT_KEY_RELEASED == e.getEventType() ); Assert.assertTrue("last-0 Shall not be AR, but is "+e, 0 == ( InputEvent.AUTOREPEAT_MASK & e.getModifiers() ) ); -- cgit v1.2.3