diff options
author | kosak@google.com <kosak@google.com@861a406c-534a-0410-8894-cb66d6ee9925> | 2015-07-19 22:05:06 +0000 |
---|---|---|
committer | kosak@google.com <kosak@google.com@861a406c-534a-0410-8894-cb66d6ee9925> | 2015-07-19 22:05:06 +0000 |
commit | 595ac4ec78b64ccb54c9595fa41908af2080f4c3 (patch) | |
tree | 664ba24f6bed6784e251bb58ca8a98e78532164d | |
parent | de011a432c19b67c65230fc3d453093e7b403069 (diff) | |
download | googletest-595ac4ec78b64ccb54c9595fa41908af2080f4c3.tar.gz |
Condition some code on !GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
git-svn-id: http://googletest.googlecode.com/svn/trunk@730 861a406c-534a-0410-8894-cb66d6ee9925
-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"); |