From: Bruno Haible Date: Thu, 25 Jul 2024 21:45:23 +0000 (+0200) Subject: xstrtol, xstrtoll tests: Avoid test failure on FreeBSD. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0672d4868d2a2e19f031630cf72005dd26325f3;p=thirdparty%2Fgnulib.git xstrtol, xstrtoll tests: Avoid test failure on FreeBSD. * tests/test-xstrtol.c (main): Adjust expected results for FreeBSD. --- diff --git a/ChangeLog b/ChangeLog index e1f849e82c..21b1840dec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2024-07-25 Bruno Haible + xstrtol, xstrtoll tests: Avoid test failure on FreeBSD. + * tests/test-xstrtol.c (main): Adjust expected results for FreeBSD. + xstrtol, xstrtoll tests: Test behaviour for an invalid base. Reported by Alejandro Colomar in . diff --git a/tests/test-xstrtol.c b/tests/test-xstrtol.c index f83d41905f..13ee24219b 100644 --- a/tests/test-xstrtol.c +++ b/tests/test-xstrtol.c @@ -73,9 +73,15 @@ main (int argc, char **argv) char *endp = NULL; __strtol_t val = -17; strtol_error s_err = __xstrtol (input, &endp, -1, &val, "k"); +#if defined __FreeBSD__ + ASSERT (s_err == LONGINT_OK); + ASSERT (endp == input + 1); + ASSERT (val == 1024); +#else ASSERT (s_err == LONGINT_INVALID); ASSERT (endp == NULL); ASSERT (val == -17); +#endif } return test_exit_status;