RFR: 8313621: test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal should use RandomFactory

Brian Burkhalter bpb at openjdk.org
Wed Oct 11 15:26:08 UTC 2023


On Wed, 11 Oct 2023 10:25:39 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> Change test to use `RandomFactory` instead of `new Random()` and convert it to JUnit 5.
>
> test/jdk/jdk/internal/math/FloatingDecimal/TestFloatingDecimal.java line 115:
> 
>> 113:         }
>> 114: 
>> 115:         assertTrue(failures == 0);
> 
> Suggestion:
> 
>         assertEquals(0, failures);
> 
> Gives a better message because it explicitly knows both the expected value (1st arg) and the actual value (2nd arg).
> Similarly for other `assertTrue` usages below).

Good suggestion! Thanks. I'll change it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16130#discussion_r1355213567


More information about the core-libs-dev mailing list