diff --git a/test/jdk/java/foreign/TestFill.java b/test/jdk/java/foreign/TestFill.java index e5f69587f2f..d9bde891120 100644 --- a/test/jdk/java/foreign/TestFill.java +++ b/test/jdk/java/foreign/TestFill.java @@ -87,7 +87,7 @@ final class TestFill { @MethodSource("sizes") void testReadOnly(int len) { try (var arena = Arena.ofConfined()) { - var segment = arena.allocate(10).asReadOnly(); + var segment = arena.allocate(len).asReadOnly(); assertThrows(IllegalArgumentException.class, () -> segment.fill(VALUE)); } } @@ -96,7 +96,7 @@ final class TestFill { @MethodSource("sizes") void testConfinement(int len) { try (var arena = Arena.ofConfined()) { - var segment = arena.allocate(10); + var segment = arena.allocate(len); AtomicReference ex = new AtomicReference<>(); CompletableFuture future = CompletableFuture.runAsync(() -> { try {