diff options
Diffstat (limited to 'tests/pthread_test.cpp')
-rwxr-xr-x | tests/pthread_test.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp index 78dbd3972..d11ea3f7b 100755 --- a/tests/pthread_test.cpp +++ b/tests/pthread_test.cpp @@ -37,7 +37,6 @@ #include "private/ScopeGuard.h" #include "BionicDeathTest.h" #include "ScopedSignalHandler.h" - #include "utils.h" TEST(pthread, pthread_key_create) { @@ -142,10 +141,7 @@ TEST(pthread, pthread_key_fork) { _exit(99); } - int status; - ASSERT_EQ(pid, waitpid(pid, &status, 0)); - ASSERT_TRUE(WIFEXITED(status)); - ASSERT_EQ(99, WEXITSTATUS(status)); + AssertChildExited(pid, 99); ASSERT_EQ(expected, pthread_getspecific(key)); ASSERT_EQ(0, pthread_key_delete(key)); @@ -1038,7 +1034,7 @@ TEST(pthread, pthread_atfork_smoke) { ASSERT_EQ(0, pthread_atfork(AtForkPrepare1, AtForkParent1, AtForkChild1)); ASSERT_EQ(0, pthread_atfork(AtForkPrepare2, AtForkParent2, AtForkChild2)); - int pid = fork(); + pid_t pid = fork(); ASSERT_NE(-1, pid) << strerror(errno); // Child and parent calls are made in the order they were registered. @@ -1050,8 +1046,7 @@ TEST(pthread, pthread_atfork_smoke) { // Prepare calls are made in the reverse order. ASSERT_EQ(21, g_atfork_prepare_calls); - int status; - ASSERT_EQ(pid, waitpid(pid, &status, 0)); + AssertChildExited(pid, 0); } TEST(pthread, pthread_attr_getscope) { |