[foreign-jextract] RFR: Test the Java VaList implementation on every platform
Jorn Vernee
jvernee at openjdk.java.net
Thu Jul 16 20:19:08 UTC 2020
Hi,
This patch re-writes the VaListTest to try and test all the implementations on the different platforms, instead of just
the implementation for the current platform.
This results in 4 different versions of each test being run; once for each platform, where the reading of the VaList is
done in Java as well, and then one native implementation (which corresponds to the status quo). The needed parameters
are injected into tests using data providers. For the struct tests this was a little tricky, since we need to inject
the platform specific C_INT/C_LONGLONG/C_FLOAT layouts into the struct layout. This resulted in the current code
complexity. (As an aside, I think local interface and methods work from Amber could really help this use-case).
Upcalls are still only tested for the current platform, since the creation of the va_list happens in native code, and
we only have access to 1 platform in that case :)
---
I've also cleaned up the sumStack test, which wasn't actually using any part of our VaList implementation (it was
testing varargs), as well as reduced some copy-pasted code which was previously used for debugging, but never collapsed
back into for-loops afterwards.
Thanks,
Jorn
-------------
Commit messages:
- Test the Java VaList implementation on every platform
Changes: https://git.openjdk.java.net/panama-foreign/pull/247/files
Webrev: https://webrevs.openjdk.java.net/panama-foreign/247/webrev.00
Stats: 515 lines in 2 files changed: 335 ins; 53 del; 127 mod
Patch: https://git.openjdk.java.net/panama-foreign/pull/247.diff
Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/247/head:pull/247
PR: https://git.openjdk.java.net/panama-foreign/pull/247
More information about the panama-dev
mailing list