Change IsNull and NotNull to use ==/!= nullptr in C++11.

Also update gmock_doctor due to Clang wording change.
This commit is contained in:
kosak
2015-04-28 22:36:31 +00:00
parent 5625dd333a
commit 6305ff5a92
3 changed files with 27 additions and 1 deletions

View File

@@ -1025,6 +1025,15 @@ TEST(IsNullTest, ReferenceToConstLinkedPtr) {
EXPECT_FALSE(m.Matches(non_null_p));
}
#if GTEST_LANG_CXX11
TEST(IsNullTest, StdFunction) {
const Matcher<std::function<void()>> m = IsNull();
EXPECT_TRUE(m.Matches(std::function<void()>()));
EXPECT_FALSE(m.Matches([]{}));
}
#endif // GTEST_LANG_CXX11
TEST(IsNullTest, ReferenceToConstScopedPtr) {
const Matcher<const scoped_ptr<double>&> m = IsNull();
const scoped_ptr<double> null_p;
@@ -1073,6 +1082,15 @@ TEST(NotNullTest, ReferenceToConstLinkedPtr) {
EXPECT_TRUE(m.Matches(non_null_p));
}
#if GTEST_LANG_CXX11
TEST(NotNullTest, StdFunction) {
const Matcher<std::function<void()>> m = NotNull();
EXPECT_TRUE(m.Matches([]{}));
EXPECT_FALSE(m.Matches(std::function<void()>()));
}
#endif // GTEST_LANG_CXX11
TEST(NotNullTest, ReferenceToConstScopedPtr) {
const Matcher<const scoped_ptr<double>&> m = NotNull();
const scoped_ptr<double> null_p;