< prev index next >

test/jdk/tools/jextract/test8244412/LibTest8244412Test.java

Print this page
*** 21,14 ***
   * questions.
   */
  
  
  import jdk.incubator.foreign.MemoryAddress;
- import jdk.incubator.foreign.NativeAllocationScope;
  
  import org.testng.annotations.Test;
  import test.jextract.test8244412.Clong_long;
  import static org.testng.Assert.assertEquals;
  import static org.testng.Assert.assertTrue;
  import static test.jextract.test8244412.test8244412_h.*;
  
  /*
--- 21,14 ---
   * questions.
   */
  
  
  import jdk.incubator.foreign.MemoryAddress;
  
  import org.testng.annotations.Test;
  import test.jextract.test8244412.Clong_long;
+ import test.jextract.test8244412.CScope;
  import static org.testng.Assert.assertEquals;
  import static org.testng.Assert.assertTrue;
  import static test.jextract.test8244412.test8244412_h.*;
  
  /*

*** 41,11 ***
   * @run testng/othervm -Dforeign.restricted=permit LibTest8244412Test
   */
  public class LibTest8244412Test {
      @Test
      public void test() {
!         try (var scope = NativeAllocationScope.unboundedScope()) {
              var addr = Cmysize_t.allocate(0L, scope);
              assertEquals(Cmysize_t.get(addr), 0L);
              Cmysize_t.set(addr, 13455566L);
              assertEquals(Cmysize_t.get(addr), 13455566L);
              assertTrue(Cmysize_t.sizeof() == Clong_long.sizeof());
--- 41,11 ---
   * @run testng/othervm -Dforeign.restricted=permit LibTest8244412Test
   */
  public class LibTest8244412Test {
      @Test
      public void test() {
!         try (var scope = new CScope()) {
              var addr = Cmysize_t.allocate(0L, scope);
              assertEquals(Cmysize_t.get(addr), 0L);
              Cmysize_t.set(addr, 13455566L);
              assertEquals(Cmysize_t.get(addr), 13455566L);
              assertTrue(Cmysize_t.sizeof() == Clong_long.sizeof());
< prev index next >