diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-09-13 11:55:08 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-09-13 12:25:06 +0200 |
commit | 5314d36f3d186efb05a051e80444332f743194ef (patch) | |
tree | 1c708143edfd5123358a496c22cd8a486d09fde4 | |
parent | a156fc9a5431cef6a3435e796da6eac4d34c905f (diff) | |
download | lvm2-5314d36f3d186efb05a051e80444332f743194ef.tar.gz |
tests: not redirect strderr to stdout
Errors are 'wanted' and expected in this case.
-rw-r--r-- | test/lib/not.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/lib/not.c b/test/lib/not.c index a5c52a8e6..4ce77b641 100644 --- a/test/lib/not.c +++ b/test/lib/not.c @@ -72,9 +72,12 @@ int main(int args, char **argv) { fprintf(stderr, "Could not fork\n"); return FAILURE; } else if (pid == 0) { /* child */ - if (!strcmp(argv[0], "not")) + if (!strcmp(argv[0], "not")) { val = ">1"; - else if (!strcmp(argv[0], "invalid")) + /* Redirect 'expected' error output */ + fflush(stderr); + dup2(fileno(stdout), fileno(stderr)); + } else if (!strcmp(argv[0], "invalid")) val = "3"; else if (!strcmp(argv[0], "fail")) val = "5"; |