X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-pipe.c;h=2dcab58b270a470bf5a360837ad4852a25b12a0d;hb=6d273bef42e648ae9bd1d60923d2a4c8fc5dca94;hp=404534da2bf5d0defbd0f8757f0b685c0d115680;hpb=b80176069521ff306b2b81ef0a9abfa8d741ada7;p=gnulib.git diff --git a/tests/test-pipe.c b/tests/test-pipe.c index 404534da2..2dcab58b2 100644 --- a/tests/test-pipe.c +++ b/tests/test-pipe.c @@ -1,5 +1,5 @@ /* Test of create_pipe_bidi/wait_subprocess. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,19 +33,10 @@ duplicate the original stderr. */ #define BACKUP_STDERR_FILENO 10 -static FILE *myerr; +#define ASSERT_STREAM myerr +#include "macros.h" -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (myerr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (myerr); \ - abort (); \ - } \ - } \ - while (0) +static FILE *myerr; /* Code executed by the child process. argv[1] = "child". */ static int @@ -199,10 +190,10 @@ main (int argc, char *argv[]) if (strcmp (argv[1], "child") == 0) { /* fd 2 might be closed, but fd BACKUP_STDERR_FILENO is the original - stderr. */ + stderr. */ myerr = fdopen (BACKUP_STDERR_FILENO, "w"); if (!myerr) - return 2; + return 2; return child_main (argc, argv); } /* We might close fd 2 later, so save it in fd 10. */