summaryrefslogtreecommitdiffstats
path: root/googletest/samples/sample2_unittest.cc
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-10-04 22:28:05 (GMT)
committerGennadiy Civil <misterg@google.com>2018-10-05 16:54:14 (GMT)
commit4bb49ed640e34e23187ad7ea689693ef9927033f (patch)
tree31bfca77d3e46134fddebe28118bcba3af711e45 /googletest/samples/sample2_unittest.cc
parentf13bbe2992d188e834339abe6f715b2b2f840a77 (diff)
downloadgoogletest-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/samples/sample2_unittest.cc')
-rw-r--r--googletest/samples/sample2_unittest.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/googletest/samples/sample2_unittest.cc b/googletest/samples/sample2_unittest.cc
index 0848826..41e31c1 100644
--- a/googletest/samples/sample2_unittest.cc
+++ b/googletest/samples/sample2_unittest.cc
@@ -66,7 +66,7 @@ TEST(MyString, DefaultConstructor) {
// we have to live with this fact.
//
// </TechnicalDetails>
- EXPECT_STREQ(NULL, s.c_string());
+ EXPECT_STREQ(nullptr, s.c_string());
EXPECT_EQ(0u, s.Length());
}
@@ -101,7 +101,7 @@ TEST(MyString, Set) {
EXPECT_EQ(0, strcmp(s.c_string(), kHelloString));
// Can we set the MyString to NULL?
- s.Set(NULL);
- EXPECT_STREQ(NULL, s.c_string());
+ s.Set(nullptr);
+ EXPECT_STREQ(nullptr, s.c_string());
}
} // namespace