[foreign-memaccess+abi] RFR: 8299730: Add trivial call linker option [v3]
Jorn Vernee
jvernee at openjdk.org
Tue Jan 24 20:10:24 UTC 2023
On Tue, 24 Jan 2023 19:49:03 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> test/jdk/java/foreign/trivial/TestTrivial.java line 46:
>>
>>> 44: import static org.testng.Assert.assertEquals;
>>> 45:
>>> 46: public class TestTrivial extends NativeTestHelper {
>>
>> Should we perhaps have another subclass of `TestDowncallBase` to test all combinations - just in case?
>
> Seems like overkill, tbh, since `trivial` doesn't affect any of the classification logic. We're already testing all the cases that are handled differently by the downcall stub (where `trivial` does matter).
>
> Also, ultimately the stuff covered by TestDowncall is limited (no unions, nested structs, array members. Limited set of primitive types). I think long term I'd rather see some kind of fuzzing-based test, where we generate an arbitrary FunctionDescriptor/linker options/C function, and then try to link and call that. But this requires generating and compiling C code on the fly during the tests (which I expect will be problematic to get working in some configurations, like people running the tests directly with jtreg).
I could maybe add a few more test cases, to the tune of what we do for the CaptureCallState tests. But my feeling is that if we go to the level of TestDowncall, we don't really get any more coverage from that.
-------------
PR: https://git.openjdk.org/panama-foreign/pull/771
More information about the panama-dev
mailing list