Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8340693

[TestBug] Format Error in USKeyboardTest

XMLWordPrintable

    • Cause Known

      Found while converting system tests to junit5 https://github.com/openjdk/jfx/pull/1569 :
      There seems to be a format spec bug in USKeyboardTest:117
      TestLogShim.waitForLog("Key typed: %0$c", new Object[] { c });

      probably should be changed to

      TestLogShim.waitForLog("Key typed: %04X", (int)c);

      (i.e. we want to see the hex value of a char, even unprintable one)

      ```
      java.util.IllegalFormatArgumentIndexException: Illegal format argument index = 0
      at java.base/java.util.Formatter$FormatSpecifier.index(Formatter.java:2911)
      at java.base/java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2982)
      at java.base/java.util.Formatter.parse(Formatter.java:2849)
      at java.base/java.util.Formatter.format(Formatter.java:2774)
      at java.base/java.util.Formatter.format(Formatter.java:2728)
      at javafx.graphics@24-internal/com.sun.glass.ui.monocle.TestLogShim.waitForLog(TestLogShim.java:241)
      at test.robot.com.sun.glass.ui.monocle.USKeyboardTest.checkKey(USKeyboardTest.java:117)
      at test.robot.com.sun.glass.ui.monocle.USKeyboardTest.checkShift(USKeyboardTest.java:99)
      at test.robot.com.sun.glass.ui.monocle.USKeyboardTest.testShift(USKeyboardTest.java:131)
      ```

            angorya Andy Goryachev
            angorya Andy Goryachev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: