]> Savannah Git Hosting - gnulib.git/commitdiff
vasnprintf tests: Add a test case that showcases a Solaris bug.
authorBruno Haible <bruno@clisp.org>
Sat, 12 Apr 2025 21:48:28 +0000 (23:48 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 12 Apr 2025 21:48:28 +0000 (23:48 +0200)
* tests/test-vasnprintf-posix2.c (main): Add one more %'g test.
* tests/test-vasnwprintf-posix2.c (main): Likewise.

ChangeLog
tests/test-vasnprintf-posix2.c
tests/test-vasnwprintf-posix2.c

index 33cae49b8e1eb331681c9f1113cd269fe4fdf43d..dbd51b54020554646fc03940d970613b195c3e55 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-12  Bruno Haible  <bruno@clisp.org>
+
+       vasnprintf tests: Add a test case that showcases a Solaris bug.
+       * tests/test-vasnprintf-posix2.c (main): Add one more %'g test.
+       * tests/test-vasnwprintf-posix2.c (main): Likewise.
+
 2025-04-12  Collin Funk  <collin.funk1@gmail.com>
 
        stdlib: Avoid syntax errors in libstdc++ header files on AIX.
index b0ba95b6677bbffe24ae9891424d91e5e8fab6b1..55e26d666fd363674cd8314d674e03a4c86c1e56 100644 (file)
@@ -439,6 +439,13 @@ main (int argc, char *argv[])
         }
       free (result);
     }
+    /* This test used to crash in the Solaris libc, for all Solaris versions.
+       <https://www.illumos.org/issues/17383>  */
+    {
+      size_t length;
+      char *result = asnprintf (NULL, &length, "%'.500Lg\n", 42351647362715016953416125033982098102569580078125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0L);
+      free (result);
+    }
   }
 
   return test_exit_status;
index 4ccbe079aec5c6f2c3e513ee028ca1ea2f729cc5..394e872e26587f2eb0833091283e797f044a605e 100644 (file)
@@ -345,6 +345,11 @@ main (int argc, char *argv[])
               && wcscmp (result + 7, L"000") == 0);
       free (result);
     }
+    {
+      size_t length;
+      wchar_t *result = asnwprintf (NULL, &length, L"%'.500Lg\n", 42351647362715016953416125033982098102569580078125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0L);
+      free (result);
+    }
   }
 
   return test_exit_status;