diff options
author | Abseil Team <absl-team@google.com> | 2018-10-04 22:28:05 (GMT) |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2018-10-05 16:54:14 (GMT) |
commit | 4bb49ed640e34e23187ad7ea689693ef9927033f (patch) | |
tree | 31bfca77d3e46134fddebe28118bcba3af711e45 /googletest/src/gtest-internal-inl.h | |
parent | f13bbe2992d188e834339abe6f715b2b2f840a77 (diff) | |
download | googletest-4bb49ed640e34e23187ad7ea689693ef9927033f.zip googletest-4bb49ed640e34e23187ad7ea689693ef9927033f.tar.gz googletest-4bb49ed640e34e23187ad7ea689693ef9927033f.tar.bz2 |
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
Diffstat (limited to 'googletest/src/gtest-internal-inl.h')
-rw-r--r-- | googletest/src/gtest-internal-inl.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/googletest/src/gtest-internal-inl.h b/googletest/src/gtest-internal-inl.h index f79b1ad..f05de04 100644 --- a/googletest/src/gtest-internal-inl.h +++ b/googletest/src/gtest-internal-inl.h @@ -585,14 +585,14 @@ class GTEST_API_ UnitTestImpl { // total_test_case_count() - 1. If i is not in that range, returns NULL. const TestCase* GetTestCase(int i) const { const int index = GetElementOr(test_case_indices_, i, -1); - return index < 0 ? NULL : test_cases_[i]; + return index < 0 ? nullptr : test_cases_[i]; } // Gets the i-th test case among all the test cases. i can range from 0 to // total_test_case_count() - 1. If i is not in that range, returns NULL. TestCase* GetMutableTestCase(int i) { const int index = GetElementOr(test_case_indices_, i, -1); - return index < 0 ? NULL : test_cases_[index]; + return index < 0 ? nullptr : test_cases_[index]; } // Provides access to the event listener list. @@ -1158,8 +1158,7 @@ class StreamingListener : public EmptyTestEventListener { void OnTestPartResult(const TestPartResult& test_part_result) { const char* file_name = test_part_result.file_name(); - if (file_name == NULL) - file_name = ""; + if (file_name == nullptr) file_name = ""; SendLn("event=TestPartResult&file=" + UrlEncode(file_name) + "&line=" + StreamableToString(test_part_result.line_number()) + "&message=" + UrlEncode(test_part_result.message())); |