From: Bruno Haible Date: Mon, 5 Aug 2024 19:31:28 +0000 (+0200) Subject: xstrtol, xstrtoll tests: Fix test failures. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=118bce49893863bed19366dd154845e8e93d361a;p=gnulib.git xstrtol, xstrtoll tests: Fix test failures. * tests/test-xstrtol.c (is_GNULIB_strtol): New macro. (main): Use it in the expected test results. * tests/test-xstrtoll.c (is_GNULIB_strtol): New macro. --- diff --git a/ChangeLog b/ChangeLog index e2fbd28f72..23f13aed61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-08-05 Bruno Haible + + xstrtol, xstrtoll tests: Fix test failures. + * tests/test-xstrtol.c (is_GNULIB_strtol): New macro. + (main): Use it in the expected test results. + * tests/test-xstrtoll.c (is_GNULIB_strtol): New macro. + 2024-08-05 Bruno Haible gnulib-tool.py: Fix testdirs created with --without-tests. diff --git a/tests/test-xstrtol.c b/tests/test-xstrtol.c index cbb394912e..31eff39318 100644 --- a/tests/test-xstrtol.c +++ b/tests/test-xstrtol.c @@ -28,6 +28,7 @@ # define __xstrtol xstrtol # define __strtol_t long int # define __spec "ld" +# define is_GNULIB_strtol GNULIB_defined_strtol_function #endif /* Don't show the program name in error messages. */ @@ -75,7 +76,7 @@ main (int argc, char **argv) char *endp = NULL; __strtol_t val = -17; strtol_error s_err = __xstrtol (input, &endp, -1, &val, "k"); -# if !(defined __GLIBC__ || defined __CYGWIN__) +# if !(defined __GLIBC__ || defined __CYGWIN__ || is_GNULIB_strtol) ASSERT (s_err == LONGINT_OK); ASSERT (endp == input + 1); ASSERT (val == 1024); diff --git a/tests/test-xstrtoll.c b/tests/test-xstrtoll.c index 47a552ebff..8da0e3bed1 100644 --- a/tests/test-xstrtoll.c +++ b/tests/test-xstrtoll.c @@ -1,4 +1,5 @@ #define __xstrtol xstrtoll #define __strtol_t long long int #define __spec "lld" +#define is_GNULIB_strtol GNULIB_defined_strtoll_function #include "test-xstrtol.c"