< prev index next >

test/jdk/java/foreign/TestCondy.java

Print this page
@@ -37,11 +37,19 @@
  import java.lang.invoke.MethodHandles;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.List;
  
- import static jdk.incubator.foreign.CLinker.*;
+ import static jdk.incubator.foreign.ValueLayout.ADDRESS;
+ import static jdk.incubator.foreign.ValueLayout.JAVA_BOOLEAN;
+ import static jdk.incubator.foreign.ValueLayout.JAVA_BYTE;
+ import static jdk.incubator.foreign.ValueLayout.JAVA_CHAR;
+ import static jdk.incubator.foreign.ValueLayout.JAVA_DOUBLE;
+ import static jdk.incubator.foreign.ValueLayout.JAVA_FLOAT;
+ import static jdk.incubator.foreign.ValueLayout.JAVA_INT;
+ import static jdk.incubator.foreign.ValueLayout.JAVA_LONG;
+ import static jdk.incubator.foreign.ValueLayout.JAVA_SHORT;
  import static org.testng.Assert.assertEquals;
  
  public class TestCondy {
  
      @Test(dataProvider = "constables")

@@ -51,18 +59,19 @@
          assertEquals(result, constable);
      }
  
  
      private static final MemoryLayout[] constants = {
-         C_CHAR,
-         C_SHORT,
-         C_INT,
-         C_LONG,
-         C_LONG_LONG,
-         C_FLOAT,
-         C_DOUBLE,
-         C_POINTER
+         JAVA_BOOLEAN,
+         JAVA_CHAR,
+         JAVA_BYTE,
+         JAVA_SHORT,
+         JAVA_INT,
+         JAVA_FLOAT,
+         JAVA_LONG,
+         JAVA_DOUBLE,
+         ADDRESS
      };
  
      @DataProvider
      public static Object[][] constables() {
          List<Constable> testValues = new ArrayList<>();

@@ -76,10 +85,10 @@
              testValues.add(MemoryLayout.sequenceLayout(ml));
              testValues.add(MemoryLayout.sequenceLayout(10, ml));
          }
  
          testValues.add(FunctionDescriptor.ofVoid(constants));
-         testValues.add(FunctionDescriptor.of(C_CHAR, constants));
+         testValues.add(FunctionDescriptor.of(JAVA_BYTE, constants));
  
          return testValues.stream().map(e -> new Object[] { e }).toArray(Object[][]::new);
      }
  }
< prev index next >