diff options
author | kosak <kosak@google.com> | 2015-07-19 22:05:06 (GMT) |
---|---|---|
committer | kosak <kosak@google.com> | 2015-07-19 22:05:06 (GMT) |
commit | 7d7beaa155717adafb783a52b6dfa37fae15df3f (patch) | |
tree | 664ba24f6bed6784e251bb58ca8a98e78532164d | |
parent | 4d69b1607a876a77b8719f035b23254677617a47 (diff) | |
download | googletest-7d7beaa155717adafb783a52b6dfa37fae15df3f.zip googletest-7d7beaa155717adafb783a52b6dfa37fae15df3f.tar.gz googletest-7d7beaa155717adafb783a52b6dfa37fae15df3f.tar.bz2 |
Condition some code on !GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
-rw-r--r-- | test/gtest-port_test.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/gtest-port_test.cc b/test/gtest-port_test.cc index 7647859..937832b 100644 --- a/test/gtest-port_test.cc +++ b/test/gtest-port_test.cc @@ -1149,6 +1149,13 @@ TEST(ThreadLocalTest, ParameterizedConstructorSetsDefault) { EXPECT_STREQ("foo", result.c_str()); } +# if !GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ + +// Tests in this section depend on that Google Test's own ThreadLocal +// implementation stores a copy of the default value shared by all +// threads. We don't want to test this for an external implementation received +// through GTEST_HAS_MUTEX_AND_THREAD_LOCAL_. + // Keeps track of whether of destructors being called on instances of // DestructorTracker. On Windows, waits for the destructor call reports. class DestructorCall { @@ -1289,6 +1296,8 @@ TEST(ThreadLocalTest, DestroysManagedObjectAtThreadExit) { DestructorCall::ResetList(); } +# endif // !GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ + TEST(ThreadLocalTest, ThreadLocalMutationsAffectOnlyCurrentThread) { ThreadLocal<std::string> thread_local_string; thread_local_string.set("Foo"); |