From 909b1ccfcacc9d6f920aa79e3f643c1a4e806eb2 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Tue, 25 Feb 2020 10:52:53 -0500 Subject: Googletest export Relax the implementation of MatcherCast to allow conversion of `Matcher` to `Matcher`. They have the same match signature. PiperOrigin-RevId: 297115843 --- googlemock/test/gmock-matchers_test.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'googlemock/test') diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc index c1949e63..3619959f 100644 --- a/googlemock/test/gmock-matchers_test.cc +++ b/googlemock/test/gmock-matchers_test.cc @@ -765,10 +765,11 @@ TEST(SafeMatcherCastTest, FromConstReferenceToReference) { // Tests that MatcherCast(m) works when m is a Matcher. TEST(SafeMatcherCastTest, FromNonReferenceToConstReference) { - Matcher m1 = Eq(0); - Matcher m2 = SafeMatcherCast(m1); - EXPECT_TRUE(m2.Matches(0)); - EXPECT_FALSE(m2.Matches(1)); + Matcher> m1 = IsNull(); + Matcher&> m2 = + SafeMatcherCast&>(m1); + EXPECT_TRUE(m2.Matches(std::unique_ptr())); + EXPECT_FALSE(m2.Matches(std::unique_ptr(new int))); } // Tests that SafeMatcherCast(m) works when m is a Matcher. -- cgit v1.2.3