aboutsummaryrefslogtreecommitdiffstats
path: root/tests/eventfd_test.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2013-12-20 18:43:21 -0800
committerChristopher Ferris <cferris@google.com>2014-02-06 20:12:21 -0800
commitf04935c85e0b466f0d30d2cd4c0fa2fff62e7d6d (patch)
tree8f1c6af75517892648f49adad9d4d5d44c20f49c /tests/eventfd_test.cpp
parente163a3986aa7d1c67fe3274eb9204812be0a6245 (diff)
downloadandroid_bionic-f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6d.tar.gz
android_bionic-f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6d.tar.bz2
android_bionic-f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6d.zip
Make sure that the same tests are on all platforms.
In order to be able to generate a list of tests for cts, the same set of tests must exist across all platforms. This CL adds empty tests where a test was conditionally compiled out. This CL creates a single library libBionicTests that includes all of the tests found in bionic-unit-tests-static. Also fix a few missing include files in some test files. Tested by running and compiling the tests for every platform and verifying the same number of tests are on each platform. Change-Id: I9989d4bfebb0f9c409a0ce7e87169299eac605a2
Diffstat (limited to 'tests/eventfd_test.cpp')
-rw-r--r--tests/eventfd_test.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/eventfd_test.cpp b/tests/eventfd_test.cpp
index 2c2c5f07e..aa88a3b9d 100644
--- a/tests/eventfd_test.cpp
+++ b/tests/eventfd_test.cpp
@@ -14,11 +14,25 @@
* limitations under the License.
*/
-#include <gtest/gtest.h>
+#include <errno.h>
+#include <fcntl.h>
-#if !defined(__GLIBC__) // Android's prebuilt gcc's header files don't include <sys/eventfd.h>.
+#include <gtest/gtest.h>
+#if defined(__BIONIC__) // Android's prebuilt gcc's header files don't include <sys/eventfd.h>.
#include <sys/eventfd.h>
+#else
+// Include the necessary components of sys/eventfd.h right here.
+#include <stdint.h>
+
+typedef uint64_t eventfd_t;
+
+__BEGIN_DECLS
+extern int eventfd(int, int);
+extern int eventfd_read(int, eventfd_t*);
+extern int eventfd_write(int, eventfd_t);
+__END_DECLS
+#endif
TEST(eventfd, smoke) {
unsigned int initial_value = 2;
@@ -43,5 +57,3 @@ TEST(eventfd, smoke) {
close(fd);
}
-
-#endif