On Wed, 22 Jul 2026 16:53:37 GMT, Jorn Vernee <[email protected]> wrote:

> Copied from the JBS issue:
> 
> While converting these tests to use JUnit instead of TestNG, I noticed some 
> false positives in the following tests:
> 
> - `TestByteBuffer::testMapCustomPath` tries to provoke an 
> `UnsupportedOperationException` when calling `FileChannel::map`, but instead 
> causes one when opening the file channel.
> 
> - `TestFunctionDescriptor::testBadCarrierMethodType` looks for an 
> `IllegalArgumentException` when calling `FunctionDescriptor::toMethodType`, 
> but this method is no longer specified to throw that exception. The exception 
> instead occurs when creating the function descriptor itself.
> 
> - `testBadSequenceElementAlignmentTooBig` and `testBadStruct` in 
> `TestLayouts` try to provoke exceptions when using hyper-aligned layouts, but 
> instead trigger exceptions when using an alignment that is not a power of 2 
> in some cases.
> 
> - `TestMemoryAlignment::testUnalignedAccess` tries to provoke an exception on 
> unaligned access, but the exception is instead thrown when creating the 
> layout upfront.
> 
> - `TestSpliterator::testHyperAligned` tries to provoke an exception when 
> calling `MemorySegments::elements` with a layout that isn't aligned for that 
> segment, but instead fails when creating the layout. 
> 
> I've switched some of these to use `assertThrows` instead of 
> `expectedException`, since that can be used to more precisely check that a 
> particular line throws an exception.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: 87e206b8
Author:    Jorn Vernee <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/87e206b81e80215562bd0e7bba52efdf5ccff17c
Stats:     78 lines in 5 files changed: 27 ins; 36 del; 15 mod

8388792: False positives in jdk_foreign test suite

Reviewed-by: liach

-------------

PR: https://git.openjdk.org/jdk/pull/32014

Reply via email to