Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
79e11d7c
Commit
79e11d7c
authored
Mar 05, 2010
by
vladlosev
Browse files
Adds a smoketest for ThreadWithParam.
parent
f3feb338
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
test/gtest-port_test.cc
test/gtest-port_test.cc
+10
-0
No files found.
test/gtest-port_test.cc
View file @
79e11d7c
...
...
@@ -795,6 +795,16 @@ TEST(ThreadLocalTest, PointerAndConstPointerReturnSameValue) {
}
#if GTEST_IS_THREADSAFE
void
AddTwo
(
int
*
param
)
{
*
param
+=
2
;
}
TEST
(
ThreadWithParamTest
,
ConstructorExecutesThreadFunc
)
{
int
i
=
40
;
ThreadWithParam
<
int
*>
thread
(
&
AddTwo
,
&
i
,
NULL
);
thread
.
Join
();
EXPECT_EQ
(
42
,
i
);
}
TEST
(
MutexDeathTest
,
AssertHeldShouldAssertWhenNotLocked
)
{
// AssertHeld() is flaky only in the presence of multiple threads accessing
// the lock. In this case, the test is robust.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment