Go to the source code of this file.
|
| TEST (PThreadTest, pthread_create_and_join) |
|
| TEST (PThreadTest, pthread_join_return_value) |
|
| TEST (PThreadTest, pthread_equal) |
|
| TEST (PThreadTest, pthread_self_on_pthread_thread) |
|
TEST |
( |
PThreadTest |
, |
|
|
pthread_create_and_join |
|
|
) |
| |
Definition at line 23 of file PThreadTest.cpp.
References EXPECT_EQ, EXPECT_TRUE, and int32_t.
24 static std::atomic<bool> hasRun{
false};
25 static std::atomic<int32_t> argPassedIn{0};
26 auto mainFunc = [](
void* arg) ->
void* {
28 argPassedIn = (
int32_t) reinterpret_cast<uintptr_t>(arg);
33 EXPECT_EQ(pthread_create(&thread,
nullptr, mainFunc, (
void*)53), 0);
34 EXPECT_EQ(pthread_join(thread,
nullptr), 0);
#define EXPECT_EQ(val1, val2)
#define EXPECT_TRUE(condition)
TEST |
( |
PThreadTest |
, |
|
|
pthread_join_return_value |
|
|
) |
| |
Definition at line 39 of file PThreadTest.cpp.
References EXPECT_EQ, and EXPECT_TRUE.
40 static std::atomic<bool> hasRun{
false};
41 auto mainFunc = [](
void*) ->
void* {
47 EXPECT_EQ(pthread_create(&thread,
nullptr, mainFunc,
nullptr), 0);
48 void* exitCode =
nullptr;
49 EXPECT_EQ(pthread_join(thread, &exitCode), 0);
#define EXPECT_EQ(val1, val2)
#define EXPECT_TRUE(condition)
TEST |
( |
PThreadTest |
, |
|
|
pthread_equal |
|
|
) |
| |
Definition at line 54 of file PThreadTest.cpp.
References EXPECT_EQ, and EXPECT_NE.
55 auto self = pthread_self();
58 auto mainFunc = [](
void*) ->
void* {
return nullptr; };
60 EXPECT_EQ(pthread_create(&thread,
nullptr, mainFunc,
nullptr), 0);
61 EXPECT_EQ(pthread_equal(thread,
self), 0);
#define EXPECT_EQ(val1, val2)
#define EXPECT_NE(val1, val2)
TEST |
( |
PThreadTest |
, |
|
|
pthread_self_on_pthread_thread |
|
|
) |
| |
Definition at line 64 of file PThreadTest.cpp.
References EXPECT_EQ, EXPECT_NE, and EXPECT_TRUE.
65 static std::atomic<bool> hasRun{
false};
66 static pthread_t otherSelf;
67 auto mainFunc = [](
void*) ->
void* {
69 otherSelf = pthread_self();
74 EXPECT_EQ(pthread_create(&thread,
nullptr, mainFunc,
nullptr), 0);
75 EXPECT_EQ(pthread_join(thread,
nullptr), 0);
76 EXPECT_NE(pthread_equal(otherSelf, thread), 0);
#define EXPECT_EQ(val1, val2)
#define EXPECT_TRUE(condition)
#define EXPECT_NE(val1, val2)