RFR(S): 8064953: Asserts.assert* should print values
Staffan Larsen
staffan.larsen at oracle.com
Fri Nov 28 06:44:36 UTC 2014
Tatiana,
This looks good but can lead to some strange messages when paired with the messages that are in use for some of the existing assert calls.
For example this usage:
testlibrary_tests/whitebox/vm_flags/VmFlagTest.java:
Asserts.assertEQ(tests.length, results.length, "[TESTBUG] tests.length != results.length”);
will now lead to a message looking like this:
[TESTBUG] tests.length != results.length Expected that 1 == 2
Could we instead change the output to look more like this?:
[TESTBUG] tests.length != results.length (assert failed: 1 == 2)
Thanks,
/Staffan
> On 27 nov 2014, at 16:53, Tatiana Pivovarova <tatiana.pivovarova at oracle.com> wrote:
>
> Hi,
>
> please review this enhancement patch.
>
> bugid: https://bugs.openjdk.java.net/browse/JDK-8064953
> webrev: http://cr.openjdk.java.net/~iignatyev/tpivovarova/8064953/webrev.00/
>
> Problem:
> 'assert*' methods which get message as 'msg' parameter don't print compared parameter's values. These values must be printed in any case: with or without 'msg' parameter.
>
> Solution:
> This enhancement force 'assert*' methods to print compared values.
>
> Testing: Manual. I run all tests in hotspot/test/* on the latest jdk.
>
> Thanks,
> Tatiana
More information about the hotspot-compiler-dev
mailing list