Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8253590: java/foreign tests are still failing on x86_32 after foreign…
…-memaccess integration

Reviewed-by: psandoz
  • Loading branch information
mcimadamore committed Sep 29, 2020
1 parent 431338b commit ebf443a16fb71486037e39996cd0439576927d8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
@@ -24,7 +24,7 @@

/*
* @test
* @run testng TestArrays
* @run testng/othervm -Dforeign.restricted=permit TestArrays
*/

import jdk.incubator.foreign.MemoryAddress;
@@ -105,10 +105,11 @@ public void testArrays(Consumer<MemoryAddress> init, SequenceLayout layout) {
}
}

@Test(expectedExceptions = { UnsupportedOperationException.class,
IllegalArgumentException.class })
@Test(expectedExceptions = UnsupportedOperationException.class)
public void testTooBigForArray() {
MemorySegment.allocateNative((long) Integer.MAX_VALUE * 2).toByteArray();
try (MemorySegment segment = MemorySegment.ofNativeRestricted(MemoryAddress.NULL, (long)Integer.MAX_VALUE + 10L, null, null, null)) {
segment.toByteArray();
}
}

@Test(expectedExceptions = IllegalStateException.class)
@@ -27,7 +27,7 @@
* @test
* @modules java.base/sun.nio.ch
* jdk.incubator.foreign/jdk.internal.foreign
* @run testng TestByteBuffer
* @run testng/othervm -Dforeign.restricted=permit TestByteBuffer
*/


@@ -458,10 +458,9 @@ public void testBufferOnClosedScope() {
byteBuffer.get(); // should throw
}

@Test(expectedExceptions = { UnsupportedOperationException.class,
IllegalArgumentException.class })
@Test(expectedExceptions = UnsupportedOperationException.class)
public void testTooBigForByteBuffer() {
try (MemorySegment segment = MemorySegment.allocateNative((long)Integer.MAX_VALUE + 10L)) {
try (MemorySegment segment = MemorySegment.ofNativeRestricted(MemoryAddress.NULL, (long)Integer.MAX_VALUE + 10L, null, null, null)) {
segment.asByteBuffer();
}
}

0 comments on commit ebf443a

Please sign in to comment.