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.
This commit is contained in:
Daniel Kahn Gillmor
2021-02-25 11:59:36 -05:00
parent c89582fc1f
commit f329eee8c5
3 changed files with 6 additions and 6 deletions

View File

@@ -3,11 +3,11 @@
#include <unistd.h>
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);
}

View File

@@ -2,7 +2,7 @@
#include <sys/random.h>
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);
}
}

View File

@@ -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;
}