Makes EXPECT_THAT typesafe; updates CHANGES for 1.7.0; pulls in gtest r653

This commit is contained in:
zhanyong.wan
2013-04-24 02:49:43 +00:00
parent 061f1d4d16
commit f4274520da
3 changed files with 34 additions and 3 deletions

View File

@@ -721,6 +721,15 @@ TEST(ATest, MatchesAnyValue) {
EXPECT_TRUE(m2.Matches(b));
}
TEST(ATest, WorksForDerivedClass) {
Base base;
Derived derived;
EXPECT_THAT(&base, A<Base*>());
// This shouldn't compile: EXPECT_THAT(&base, A<Derived*>());
EXPECT_THAT(&derived, A<Base*>());
EXPECT_THAT(&derived, A<Derived*>());
}
// Tests that A<T>() describes itself properly.
TEST(ATest, CanDescribeSelf) {
EXPECT_EQ("is anything", Describe(A<bool>()));