]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
vasnprintf-extra-tests: Move new expensive test to here.
authorBruno Haible <bruno@clisp.org>
Mon, 13 Jul 2026 20:27:16 +0000 (22:27 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 13 Jul 2026 20:45:16 +0000 (22:45 +0200)
* tests/test-vasnprintf-big.c (main): Move INT_MAX test case to here.
* tests/test-vasnprintf-posix.c (test_function): Revert last change.

ChangeLog
tests/test-vasnprintf-big.c
tests/test-vasnprintf-posix.c

index c4843bea6483259c930c24aff46ab333e6a68cbd..b476f126faf37c07ee081bf1b00011863f89000a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-07-13  Bruno Haible  <bruno@clisp.org>
+
+       vasnprintf-extra-tests: Move new expensive test to here.
+       * tests/test-vasnprintf-big.c (main): Move INT_MAX test case to here.
+       * tests/test-vasnprintf-posix.c (test_function): Revert last change.
+
 2026-07-13  Bruno Haible  <bruno@clisp.org>
 
        vasnprintf: Fix compilation error on FreeBSD, OpenBSD (regr. today).
index fc11a6e775d850ccdbc4884436dd2d1a0f8c07d5..a9969e18c7dbf8f8bdc17cc5d74a4627f8adfa4c 100644 (file)
 int
 main ()
 {
+  /* Large width given as argument.  */
+  {
+    size_t length;
+    char *result =
+      asnprintf (NULL, &length, "%*d", INT_MAX, INT_MIN);
+    if (!result)
+      ASSERT (errno == ENOMEM);
+    else
+      {
+        ASSERT (atoi (result) == INT_MIN);
+        ASSERT (length == INT_MAX);
+        ASSERT (length == strlen (result));
+        free (result);
+      }
+  }
+
+  if (test_exit_status != EXIT_SUCCESS)
+    return test_exit_status;
+
 #if PTRDIFF_MAX == INT_MAX
   fputs ("Skipping test: ptrdiff_t is not 64-bits wide\n", stderr);
   return 77;
index 98e3319920ea12b400d7a60b9d6de23c56bbf0bc..fe0a59d647af95579affe92ed5cd6990bda6165b 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <errno.h>
 #include <float.h>
-#include <limits.h>
 #include <stdarg.h>
 #include <stdcountof.h>
 #include <stddef.h>
@@ -168,25 +167,6 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
     free (result);
   }
 
-  {
-    char *expensive = getenv ("RUN_EXPENSIVE_TESTS");
-    if (expensive && streq (expensive, "yes"))
-      { /* Large width given as argument.  */
-        size_t length;
-        char *result =
-          my_asnprintf (NULL, &length, "%*d", INT_MAX, INT_MIN);
-        if (!result)
-          ASSERT (errno == ENOMEM);
-        else
-          {
-            ASSERT (atoi (result) == INT_MIN);
-            ASSERT (length == INT_MAX);
-            ASSERT (length == strlen (result));
-            free (result);
-          }
-      }
-  }
-
   /* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
      output of floating-point numbers.  */