< prev index next >

test/jdk/java/lang/invoke/VarHandles/VarHandleTestExact.java

Print this page
*** 45,10 ***
--- 45,11 ---
   *   -Djava.lang.invoke.VarHandle.VAR_HANDLE_IDENTITY_ADAPT=true
   *   VarHandleTestExact
   */
  
  import jdk.incubator.foreign.MemoryHandles;
+ import jdk.incubator.foreign.MemoryLayout;
  import jdk.incubator.foreign.MemorySegment;
  import jdk.incubator.foreign.ResourceScope;
  import jdk.internal.access.foreign.MemorySegmentProxy;
  import org.testng.SkipException;
  import org.testng.annotations.DataProvider;

*** 168,11 ***
              ".*\\Qexpected (ByteBuffer,int," + arrayClass.componentType().getSimpleName() + ")void \\E.*");
      }
  
      @Test(dataProvider = "dataSetMemorySegment")
      public void testExactSegmentSet(Class<?> carrier, Object testValue, SetSegmentX setter) {
!         VarHandle vh = MemoryHandles.varHandle(carrier, ByteOrder.nativeOrder());
          try (ResourceScope scope = ResourceScope.newConfinedScope()) {
              MemorySegment seg = MemorySegment.allocateNative(8, scope);
              doTest(vh,
                  tvh -> tvh.set(seg, 0L, testValue),
                  tvh -> setter.set(tvh, seg, 0L, testValue),
--- 169,11 ---
              ".*\\Qexpected (ByteBuffer,int," + arrayClass.componentType().getSimpleName() + ")void \\E.*");
      }
  
      @Test(dataProvider = "dataSetMemorySegment")
      public void testExactSegmentSet(Class<?> carrier, Object testValue, SetSegmentX setter) {
!         VarHandle vh = MemoryHandles.varHandle(MemoryLayout.valueLayout(carrier, ByteOrder.nativeOrder()));
          try (ResourceScope scope = ResourceScope.newConfinedScope()) {
              MemorySegment seg = MemorySegment.allocateNative(8, scope);
              doTest(vh,
                  tvh -> tvh.set(seg, 0L, testValue),
                  tvh -> setter.set(tvh, seg, 0L, testValue),
< prev index next >