Fix 32-bit issues in tests, and add a trivial test for the FD_* macros.
Change-Id: Ia3f21ce1f0ed9236527fe44d36ccb7de6bf63113
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index d4d38f5..d82921b 100644
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -17,6 +17,7 @@
#include <gtest/gtest.h>
#include <errno.h>
+#include <inttypes.h>
#include <limits.h>
#include <pthread.h>
#include <unistd.h>
@@ -56,7 +57,7 @@
}
static void* SleepFn(void* arg) {
- sleep(reinterpret_cast<unsigned int>(arg));
+ sleep(reinterpret_cast<uintptr_t>(arg));
return NULL;
}
@@ -140,7 +141,7 @@
// ...but t2's join on t1 still goes ahead (which we can tell because our join on t2 finishes).
void* join_result;
ASSERT_EQ(0, pthread_join(t2, &join_result));
- ASSERT_EQ(0, reinterpret_cast<int>(join_result));
+ ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(join_result));
}
TEST(pthread, pthread_join_self) {
@@ -190,7 +191,7 @@
void* join_result;
ASSERT_EQ(0, pthread_join(signal_thread, &join_result));
ASSERT_EQ(SIGUSR1, received_signal);
- ASSERT_EQ(0, reinterpret_cast<int>(join_result));
+ ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(join_result));
}
#if __BIONIC__
@@ -348,7 +349,7 @@
// ...but t2's join on t1 still goes ahead (which we can tell because our join on t2 finishes).
void* join_result;
ASSERT_EQ(0, pthread_join(t2, &join_result));
- ASSERT_EQ(0, reinterpret_cast<int>(join_result));
+ ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(join_result));
}
static void* GetActualGuardSizeFn(void* arg) {