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

Jorn Vernee jvernee at openjdk.org
Tue Feb 21 17:20:43 UTC 2023


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

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

Commit messages:
 - Adjust TestMatrix
 - print and make configurable the default random seed
 - Refactor CallGeneratorHelper-based tests to use genTestValue

Changes: https://git.openjdk.org/panama-foreign/pull/804/files
 Webrev: https://webrevs.openjdk.org/?repo=panama-foreign&pr=804&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8302990
  Stats: 431 lines in 12 files changed: 92 ins; 256 del; 83 mod
  Patch: https://git.openjdk.org/panama-foreign/pull/804.diff
  Fetch: git fetch https://git.openjdk.org/panama-foreign pull/804/head:pull/804

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


More information about the panama-dev mailing list