[foreign-memaccess+abi] RFR: 8302990: Reduce duplication in test code

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Feb 22 12:52:12 UTC 2023


On Tue, 21 Feb 2023 14:11:40 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> Change existing CallGeneratorHelper-based tests to use the new genTestValue/makeArgSaverCB method that was added as part of better testing for nested structs/unions. The new methods have a generic enough API so that each use-case can be served, and allows removing a bunch of code which generates test values, while at the same time making the test value generation random, which has a chance in the long term to find interesting failures for certain values.
> 
> Two additional things in this patch:
> - I've removed the `ABI` field in `TestUpcallBase` in favor of using the already existing `Linker` field in `NativeTestHelper`.
> - I've changed the code that computes a padded layout for structs to call the method in `Utils` we have for that. This also addresses https://bugs.openjdk.org/browse/JDK-8293827

Nice cleanup!

-------------

Marked as reviewed by mcimadamore (Committer).

PR: https://git.openjdk.org/panama-foreign/pull/804


More information about the panama-dev mailing list