aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorkosak <kosak@google.com>2015-04-28 22:36:31 +0000
committerkosak <kosak@google.com>2015-04-28 22:36:31 +0000
commit6305ff5a922ddf3b428f08ad3b53d07d2c08d89a (patch)
tree24c9b7b5a78b756ceb6bca09336124c403a03703 /include
parent5625dd333a621932c469e2261fd9f0c8687378f8 (diff)
downloadgoogletest-6305ff5a922ddf3b428f08ad3b53d07d2c08d89a.tar.gz
googletest-6305ff5a922ddf3b428f08ad3b53d07d2c08d89a.tar.bz2
googletest-6305ff5a922ddf3b428f08ad3b53d07d2c08d89a.zip
Change IsNull and NotNull to use ==/!= nullptr in C++11.
Also update gmock_doctor due to Clang wording change.
Diffstat (limited to 'include')
-rw-r--r--include/gmock/gmock-matchers.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/gmock/gmock-matchers.h b/include/gmock/gmock-matchers.h
index 6450f9b7..822337b1 100644
--- a/include/gmock/gmock-matchers.h
+++ b/include/gmock/gmock-matchers.h
@@ -979,7 +979,11 @@ class IsNullMatcher {
template <typename Pointer>
bool MatchAndExplain(const Pointer& p,
MatchResultListener* /* listener */) const {
+#if GTEST_LANG_CXX11
+ return p == nullptr;
+#else // GTEST_LANG_CXX11
return GetRawPointer(p) == NULL;
+#endif // GTEST_LANG_CXX11
}
void DescribeTo(::std::ostream* os) const { *os << "is NULL"; }
@@ -995,7 +999,11 @@ class NotNullMatcher {
template <typename Pointer>
bool MatchAndExplain(const Pointer& p,
MatchResultListener* /* listener */) const {
+#if GTEST_LANG_CXX11
+ return p != nullptr;
+#else // GTEST_LANG_CXX11
return GetRawPointer(p) != NULL;
+#endif // GTEST_LANG_CXX11
}
void DescribeTo(::std::ostream* os) const { *os << "isn't NULL"; }