diff options
author | Mark Jan van Kampen <mjvk@allseas.com> | 2020-04-16 12:26:44 (GMT) |
---|---|---|
committer | Mark Jan van Kampen <mjvk@allseas.com> | 2020-04-16 12:26:44 (GMT) |
commit | ee01491229cb1394a51504b8fd3de53e2c3d75d9 (patch) | |
tree | 947876a9003fcf0a3300340bede8f968a030f928 /googlemock/test/gmock-matchers_test.cc | |
parent | 937b3ce9f7afa1b1ab6fde5c09e460ef40813a9f (diff) | |
parent | e3f0319d89f4cbf32993de595d984183b1a9fc57 (diff) | |
download | googletest-ee01491229cb1394a51504b8fd3de53e2c3d75d9.zip googletest-ee01491229cb1394a51504b8fd3de53e2c3d75d9.tar.gz googletest-ee01491229cb1394a51504b8fd3de53e2c3d75d9.tar.bz2 |
Merge branch 'master' of https://github.com/google/googletest into cmake-QNX-fixrefs/pull/2682/head
# Conflicts:
# CMakeLists.txt
Diffstat (limited to 'googlemock/test/gmock-matchers_test.cc')
-rw-r--r-- | googlemock/test/gmock-matchers_test.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc index c1949e6..186d8aa 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<const T&>(m) works when m is a Matcher<T>. TEST(SafeMatcherCastTest, FromNonReferenceToConstReference) { - Matcher<int> m1 = Eq(0); - Matcher<const int&> m2 = SafeMatcherCast<const int&>(m1); - EXPECT_TRUE(m2.Matches(0)); - EXPECT_FALSE(m2.Matches(1)); + Matcher<std::unique_ptr<int>> m1 = IsNull(); + Matcher<const std::unique_ptr<int>&> m2 = + SafeMatcherCast<const std::unique_ptr<int>&>(m1); + EXPECT_TRUE(m2.Matches(std::unique_ptr<int>())); + EXPECT_FALSE(m2.Matches(std::unique_ptr<int>(new int))); } // Tests that SafeMatcherCast<T&>(m) works when m is a Matcher<T>. @@ -4725,20 +4726,18 @@ TEST(SizeIsTest, ExplainsResult) { Matcher<vector<int> > m1 = SizeIs(2); Matcher<vector<int> > m2 = SizeIs(Lt(2u)); Matcher<vector<int> > m3 = SizeIs(AnyOf(0, 3)); - Matcher<vector<int> > m4 = SizeIs(GreaterThan(1)); + Matcher<vector<int> > m4 = SizeIs(Gt(1u)); vector<int> container; EXPECT_EQ("whose size 0 doesn't match", Explain(m1, container)); EXPECT_EQ("whose size 0 matches", Explain(m2, container)); EXPECT_EQ("whose size 0 matches", Explain(m3, container)); - EXPECT_EQ("whose size 0 doesn't match, which is 1 less than 1", - Explain(m4, container)); + EXPECT_EQ("whose size 0 doesn't match", Explain(m4, container)); container.push_back(0); container.push_back(0); EXPECT_EQ("whose size 2 matches", Explain(m1, container)); EXPECT_EQ("whose size 2 doesn't match", Explain(m2, container)); EXPECT_EQ("whose size 2 doesn't match", Explain(m3, container)); - EXPECT_EQ("whose size 2 matches, which is 1 more than 1", - Explain(m4, container)); + EXPECT_EQ("whose size 2 matches", Explain(m4, container)); } #if GTEST_HAS_TYPED_TEST |