RFR: 8285279: ArgumentsTest.set_numeric_flag_double_vm fails on some locales (again)

Ioi Lam iklam at openjdk.java.net
Mon Apr 25 23:56:55 UTC 2022


On Mon, 25 Apr 2022 23:03:29 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Please review this trivial fix for ArgumentsTest.set_numeric_flag_double_vm. If an input string is only partially accepted by `strtod()` under the current locale , `end` will point to a non-empty character. In this case, the test should treat the input as invalid.
>> 
>> Thanks to @tstuefe for providing the test scenario.
>
> test/hotspot/gtest/runtime/test_arguments.cpp line 599:
> 
>> 597:     errno = 0;
>> 598:     double expected = strtod(str, &end);
>> 599:     if (errno == 0 && end != NULL && *end == '\0') {
> 
> If end is not-empty shouldn't there be an `ASSERT_FALSE(ArgumentsTest::parse_argument(flag->name(), str)` ?

Yes, that check is on line 609 below.

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

PR: https://git.openjdk.java.net/jdk/pull/8386


More information about the hotspot-runtime-dev mailing list