X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftest-pipe-filter-gi2-main.c;h=4ee8a52be28486ce3632b7474fd4bcba2a98463e;hb=ca2c85799ac5e86ba2d93a6b0628648177984e21;hp=b9a0b11a9ab209bae42e76e648779d03623e1d91;hpb=6038ee4b827caaf05fa37dbb2304fedb9d0cd6c7;p=gnulib.git diff --git a/tests/test-pipe-filter-gi2-main.c b/tests/test-pipe-filter-gi2-main.c index b9a0b11a9..4ee8a52be 100644 --- a/tests/test-pipe-filter-gi2-main.c +++ b/tests/test-pipe-filter-gi2-main.c @@ -1,6 +1,6 @@ /* Test harness for pipe-filter-gi. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2011 Free Software Foundation, Inc. Written by Paolo Bonzini , 2009. This program is free software: you can redistribute it and/or modify @@ -28,18 +28,7 @@ #include "full-write.h" #include "progname.h" - -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +#include "macros.h" /* 0.1 sec pause */ static void @@ -94,7 +83,7 @@ main (int argc, char **argv) path[0] = "/nonexistent/blah"; f = pipe_filter_gi_create ("pipe-filter-test", path[0], path, true, false, - prepare_read, ignore_done_read, NULL); + prepare_read, ignore_done_read, NULL); small_nap (); rc = pipe_filter_gi_write (f, "", 1); ASSERT (rc == 127 || rc == -1); @@ -108,7 +97,7 @@ main (int argc, char **argv) { path[0] = argv[1]; f = pipe_filter_gi_create ("pipe-filter-test", path[0], path, false, false, - prepare_read, ignore_done_read, NULL); + prepare_read, ignore_done_read, NULL); pipe_filter_gi_write_string (f, "1 -1"); ASSERT (pipe_filter_gi_close (f) == 1); printf ("Test 2 passed.\n"); @@ -121,7 +110,7 @@ main (int argc, char **argv) path[0] = argv[1]; f = pipe_filter_gi_create ("pipe-filter-test", path[0], path, false, false, - prepare_read, ignore_done_read, NULL); + prepare_read, ignore_done_read, NULL); pipe_filter_gi_write_string (f, "1 -1\n"); /* tell the child to terminate */ small_nap (); /* let the child terminate */ rc = pipe_filter_gi_write (f, " ", 1); /* write to a closed pipe */ @@ -138,7 +127,7 @@ main (int argc, char **argv) { path[0] = argv[1]; f = pipe_filter_gi_create ("pipe-filter-test", path[0], path, false, true, - prepare_read, output_done_read, NULL); + prepare_read, output_done_read, NULL); pipe_filter_gi_write_string (f, "1 50\n"); pipe_filter_gi_write_string (f, "51\n"); pipe_filter_gi_write_string (f, "100");