am c07f7ee7: am a847073a: Merge "Rename test_forked -> test_isolated"
* commit 'c07f7ee70daa04aa5d77771d8859592d110a7177': Rename test_forked -> test_isolated
This commit is contained in:
commit
6854b511f2
@ -16,8 +16,15 @@
|
|||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
template<typename F>
|
template<typename F>
|
||||||
void test_forked(F test) {
|
void test_isolated(F test) {
|
||||||
int pid = fork();
|
int pid = fork();
|
||||||
ASSERT_NE(-1, pid) << strerror(errno);
|
ASSERT_NE(-1, pid) << strerror(errno);
|
||||||
|
|
||||||
|
@ -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; }
|
static void AtForkChild2() { g_atfork_child_calls = (g_atfork_child_calls << 4) | 2; }
|
||||||
|
|
||||||
TEST(pthread, pthread_atfork_smoke) {
|
TEST(pthread, pthread_atfork_smoke) {
|
||||||
test_forked([]() {
|
test_isolated([] {
|
||||||
ASSERT_EQ(0, pthread_atfork(AtForkPrepare1, AtForkParent1, AtForkChild1));
|
ASSERT_EQ(0, pthread_atfork(AtForkPrepare1, AtForkParent1, AtForkChild1));
|
||||||
ASSERT_EQ(0, pthread_atfork(AtForkPrepare2, AtForkParent2, AtForkChild2));
|
ASSERT_EQ(0, pthread_atfork(AtForkPrepare2, AtForkParent2, AtForkChild2));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user