mirror of
https://github.com/wolfcw/libfaketime.git
synced 2026-05-17 00:26:16 +03:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user