strtoumax: fix typo in previous commit.
[gnulib.git] / tests / test-getdtablesize.c
index 577d329..b371ccf 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of getdtablesize() function.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008-2013 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
 
 #include <unistd.h>
 
-#include <stdio.h>
-#include <stdlib.h>
-
-#define ASSERT(expr) \
-  do                                                                         \
-    {                                                                        \
-      if (!(expr))                                                           \
-        {                                                                    \
-          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                   \
-          abort ();                                                          \
-        }                                                                    \
-    }                                                                        \
-  while (0)
+#include "signature.h"
+SIGNATURE_CHECK (getdtablesize, int, (void));
+
+#include "macros.h"
 
 int
 main (int argc, char *argv[])
 {
   ASSERT (getdtablesize () >= 3);
+  ASSERT (dup2 (0, getdtablesize() - 1) == getdtablesize () - 1);
+  ASSERT (dup2 (0, getdtablesize()) == -1);
 
   return 0;
 }