getaddrinfo: Doc fix.
[pspp] / tests / test-pipe2.c
index 5eb5ec3287ebd43e815084651eb3ce1bde791c9c..ddfb819abb538f6f41ce3dce64a37a129951a5f7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of pipe2.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009-2011 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
@@ -32,18 +32,7 @@ SIGNATURE_CHECK (pipe2, int, (int[2], int));
 #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
@@ -103,7 +92,7 @@ main ()
 #else
   use_nonblocking = 0;
 #endif
-#if defined O_CLOEXEC
+#if O_CLOEXEC
     for (use_cloexec = 0; use_cloexec <= 1; use_cloexec++)
 #else
     use_cloexec = 0;
@@ -117,7 +106,7 @@ main ()
         if (use_nonblocking)
           o_flags |= O_NONBLOCK;
 #endif
-#if defined O_CLOEXEC
+#if O_CLOEXEC
         if (use_cloexec)
           o_flags |= O_CLOEXEC;
 #endif
@@ -128,8 +117,8 @@ main ()
         ASSERT (fd[0] >= 0);
         ASSERT (fd[1] >= 0);
         ASSERT (fd[0] != fd[1]);
-        ASSERT (is_open (fd[0]) >= 0);
-        ASSERT (is_open (fd[1]) >= 0);
+        ASSERT (is_open (fd[0]));
+        ASSERT (is_open (fd[1]));
         if (use_cloexec)
           {
             ASSERT (is_cloexec (fd[0]));