aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-03-05 22:17:25 +0000
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2010-03-05 22:17:25 +0000
commit79e11d7c7d17e6f893467656815a79d8e84dd7c3 (patch)
tree5c1eacbf12596cc3cc62d92c2850902b04f15af1 /test
parentf3feb338efcc84fb0ba740543d8c061f8541cf6b (diff)
downloadgoogletest-79e11d7c7d17e6f893467656815a79d8e84dd7c3.tar.gz
googletest-79e11d7c7d17e6f893467656815a79d8e84dd7c3.tar.bz2
googletest-79e11d7c7d17e6f893467656815a79d8e84dd7c3.zip
Adds a smoketest for ThreadWithParam.
Diffstat (limited to 'test')
-rw-r--r--test/gtest-port_test.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/gtest-port_test.cc b/test/gtest-port_test.cc
index 1588bd46..577f6099 100644
--- a/test/gtest-port_test.cc
+++ b/test/gtest-port_test.cc
@@ -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.