diff options
author | Abseil Team <absl-team@google.com> | 2018-10-24 22:04:43 -0400 |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2018-10-26 14:19:59 -0400 |
commit | b57c703963be1ca9749b902c49083beac56648aa (patch) | |
tree | b7f5433fce3803d121c9963dc69bcdeec4d35f7c /googlemock/test/gmock-more-actions_test.cc | |
parent | a50e4f05b3d84c6a014c59a24263328242cc8236 (diff) | |
download | googletest-b57c703963be1ca9749b902c49083beac56648aa.tar.gz googletest-b57c703963be1ca9749b902c49083beac56648aa.tar.bz2 googletest-b57c703963be1ca9749b902c49083beac56648aa.zip |
Googletest export
Remove linked_ptr and use std::shared_ptr instead
PiperOrigin-RevId: 218618184
Diffstat (limited to 'googlemock/test/gmock-more-actions_test.cc')
-rw-r--r-- | googlemock/test/gmock-more-actions_test.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/googlemock/test/gmock-more-actions_test.cc b/googlemock/test/gmock-more-actions_test.cc index b4e0fc30..521f3058 100644 --- a/googlemock/test/gmock-more-actions_test.cc +++ b/googlemock/test/gmock-more-actions_test.cc @@ -35,11 +35,11 @@ #include "gmock/gmock-more-actions.h" #include <functional> -#include <memory> #include <sstream> #include <string> #include "gmock/gmock.h" #include "gtest/gtest.h" +#include "gtest/internal/gtest-linked_ptr.h" namespace testing { namespace gmock_more_actions_test { @@ -61,6 +61,7 @@ using testing::StaticAssertTypeEq; using testing::Unused; using testing::WithArg; using testing::WithoutArgs; +using testing::internal::linked_ptr; // For suppressing compiler warnings on conversion possibly losing precision. inline short Short(short n) { return n; } // NOLINT @@ -528,6 +529,14 @@ TEST(SaveArgPointeeActionTest, WorksForCompatibleType) { EXPECT_EQ('a', result); } +TEST(SaveArgPointeeActionTest, WorksForLinkedPtr) { + int result = 0; + linked_ptr<int> value(new int(5)); + const Action<void(linked_ptr<int>)> a1 = SaveArgPointee<0>(&result); + a1.Perform(std::make_tuple(value)); + EXPECT_EQ(5, result); +} + TEST(SetArgRefereeActionTest, WorksForSameType) { int value = 0; const Action<void(int&)> a1 = SetArgReferee<0>(1); |