From 4bb49ed640e34e23187ad7ea689693ef9927033f Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 4 Oct 2018 18:28:05 -0400 Subject: Apply clang-tidy modernize-use-nullptr to googletest. Now that googletest has moved to C++11, it should no longer use NULL or 0 for the null pointer. This patch converts all such usages to nullptr using clang-tidy. This prevents LLVM from issuing -Wzero-as-null-pointer-constant warnings. PiperOrigin-RevId: 215814400 --- googlemock/test/gmock-generated-matchers_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'googlemock/test/gmock-generated-matchers_test.cc') diff --git a/googlemock/test/gmock-generated-matchers_test.cc b/googlemock/test/gmock-generated-matchers_test.cc index 0ebd4701..10a4ac39 100644 --- a/googlemock/test/gmock-generated-matchers_test.cc +++ b/googlemock/test/gmock-generated-matchers_test.cc @@ -697,7 +697,7 @@ TEST(ElementsAreArrayTest, CanBeCreatedWithIteratorRange) { // Pointers are iterators, too. EXPECT_THAT(test_vector, ElementsAreArray(a, a + GTEST_ARRAY_SIZE_(a))); // The empty range of NULL pointers should also be okay. - int* const null_int = NULL; + int* const null_int = nullptr; EXPECT_THAT(test_vector, Not(ElementsAreArray(null_int, null_int))); EXPECT_THAT((vector()), ElementsAreArray(null_int, null_int)); } @@ -770,7 +770,7 @@ MATCHER_P2(EqSumOf, x, y, std::string(negation ? "doesn't equal" : "equals") + } else { // Verifies that we can stream to the underlying stream of // result_listener. - if (result_listener->stream() != NULL) { + if (result_listener->stream() != nullptr) { *result_listener->stream() << "diff == " << (x + y - arg); } return false; -- cgit v1.2.3