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

Reviewed-by: dholmes
This commit is contained in:
Ioi Lam 2022-04-27 04:58:13 +00:00
parent cc89f1bc61
commit 4714fdcd6a

View File

@ -593,13 +593,13 @@ TEST_VM_F(ArgumentsTest, set_numeric_flag_double) {
for (uint i = 0; i < ARRAY_SIZE(more_test_strings); i++) {
const char* str = more_test_strings[i];
char* dummy;
char* end;
errno = 0;
double expected = strtod(str, &dummy);
if (errno == 0) {
double expected = strtod(str, &end);
if (errno == 0 && end != NULL && *end == '\0') {
ASSERT_TRUE(ArgumentsTest::parse_argument(flag->name(), str))
<< "Test string '" <<
str << "' did not parse for type " << flag->type_string() << ".";
str << "' did not parse for type " << flag->type_string() << ". (Expected value = " << expected << ")";
double d = flag->get_double();
ASSERT_TRUE(d == expected)
<< "Parsed number " << d << " is not the same as expected " << expected;