projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NEWS.stable: update
[gnulib.git]
/
tests
/
test-open.c
diff --git
a/tests/test-open.c
b/tests/test-open.c
index
c9f3641
..
37109a5
100644
(file)
--- a/
tests/test-open.c
+++ b/
tests/test-open.c
@@
-20,32
+20,30
@@
#include <fcntl.h>
#include <fcntl.h>
+#include <errno.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
-
-#if GNULIB_FCNTL_SAFER
-# include "fcntl--.h"
-#endif
+#include <unistd.h>
#define ASSERT(expr) \
#define ASSERT(expr) \
- do \
- { \
- if (!(expr)) \
- { \
+ do
\
+ {
\
+ if (!(expr))
\
+ {
\
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
- fflush (stderr); \
- abort (); \
- } \
- } \
+ fflush (stderr);
\
+ abort ();
\
+ }
\
+ }
\
while (0)
while (0)
-int
-main ()
-{
- ASSERT (open ("nonexist.ent/", O_CREAT | O_RDONLY, 0600) < 0);
- ASSERT (open ("/dev/null/", O_RDONLY) < 0);
+#define BASE "test-open.t"
- ASSERT (open ("/dev/null", O_RDONLY) >= 0);
+#include "test-open.h"
- return 0;
+int
+main (void)
+{
+ return test_open (open, true);
}
}