aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/test
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-02-03 11:16:38 -0500
committerAndy Getz <durandal@google.com>2020-02-07 13:35:00 -0500
commit4f6609129a2ffe83308406655f770352cbbfd6b6 (patch)
treed9041a3f38b2cc9b36771d5fde882d93f78a6493 /googlemock/test
parent74b44b2d0fc201f4b6afdac37e9a32f4352a3dee (diff)
downloadgoogletest-4f6609129a2ffe83308406655f770352cbbfd6b6.tar.gz
googletest-4f6609129a2ffe83308406655f770352cbbfd6b6.tar.bz2
googletest-4f6609129a2ffe83308406655f770352cbbfd6b6.zip
Googletest export
Fix std::move to std::forward where appropriate to support reference types. PiperOrigin-RevId: 292923058
Diffstat (limited to 'googlemock/test')
-rw-r--r--googlemock/test/gmock-generated-matchers_test.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/googlemock/test/gmock-generated-matchers_test.cc b/googlemock/test/gmock-generated-matchers_test.cc
index 6783f8f8..a5ab4e26 100644
--- a/googlemock/test/gmock-generated-matchers_test.cc
+++ b/googlemock/test/gmock-generated-matchers_test.cc
@@ -764,9 +764,16 @@ MATCHER_P2(ReferencesAnyOf, variable1, variable2, "") {
TEST(MatcherPnMacroTest, WorksWhenExplicitlyInstantiatedWithReferences) {
UncopyableFoo foo1('1'), foo2('2'), foo3('3');
- const Matcher<const UncopyableFoo&> m =
+ const Matcher<const UncopyableFoo&> const_m =
ReferencesAnyOf<const UncopyableFoo&, const UncopyableFoo&>(foo1, foo2);
+ EXPECT_TRUE(const_m.Matches(foo1));
+ EXPECT_TRUE(const_m.Matches(foo2));
+ EXPECT_FALSE(const_m.Matches(foo3));
+
+ const Matcher<UncopyableFoo&> m =
+ ReferencesAnyOf<UncopyableFoo&, UncopyableFoo&>(foo1, foo2);
+
EXPECT_TRUE(m.Matches(foo1));
EXPECT_TRUE(m.Matches(foo2));
EXPECT_FALSE(m.Matches(foo3));