On Fri, 24 Jul 2026 14:56:44 GMT, Jorn Vernee <[email protected]> wrote:

> This PR is carefully arranged into 4 different commits:
> 
> 1. The raw output of the JUnit conversion tool 
> (https://github.com/openjdk/jdk/commit/e6d81b314029f7c8b2942dd2ffe1d49f9d99434d)
> 2. Changing `assertThrows` to use static imports like the other asserts 
> (https://github.com/openjdk/jdk/commit/1fafd582524ca45da4d39a3c85a12a1fad640e1f)
> 3. Tweaks to make the tests actually pass 
> (https://github.com/openjdk/jdk/commit/d0632787aa9944c91408955fc9a1ab7ac8baab45)
> 4. Reducing the scope of `assertThrows` to cover only the lines that are 
> actually expected to throw. I felt that his was needed to make some of the 
> changes more 'sane', instead of just having the `assertThrows` cover the 
> entire method body. 
> (https://github.com/openjdk/jdk/commit/80d4b52a8a9ad22b627cee976edca9d1a033ec4c)
> 
> It's probably easiest to review the individual commits. (1) and (2) and (4) 
> are fairly mechanical changes, so the interesting thing to look at is (3).
> 
> Depends on: https://github.com/openjdk/jdk/pull/32014
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

test/jdk/java/foreign/TestIllegalLink.java line 80:

> 78:     @MethodSource("downcallOnlyOptions")
> 79:     public void testIllegalUpcallOptions(Linker.Option 
> downcallOnlyOption) {
> 80:         assertThrows(IllegalArgumentException.class, () -> {

Could we check the exception message here as well?

test/jdk/java/foreign/TestSegments.java line 103:

> 101:     @Test
> 102:     public void testAllocateTooBig() {
> 103:         assertThrows(OutOfMemoryError.class,

On a 32-bit architecture, would not an IAE be thrown here? If so, we could add 
a small helper method: `assertThrowsEither()`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32042#discussion_r3852519641
PR Review Comment: https://git.openjdk.org/jdk/pull/32042#discussion_r3852497812

Reply via email to