diff options
author | Abseil Team <absl-team@google.com> | 2021-12-03 18:13:10 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2021-12-03 18:14:13 (GMT) |
commit | d61d4d8e64c08a662055e82904bbf90e108a704f (patch) | |
tree | f63a7ab70429760a1b12221a5200dae8721311fe /googlemock/test | |
parent | 1b2606425c4040cacadaa22689423ec0a29f316d (diff) | |
download | googletest-d61d4d8e64c08a662055e82904bbf90e108a704f.zip googletest-d61d4d8e64c08a662055e82904bbf90e108a704f.tar.gz googletest-d61d4d8e64c08a662055e82904bbf90e108a704f.tar.bz2 |
Support std::reference_wapper as a smart pointer type in gmock
PiperOrigin-RevId: 413963503
Change-Id: I33440780bf087698f4e4325399227405885430b3
Diffstat (limited to 'googlemock/test')
-rw-r--r-- | googlemock/test/gmock-internal-utils_test.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/googlemock/test/gmock-internal-utils_test.cc b/googlemock/test/gmock-internal-utils_test.cc index fbb6a83..494b1fc 100644 --- a/googlemock/test/gmock-internal-utils_test.cc +++ b/googlemock/test/gmock-internal-utils_test.cc @@ -140,6 +140,12 @@ TEST(GetRawPointerTest, WorksForRawPointers) { EXPECT_EQ(&n, GetRawPointer(&n)); } +TEST(GetRawPointerTest, WorksForStdReferenceWrapper) { + int n = 1; + EXPECT_EQ(&n, GetRawPointer(std::ref(n))); + EXPECT_EQ(&n, GetRawPointer(std::cref(n))); +} + // Tests KindOf<T>. class Base {}; |