RFR(L): 8229186: Improve error messages for TestStringIntrinsics failures
Evgeny Nikitin
evgeny.nikitin at oracle.com
Mon May 18 14:46:58 UTC 2020
Hi,
Bug: https://bugs.openjdk.java.net/browse/JDK-8229186
Webrev: http://cr.openjdk.java.net/~enikitin/8229186/webrev.00/
Error reporting was improved by writing a C-style escaped string
representations for the variables passed to the methods being tested.
For array comparisons, a dedicated diff-formatter was implemented.
Sample output for comparing byte arrays (with artificial failure):
----------System.err:(21/1553)----------
Result: (false) of 'arrayEqualsB' is not equal to expected (true)
Arrays differ starting from [index: 7]:
... 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, ...
... 5, 6, 125, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, ...
^^^^
java.lang.RuntimeException: Result: (false) of 'arrayEqualsB' is not
equal to expected (true)
at
compiler.intrinsics.string.TestStringIntrinsics.invokeAndCheckArrays(TestStringIntrinsics.java:273)
at ... stack trace continues - E.N.
Sample output for comparing char arrays:
----------System.err:(21/1579)*----------
Result: (false) of 'arrayEqualsC' is not equal to expected (true)
Arrays differ starting from [index: 7]:
... \\u0005, \\u0006, \\u0007, \\u0008, \\u0009, \\n, \\u000B, \\u000C,
\\r, \\u000E, ...
... \\u0005, \\u0006, }, \\u0008, \\u0009, \\n, \\u000B, \\u000C,
\\r, \\u000E, ...
^^^^^^^
java.lang.RuntimeException: Result: (false) of 'arrayEqualsC' is not
equal to expected (true)
at
compiler.intrinsics.string.TestStringIntrinsics.invokeAndCheckArrays(TestStringIntrinsics.java:280)
at
... and so on - E.N.
Please review.
Thanks in advance,
/Evgeny Nikitin.
More information about the hotspot-dev
mailing list