X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-dup3.c;h=a719234103637847b56f91941242909432747a9e;hb=2f0e0a85324a518837fca63bc696ca0ce16d9ee9;hp=9c88e75b1fc2e95cca3cd60f834469d597c04d96;hpb=b6dfa79ff86b50398ad397c4c43954d005866ce9;p=gnulib.git diff --git a/tests/test-dup3.c b/tests/test-dup3.c index 9c88e75b1..a71923410 100644 --- a/tests/test-dup3.c +++ b/tests/test-dup3.c @@ -1,5 +1,5 @@ /* Test duplicating file descriptors. - 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 @@ -21,11 +21,12 @@ #include +#include "signature.h" +SIGNATURE_CHECK (dup3, int, (int, int, int)); + #include #include #include -#include -#include #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* Get declarations of the Win32 API functions. */ @@ -34,18 +35,7 @@ #endif #include "binary-io.h" - -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +#include "macros.h" /* Return true if FD is open. */ static bool @@ -99,7 +89,7 @@ main () o_flags = 0; #if defined O_CLOEXEC if (use_cloexec) - o_flags |= O_CLOEXEC; + o_flags |= O_CLOEXEC; #endif /* Assume std descriptors were provided by invoker. */ @@ -141,9 +131,9 @@ main () ASSERT (!is_open (fd + 1)); ASSERT (is_open (fd + 2)); if (use_cloexec) - ASSERT (is_cloexec (fd + 2)); + ASSERT (is_cloexec (fd + 2)); else - ASSERT (!is_cloexec (fd + 2)); + ASSERT (!is_cloexec (fd + 2)); /* Verify that dup3 closes the previous occupant of a fd. */ ASSERT (open ("/dev/null", O_WRONLY, 0600) == fd + 1);