]> Savannah Git Hosting - gnulib.git/commitdiff
tests: Enable Linux specific tests on Android.
authorBruno Haible <bruno@clisp.org>
Sun, 27 Jan 2019 10:39:56 +0000 (11:39 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 27 Jan 2019 10:39:56 +0000 (11:39 +0100)
* tests/test-flock.c (main): Treat Android like Linux.
* tests/test-openat-safer.c (main): Likewise.

ChangeLog
tests/test-flock.c
tests/test-openat-safer.c

index 82fc48fa87efaf91ca8cd40aa3c0525a204007dd..5c77d69cb22536761afce48a543121e524fc1bd9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-27  Bruno Haible  <bruno@clisp.org>
+
+       tests: Enable Linux specific tests on Android.
+       * tests/test-flock.c (main): Treat Android like Linux.
+       * tests/test-openat-safer.c (main): Likewise.
+
 2019-01-27  Bruno Haible  <bruno@clisp.org>
 
        relocatable-prog: Use Linux code on Android.
index ff688bc4168e32fa8fa2fa72a12038c9316e72cb..aa428ff7174177890d4f54904afbb662479bcdbd 100644 (file)
@@ -98,7 +98,7 @@ main (int argc, char *argv[])
   ASSERT (fd >= 0);
   ASSERT (write (fd, "hello", 5) == 5);
 
-#if defined __linux__
+#if defined __linux__ || defined __ANDROID__
   /* Invalid operation codes are rejected by the Linux implementation and by
      the gnulib replacement,  but not by the Mac OS X implementation.  */
   ASSERT (flock (fd, LOCK_SH | LOCK_EX) == -1);
index 042e488196bd50fba3e6f860c09ed69a012f6c63..7971168f50cdb7ec36c8c51438258dfcf7787f49 100644 (file)
@@ -96,7 +96,7 @@ main (void)
           errno = 0;
           ASSERT (openat (dfd, witness "/", O_RDONLY) == -1);
           ASSERT (errno == ENOTDIR || errno == EISDIR || errno == EINVAL);
-#ifdef __linux__
+#if defined __linux__ || defined __ANDROID__
           /* Using a bad directory is okay for absolute paths.  */
           fd = openat (-1, "/dev/null", O_WRONLY);
           ASSERT (STDERR_FILENO < fd);