summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2014-11-20 21:21:26 -0800
committerDmitriy Ivanov <dimitry@google.com>2014-11-20 22:53:59 -0800
commit0864d8bc47d57a3e63c1444dad1e263dd310d64f (patch)
tree0764c189236fa70909373e7e4325beb4e474cce0 /tests
parent8b4b82733877928da429e47d9a9bb73317517b2e (diff)
downloadbionic-0864d8bc47d57a3e63c1444dad1e263dd310d64f.zip
bionic-0864d8bc47d57a3e63c1444dad1e263dd310d64f.tar.gz
bionic-0864d8bc47d57a3e63c1444dad1e263dd310d64f.tar.bz2
Rename test_forked -> test_isolated
Change-Id: Ie72627e986c159832cbd3635d8ff5b1af3d5b1eb
Diffstat (limited to 'tests')
-rw-r--r--tests/gtest_ex.h9
-rw-r--r--tests/pthread_test.cpp2
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/gtest_ex.h b/tests/gtest_ex.h
index 41ee22b..fe1d894 100644
--- a/tests/gtest_ex.h
+++ b/tests/gtest_ex.h
@@ -16,8 +16,15 @@
#include <gtest/gtest.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
template<typename F>
-void test_forked(F test) {
+void test_isolated(F test) {
int pid = fork();
ASSERT_NE(-1, pid) << strerror(errno);
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index f45e2e6..797468e 100644
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -723,7 +723,7 @@ static void AtForkChild1() { g_atfork_child_calls = (g_atfork_child_calls << 4)
static void AtForkChild2() { g_atfork_child_calls = (g_atfork_child_calls << 4) | 2; }
TEST(pthread, pthread_atfork_smoke) {
- test_forked([]() {
+ test_isolated([] {
ASSERT_EQ(0, pthread_atfork(AtForkPrepare1, AtForkParent1, AtForkChild1));
ASSERT_EQ(0, pthread_atfork(AtForkPrepare2, AtForkParent2, AtForkChild2));