From f329eee8c5b92306ab12646580f6f3743f3ca812 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 25 Feb 2021 11:59:36 -0500 Subject: [PATCH] Send test output to stdout, not stderr debian autopkgtest instances (and maybe other test systems) will report a failure if messages are sent to stderr. Since these messages are diagnostic messages for the test suite, and not indicators of actual failure, they should go to stdout, not stderr. --- test/libgetpid.c | 4 ++-- test/librandom.c | 6 +++--- test/use_lib_getpid.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/libgetpid.c b/test/libgetpid.c index 1fb84c5..fce94ce 100644 --- a/test/libgetpid.c +++ b/test/libgetpid.c @@ -3,11 +3,11 @@ #include void getpid_func() { - fprintf(stderr, " called getpid_func()\n"); + printf(" called getpid_func()\n"); } static __attribute__((constructor)) void getpid_init() { pid_t pid = getpid(); - fprintf(stderr, " getpid() yielded %d\n", pid); + printf(" getpid() yielded %d\n", pid); } diff --git a/test/librandom.c b/test/librandom.c index d11ba23..8152776 100644 --- a/test/librandom.c +++ b/test/librandom.c @@ -2,7 +2,7 @@ #include void func() { - fprintf(stderr, " called func()\n"); + printf(" called func()\n"); } @@ -10,8 +10,8 @@ static __attribute__((constructor)) void rnd_init() { unsigned int targ; ssize_t ret = getrandom(&targ, sizeof(targ), 0); if (ret == sizeof(targ)) { - fprintf(stderr, " getrandom() yielded 0x%08x\n", targ); + printf(" getrandom() yielded 0x%08x\n", targ); } else { - fprintf(stderr, " getrandom() failed with only %zd\n", ret); + printf(" getrandom() failed with only %zd\n", ret); } } diff --git a/test/use_lib_getpid.c b/test/use_lib_getpid.c index c9f3deb..f9b5d94 100644 --- a/test/use_lib_getpid.c +++ b/test/use_lib_getpid.c @@ -7,6 +7,6 @@ int main() { pid_t pid; getpid_func(); pid = getpid(); - fprintf(stderr, " getpid() -> %d\n", pid); + printf(" getpid() -> %d\n", pid); return 0; }