Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/stdio tests/stdio: on test failure, print mor...



details:   https://anonhg.NetBSD.org/src/rev/a3c3826ab02d
branches:  trunk
changeset: 1023400:a3c3826ab02d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Sep 05 21:57:57 2021 +0000

description:
tests/stdio: on test failure, print more details

On amd64, the test stdio_intr_iofbf fails:

stdout: numbers.in...iw.ir.ir. OK
stderr: h_testnumbers: bad line 3914889

This information is not enough to get a complete picture of the
situation, so provide more details.

diffstat:

 tests/lib/libc/stdio/h_testnumbers.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 0703e1e72567 -r a3c3826ab02d tests/lib/libc/stdio/h_testnumbers.c
--- a/tests/lib/libc/stdio/h_testnumbers.c      Sun Sep 05 19:58:53 2021 +0000
+++ b/tests/lib/libc/stdio/h_testnumbers.c      Sun Sep 05 21:57:57 2021 +0000
@@ -9,7 +9,8 @@
        size_t i = 0;
        while (fgets(line, sizeof(line), stdin) != NULL) {
                if ((size_t)atoi(line) != i)
-                       errx(EXIT_FAILURE, "bad line %s\n", line);
+                       errx(EXIT_FAILURE, "bad line \"%s\", expected %zu\n",
+                           line, i);
                i++;
        }
        return EXIT_SUCCESS;



Home | Main Index | Thread Index | Old Index