open: detect FreeBSD bug
[gnulib.git] / tests / test-fcntl-safer.c
index 33c7c2c..15f6e2c 100644 (file)
 
 #include "fcntl--.h"
 
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define ASSERT(expr) \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
+  while (0)
+
 #define BASE "test-fcntl-safer.t"
 
 #include "test-open.h"
@@ -27,5 +45,5 @@
 int
 main (void)
 {
-  return test_open ();
+  return test_open (open, true);
 }