From: Simon Ruderich Date: Mon, 17 Jun 2013 21:28:07 +0000 (+0200) Subject: tests/example.c: Use errno = ENOMEM. X-Git-Tag: 0.1~33 X-Git-Url: https://ruderich.org/simon/gitweb/?p=coloredstderr%2Fcoloredstderr.git;a=commitdiff_plain;h=85699d0263e9cd5014ea45e38cb9cd79284fc39b tests/example.c: Use errno = ENOMEM. The output from errno = 0 is less portable. --- diff --git a/tests/example.c b/tests/example.c index b1d42e3..fc5c01e 100644 --- a/tests/example.c +++ b/tests/example.c @@ -32,7 +32,7 @@ int main(int argc, char **argv unused) { printf("write to stdout\n"); fflush(stdout); - errno = 0; + errno = ENOMEM; perror("error!"); write(STDERR_FILENO, "write to stderr 2", 17); diff --git a/tests/example.expected b/tests/example.expected index ecd2461..72a30ac 100644 --- a/tests/example.expected +++ b/tests/example.expected @@ -1,6 +1,6 @@ >STDERR>write to stderr: 1 STDERR>error!: Success +>STDERR>error!: Cannot allocate memory STDERR>write to stderr 2STDERR> STDERR>more on stderr diff --git a/tests/example_environment_empty.expected b/tests/example_environment_empty.expected index 2a7f5a1..0feb438 100644 --- a/tests/example_environment_empty.expected +++ b/tests/example_environment_empty.expected @@ -1,6 +1,6 @@ write to stderr: 1 write to stdout -error!: Success +error!: Cannot allocate memory write to stderr 2write to stdout 2 more on stderr