aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pthread_test.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-10-02 16:59:05 -0700
committerElliott Hughes <enh@google.com>2013-10-02 16:59:05 -0700
commit5b9310e502003e584bcb3a028ca3db7aa4d3f01b (patch)
tree5747ee180ec0d5c352758125487a2815d4eb3716 /tests/pthread_test.cpp
parentf741e1c2ed27f153e92a2a36c9db3b189f9a6388 (diff)
downloadandroid_bionic-5b9310e502003e584bcb3a028ca3db7aa4d3f01b.tar.gz
android_bionic-5b9310e502003e584bcb3a028ca3db7aa4d3f01b.tar.bz2
android_bionic-5b9310e502003e584bcb3a028ca3db7aa4d3f01b.zip
Fix 32-bit issues in tests, and add a trivial test for the FD_* macros.
Change-Id: Ia3f21ce1f0ed9236527fe44d36ccb7de6bf63113
Diffstat (limited to 'tests/pthread_test.cpp')
-rw-r--r--tests/pthread_test.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index d4d38f521..d82921b30 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* IdFn(void* arg) {
}
static void* SleepFn(void* arg) {
- sleep(reinterpret_cast<unsigned int>(arg));
+ sleep(reinterpret_cast<uintptr_t>(arg));
return NULL;
}
@@ -140,7 +141,7 @@ TEST(pthread, pthread_no_op_detach_after_join) {
// ...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 @@ TEST(pthread, pthread_sigmask) {
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 @@ TEST(pthread, pthread_join__multijoin) {
// ...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) {