Skip to content

Commit

Permalink
[FFI/Test_JDK22] Add test suites intended for union
Browse files Browse the repository at this point in the history
The changes add all the same test suites intended
for union in JDK21 to JDK22 with the updated APIs
introduced in JDK22.

Signed-off-by: ChengJin01 <[email protected]>
  • Loading branch information
ChengJin01 committed Nov 2, 2023
1 parent 59eb37d commit c0f1b71
Show file tree
Hide file tree
Showing 9 changed files with 9,329 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.testng.AssertJUnit;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.VarHandle;

import java.lang.foreign.Arena;
import java.lang.foreign.Linker;
Expand Down Expand Up @@ -825,8 +824,6 @@ public void test_addDoubleAndDoublesFromUnion_Nested4DoubleStruct() throws Throw
@Test
public void test_add2DoubleStructs_returnStruct_Nested2DoubleUnion() throws Throwable {
GroupLayout structLayout = MemoryLayout.structLayout(JAVA_DOUBLE.withName("elem1"), JAVA_DOUBLE.withName("elem2"));
VarHandle doubleHandle1 = structLayout.varHandle(PathElement.groupElement("elem1"));
VarHandle doubleHandle2 = structLayout.varHandle(PathElement.groupElement("elem2"));

FunctionDescriptor fd = FunctionDescriptor.of(structLayout, structLayout, structLayout);
MemorySegment functionSymbol = nativeLibLookup.find("add2DoubleStructs_returnStruct_Nested2DoubleUnion").get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
*/
@Test(groups = { "level.sanity" })
public class UpcallMHWithUnionTests {
private static boolean isAixOS = System.getProperty("os.name").toLowerCase().contains("aix");
private static Linker linker = Linker.nativeLinker();

static {
Expand Down
4 changes: 4 additions & 0 deletions test/functional/Java21Only/testng_210.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<class name="org.openj9.test.jep442.downcall.PrimitiveTypeTests2"/>
<class name="org.openj9.test.jep442.downcall.StructTests1"/>
<class name="org.openj9.test.jep442.downcall.StructTests2"/>
<class name="org.openj9.test.jep442.downcall.UnionStructTests"/>
<class name="org.openj9.test.jep442.downcall.UnionTests"/>
</classes>
</test>
<test name="Jep442Tests_testLinkerFfi_UpCall">
Expand All @@ -48,6 +50,8 @@
<class name="org.openj9.test.jep442.upcall.UpcallMHWithMixedSigStruTests"/>
<class name="org.openj9.test.jep442.upcall.UpcallMHWithPrimTests"/>
<class name="org.openj9.test.jep442.upcall.UpcallMHWithStructTests"/>
<class name="org.openj9.test.jep442.upcall.UpcallMHWithUnionStructTests"/>
<class name="org.openj9.test.jep442.upcall.UpcallMHWithUnionTests"/>
</classes>
</test>
</suite>

Large diffs are not rendered by default.

2,512 changes: 2,512 additions & 0 deletions test/functional/Java22andUp/src/org/openj9/test/jep454/downcall/UnionTests.java

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions test/functional/Java22andUp/testng_220.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<class name="org.openj9.test.jep454.downcall.PrimitiveTypeTests2"/>
<class name="org.openj9.test.jep454.downcall.StructTests1"/>
<class name="org.openj9.test.jep454.downcall.StructTests2"/>
<class name="org.openj9.test.jep454.downcall.UnionStructTests"/>
<class name="org.openj9.test.jep454.downcall.UnionTests"/>
</classes>
</test>
<test name="Jep454Tests_testLinkerFfi_UpCall">
Expand All @@ -48,6 +50,8 @@
<class name="org.openj9.test.jep454.upcall.UpcallMHWithMixedSigStruTests"/>
<class name="org.openj9.test.jep454.upcall.UpcallMHWithPrimTests"/>
<class name="org.openj9.test.jep454.upcall.UpcallMHWithStructTests"/>
<class name="org.openj9.test.jep454.upcall.UpcallMHWithUnionStructTests"/>
<class name="org.openj9.test.jep454.upcall.UpcallMHWithUnionTests"/>
</classes>
</test>
</suite>

0 comments on commit c0f1b71

Please sign in to comment.