RFR: 8346106: Verify.checkEQ: testing utility for recursive value verification
theoweidmannoracle
duke at openjdk.org
Wed Dec 18 07:49:39 UTC 2024
On Thu, 12 Dec 2024 15:42:29 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> In testing, we often generate "golden" values, and then compare the results with it. This requires comparison loops etc in every test. I would like to create a dedicated facility for this, to simplify testing in the future. This is also preparation for [JDK-8344942](https://bugs.openjdk.org/browse/JDK-8344942), the Template framework.
>
> I have written code like this in various tests before, see:
> `test/hotspot/jtreg/compiler/loopopts/superword/TestAlignVectorFuzzer.java`
> `./test/hotspot/jtreg/compiler/loopopts/superword/TestMemorySegment.java`
> `test/hotspot/jtreg/compiler/loopopts/superword/TestIndependentPacksWithCyclicDependency.java`.
>
> It is now time to make a proper facility, so I can save time when writing tests in the future.
>
> A related PR, for value generation: https://github.com/openjdk/jdk/pull/22716
test/hotspot/jtreg/compiler/lib/verify/Verify.java line 58:
> 56: print(a, "a " + context);
> 57: print(b, "b " + context);
> 58: throw new VerifyException("Object array null mismatch.");
Why does this message mention "array"? From what I understand, it can compare any two objects.
test/hotspot/jtreg/compiler/lib/verify/Verify.java line 93:
> 91: print(a, "a " + context);
> 92: print(b, "b " + context);
> 93: throw new VerifyException("Object array type not supported: " + ca.getName());
This pattern repeats 3 times here and also below. Maybe you want to consider to move it to a `reportError(String message, String details, a, b, context)` method?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22715#discussion_r1889746209
PR Review Comment: https://git.openjdk.org/jdk/pull/22715#discussion_r1889748642
More information about the hotspot-compiler-dev
mailing list