aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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.