aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-06-17 11:19:05 +0200
committerSven Gothel <[email protected]>2013-06-17 11:19:05 +0200
commitc7e53e52b03afbaa6fe02a2ee5a4c5b6e5ed9f5a (patch)
tree5fa982386ee83b8bdcb2858457d09a757d36dc24
parentbdfb74818aa224bd96a15f232f417e921e0d8f63 (diff)
Fix TestNewtKeyEventAutoRepeatAWT (Bug 688): Reduce head/tail event check to 2 events (Windows can't produce AR)
-rw-r--r--make/scripts/tests.sh4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java20
2 files changed, 6 insertions, 18 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index bf8615d6e..b5fb6ccb2 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -467,11 +467,11 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.newt.TestFocus01SwingAWTRobot $*
#testawt com.jogamp.opengl.test.junit.newt.TestFocus02SwingAWTRobot $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyEventOrderAWT $*
-#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyEventAutoRepeatAWT $*
+testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyEventAutoRepeatAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyPressReleaseUnmaskRepeatAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodesAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtKeyCodeModifiersAWT $*
-testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNEWTWindowAWT $*
+#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNEWTWindowAWT $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersAWTCanvas $*
#testawt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNewtCanvasAWT $*
#testawtswt com.jogamp.opengl.test.junit.newt.event.TestNewtEventModifiersNewtCanvasSWTAWT $*
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<EventObject> 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() ) );