]> Savannah Git Hosting - gnulib.git/commitdiff
xstrtol, xstrtoll tests: Fix test failures.
authorBruno Haible <bruno@clisp.org>
Mon, 5 Aug 2024 19:31:28 +0000 (21:31 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 5 Aug 2024 19:31:28 +0000 (21:31 +0200)
* 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.

ChangeLog
tests/test-xstrtol.c
tests/test-xstrtoll.c

index e2fbd28f72a396d4830eba27c97f35bddb7b5dc6..23f13aed617a175bcd786e4f887b28fd82d55407 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-08-05  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        gnulib-tool.py: Fix testdirs created with --without-tests.
index cbb394912e42a2e2ca304886876942a66ba23fc8..31eff393188ac053b8f14c7a28ef638440f27cfd 100644 (file)
@@ -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);
index 47a552ebff8ab5e3aee53f2663b2a57470270794..8da0e3bed19371fc4eb68dd9e3aceff4b1846b7f 100644 (file)
@@ -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"