+2019-09-15 Bruno Haible <bruno@clisp.org>
+
+ open tests: Enhance test.
+ * tests/test-open.h (test_open): Test the creation of an executable
+ regular file. Also improve initial cleanup.
+
2019-09-15 Bruno Haible <bruno@clisp.org>
intprops tests: Avoid build failure with HP-UX cc.
test_open (int (*func) (char const *, int, ...), bool print)
{
int fd;
+
/* Remove anything from prior partial run. */
unlink (BASE "file");
+ unlink (BASE "e.exe");
+ unlink (BASE "link");
/* Cannot create directory. */
errno = 0;
ASSERT (0 <= fd);
ASSERT (close (fd) == 0);
+ /* Create an executable regular file. */
+ fd = func (BASE "e.exe", O_CREAT | O_RDONLY, 0700);
+ ASSERT (0 <= fd);
+ ASSERT (close (fd) == 0);
+
/* Trailing slash handling. */
errno = 0;
ASSERT (func (BASE "file/", O_RDONLY) == -1);
/* Cleanup. */
ASSERT (unlink (BASE "file") == 0);
+ ASSERT (unlink (BASE "e.exe") == 0);
ASSERT (unlink (BASE "link") == 0);
return 0;