]> Savannah Git Hosting - gnulib.git/commitdiff
*printf-posix-tests: Strengthen tests.
authorBruno Haible <bruno@clisp.org>
Sun, 30 Jun 2024 13:47:39 +0000 (15:47 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 30 Jun 2024 13:48:14 +0000 (15:48 +0200)
* tests/test-fprintf-posix.h (test_function): Test %b directive.
* tests/test-printf-posix.h (test_function): Likewise.
* tests/test-dprintf-posix.c (test_function): Likewise.
* tests/test-printf-posix.output: Update expected test result.

ChangeLog
tests/test-dprintf-posix.c
tests/test-fprintf-posix.h
tests/test-printf-posix.h
tests/test-printf-posix.output

index dc1148d408ae6be8f91b98ac202ca9ac1519aaad..e240a5fb630b7beb4cd20e6030dbc145d099a2e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-06-30  Bruno Haible  <bruno@clisp.org>
+
+       *printf-posix-tests: Strengthen tests.
+       * tests/test-fprintf-posix.h (test_function): Test %b directive.
+       * tests/test-printf-posix.h (test_function): Likewise.
+       * tests/test-dprintf-posix.c (test_function): Likewise.
+       * tests/test-printf-posix.output: Update expected test result.
+
 2024-06-30  Bruno Haible  <bruno@clisp.org>
 
        *printf-{posix,gnu}: Tweak module descriptions.
index 83c1587daf63faa822c0bd2921add8cf82198305..4d952baa991c362390dea45e4f4fb2f2c99b99c6 100644 (file)
@@ -159,6 +159,12 @@ test_function (int (*my_dprintf) (int, const char *, ...))
   /* Precision with rounding.  */
   my_dprintf (fileno (stdout), "%.2LF %d\n", 999.996L, 33, 44, 55);
 
+  /* Test the support of the %b format directive.  */
+
+  /* This test would fail on glibc 2.34, musl libc, macOS 14,
+     FreeBSD 13.2, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.  */
+  my_dprintf (fileno (stdout), "%b %d\n", 12345, 33, 44, 55);
+
   /* Test the support of the POSIX/XSI format strings with positions.  */
 
   my_dprintf (fileno (stdout), "%2$d %1$d\n", 33, 55);
index d36305b14569c59c8f83f1bc7a28d58832759903..b5d023ff5b7a19c1d73ed7e5c8643f21eeede649 100644 (file)
@@ -147,6 +147,12 @@ test_function (int (*my_fprintf) (FILE *, const char *, ...))
   /* Precision with rounding.  */
   my_fprintf (stdout, "%.2LF %d\n", 999.996L, 33, 44, 55);
 
+  /* Test the support of the %b format directive.  */
+
+  /* This test would fail on glibc 2.34, musl libc, macOS 14,
+     FreeBSD 13.2, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.  */
+  my_fprintf (stdout, "%b %d\n", 12345, 33, 44, 55);
+
   /* Test the support of the POSIX/XSI format strings with positions.  */
 
   my_fprintf (stdout, "%2$d %1$d\n", 33, 55);
index f1cb735c9cf41660e83a0f8d58f9f10e4f5a1c69..acb4e82b26213373c8ff617bc33b92ff991b6f06 100644 (file)
@@ -149,6 +149,12 @@ test_function (int (*my_printf) (const char *, ...))
   /* Precision with rounding.  */
   my_printf ("%.2LF %d\n", 999.996L, 33, 44, 55);
 
+  /* Test the support of the %b format directive.  */
+
+  /* This test would fail on glibc 2.34, musl libc, macOS 14,
+     FreeBSD 13.2, NetBSD 10.0, OpenBSD 7.5, AIX 7.3, Solaris 11.4.  */
+  my_printf ("%b %d\n", 12345, 33, 44, 55);
+
   /* Test the support of the POSIX/XSI format strings with positions.  */
 
   my_printf ("%2$d %1$d\n", 33, 55);
index 618825bb7b966308f78d244162964bef27e77450..f60eda473af395575f6db0dd31d7af4417fc02ba 100644 (file)
@@ -37,4 +37,5 @@ inf 33
 1234 33
 999.95 33
 1000.00 33
+11000000111001 33
 55 33