Module Name: src
Committed By: rillig
Date: Sun Sep 5 21:57:57 UTC 2021
Modified Files:
src/tests/lib/libc/stdio: h_testnumbers.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/stdio/h_testnumbers.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libc/stdio/h_testnumbers.c
diff -u src/tests/lib/libc/stdio/h_testnumbers.c:1.1 src/tests/lib/libc/stdio/h_testnumbers.c:1.2
--- src/tests/lib/libc/stdio/h_testnumbers.c:1.1 Thu Jul 8 09:07:46 2021
+++ src/tests/lib/libc/stdio/h_testnumbers.c Sun Sep 5 21:57:57 2021
@@ -9,7 +9,8 @@ main(void)
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;