Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 ebf443a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 5 additions & 4 deletions test/jdk/java/foreign/TestArrays.java
Expand Up @@ -24,7 +24,7 @@

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

import jdk.incubator.foreign.MemoryAddress;
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions test/jdk/java/foreign/TestByteBuffer.java
Expand Up @@ -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
*/


Expand Down Expand Up @@ -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();
}
}
Expand Down

1 comment on commit ebf443a

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on ebf443a Sep 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.