public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] stdio-common: Fix %m sprintf test output for GNU/Hurd
@ 2021-12-27 21:11 Samuel Thibault
0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2021-12-27 21:11 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=422e4cd0ffbd71456cbefcf8027c866638c7124f
commit 422e4cd0ffbd71456cbefcf8027c866638c7124f
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Mon Dec 27 21:22:14 2021 +0100
stdio-common: Fix %m sprintf test output for GNU/Hurd
GNU/Hurd has slightly different error messages for undefined numbers,
due to the notion of error subsystems.
Diff:
---
stdio-common/tst-sprintf-errno.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/stdio-common/tst-sprintf-errno.c b/stdio-common/tst-sprintf-errno.c
index 7622fdbc48..f5b587f0fe 100644
--- a/stdio-common/tst-sprintf-errno.c
+++ b/stdio-common/tst-sprintf-errno.c
@@ -48,16 +48,26 @@ do_test (void)
TEST_COMPARE_STRING (buf, "0");
errno = -1;
+#ifdef __GNU__
+ TEST_COMPARE (sprintf (buf, "%m"), 35);
+ TEST_COMPARE_STRING (buf, "Error in unknown error system: : -1");
+#else
TEST_COMPARE (sprintf (buf, "%m"), 16);
TEST_COMPARE_STRING (buf, "Unknown error -1");
+#endif
errno = -1;
TEST_COMPARE (sprintf (buf, "%#m"), 2);
TEST_COMPARE_STRING (buf, "-1");
errno = 1002003;
+#ifdef __GNU__
+ TEST_COMPARE (sprintf (buf, "%m"), 42);
+ TEST_COMPARE_STRING (buf, "(system kern) error with unknown subsystem");
+#else
TEST_COMPARE (sprintf (buf, "%m"), 21);
TEST_COMPARE_STRING (buf, "Unknown error 1002003");
+#endif
errno = 1002003;
TEST_COMPARE (sprintf (buf, "%#m"), 7);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-27 21:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-27 21:11 [glibc] stdio-common: Fix %m sprintf test output for GNU/Hurd Samuel Thibault
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).