RFR: 8340493: Fix some Asserts failure messages [v2]

Valerie Peng valeriep at openjdk.org
Wed Dec 18 02:19:48 UTC 2024


On Tue, 17 Dec 2024 15:07:26 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> `Asserts.assertNotEquals` shows "expected 12345 to not equal 12345" which sounds redundant, just say "expected not equals but was 12345".
>> 
>> `Asserts.assertEqualsByteArray` uses the words "expected... to equal...". Modify it to follow the `assertEquals` style ""expected... but was...".
>
> Weijun Wang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Merge branch 'master' into 8340493
>  - rename to expected, unexpected, and actual
>  - the fix

test/lib/jdk/test/lib/Asserts.java line 244:

> 242:      * @see #assertEqualsByteArray(byte[], byte[], String)
> 243:      */
> 244:     public static void assertEqualsByteArray(byte[] expected, byte[] actual) {

Based on [ML_KEM_Test.java](https://java.se.oracle.com/source/xref/jdk-jdk/jdk-open/test/jdk/sun/security/provider/acvp/ML_KEM_Test.java) and [ML_DSA_Test.java](https://java.se.oracle.com/source/xref/jdk-jdk/jdk-open/test/jdk/sun/security/provider/acvp/ML_DSA_Test.java), it looks like the first argument should be actual and the 2nd argument is expected.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21101#discussion_r1889503130


More information about the core-libs-dev mailing list