34 * @modules jdk.jextract
35 * @build JextractToolRunner
36 * @run testng ArrayTest
37 */
38 public class ArrayTest extends JextractToolRunner {
39 @Test
40 public void arrayInStruct() {
41 Path clzPath = getOutputFilePath("tmp.jar");
42 checkSuccess(null,"-o", clzPath.toString(),
43 getInputFilePath("arrayTest.h").toString());
44 Class<?> cls = loadClass("arrayTest", clzPath);
45
46 Class<?>[] inners = cls.getDeclaredClasses();
47 // FIXME: should really be two without duplicate callback
48 assertEquals(inners.length, 3);
49
50 Class<?> struct = findClass(inners, "EndWithArray");
51 NativeStruct ns = struct.getAnnotation(NativeStruct.class);
52 assertNotNull(ns);
53
54 Method m = findMethod(cls, "construct", int.class, int.class, java.foreign.memory.Array.class);
55 assertNotNull(m);
56
57 deleteFile(clzPath);
58 }
59 }
|
34 * @modules jdk.jextract
35 * @build JextractToolRunner
36 * @run testng ArrayTest
37 */
38 public class ArrayTest extends JextractToolRunner {
39 @Test
40 public void arrayInStruct() {
41 Path clzPath = getOutputFilePath("tmp.jar");
42 checkSuccess(null,"-o", clzPath.toString(),
43 getInputFilePath("arrayTest.h").toString());
44 Class<?> cls = loadClass("arrayTest", clzPath);
45
46 Class<?>[] inners = cls.getDeclaredClasses();
47 // FIXME: should really be two without duplicate callback
48 assertEquals(inners.length, 3);
49
50 Class<?> struct = findClass(inners, "EndWithArray");
51 NativeStruct ns = struct.getAnnotation(NativeStruct.class);
52 assertNotNull(ns);
53
54 Method m = findMethod(cls, "construct", int.class, int.class, java.foreign.memory.Pointer.class);
55 assertNotNull(m);
56
57 deleteFile(clzPath);
58 }
59 }
|