aboutsummaryrefslogtreecommitdiffstats
path: root/googletest/test/googletest-output-test_.cc
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-10-04 18:28:05 -0400
committerGennadiy Civil <misterg@google.com>2018-10-05 12:54:14 -0400
commit4bb49ed640e34e23187ad7ea689693ef9927033f (patch)
tree31bfca77d3e46134fddebe28118bcba3af711e45 /googletest/test/googletest-output-test_.cc
parentf13bbe2992d188e834339abe6f715b2b2f840a77 (diff)
downloadgoogletest-4bb49ed640e34e23187ad7ea689693ef9927033f.tar.gz
googletest-4bb49ed640e34e23187ad7ea689693ef9927033f.tar.bz2
googletest-4bb49ed640e34e23187ad7ea689693ef9927033f.zip
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/test/googletest-output-test_.cc')
-rw-r--r--googletest/test/googletest-output-test_.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/googletest/test/googletest-output-test_.cc b/googletest/test/googletest-output-test_.cc
index f6525ec9..a24dfce8 100644
--- a/googletest/test/googletest-output-test_.cc
+++ b/googletest/test/googletest-output-test_.cc
@@ -174,7 +174,7 @@ TEST(SCOPED_TRACETest, AcceptedValues) {
SCOPED_TRACE("literal string");
SCOPED_TRACE(std::string("std::string"));
SCOPED_TRACE(1337); // streamable type
- const char* null_value = NULL;
+ const char* null_value = nullptr;
SCOPED_TRACE(null_value);
ADD_FAILURE() << "Just checking that all these values work fine.";
@@ -306,9 +306,8 @@ TEST(SCOPED_TRACETest, WorksConcurrently) {
printf("(expecting 6 failures)\n");
CheckPoints check_points;
- ThreadWithParam<CheckPoints*> thread(&ThreadWithScopedTrace,
- &check_points,
- NULL);
+ ThreadWithParam<CheckPoints*> thread(&ThreadWithScopedTrace, &check_points,
+ nullptr);
check_points.n1.WaitForNotification();
{
@@ -511,7 +510,7 @@ class DeathTestAndMultiThreadsTest : public testing::Test {
// Starts a thread and waits for it to begin.
virtual void SetUp() {
thread_.reset(new ThreadWithParam<SpawnThreadNotifications*>(
- &ThreadRoutine, &notifications_, NULL));
+ &ThreadRoutine, &notifications_, nullptr));
notifications_.spawn_thread_started.WaitForNotification();
}
// Tells the thread to finish, and reaps it.
@@ -966,7 +965,7 @@ TEST_F(ExpectFailureTest, ExpectNonFatalFailure) {
class ExpectFailureWithThreadsTest : public ExpectFailureTest {
protected:
static void AddFailureInOtherThread(FailureMode failure) {
- ThreadWithParam<FailureMode> thread(&AddFailure, failure, NULL);
+ ThreadWithParam<FailureMode> thread(&AddFailure, failure, nullptr);
thread.Join();
}
};