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/samples/sample3_unittest.cc | |
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/samples/sample3_unittest.cc')
-rw-r--r-- | googletest/samples/sample3_unittest.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/googletest/samples/sample3_unittest.cc b/googletest/samples/sample3_unittest.cc index e093c25..97ce55d 100644 --- a/googletest/samples/sample3_unittest.cc +++ b/googletest/samples/sample3_unittest.cc @@ -99,8 +99,8 @@ class QueueTestSmpl3 : public testing::Test { ASSERT_EQ(q->Size(), new_q->Size()); // Verifies the relationship between the elements of the two queues. - for ( const QueueNode<int> * n1 = q->Head(), * n2 = new_q->Head(); - n1 != NULL; n1 = n1->next(), n2 = n2->next() ) { + for (const QueueNode<int>*n1 = q->Head(), *n2 = new_q->Head(); + n1 != nullptr; n1 = n1->next(), n2 = n2->next()) { EXPECT_EQ(2 * n1->element(), n2->element()); } @@ -125,16 +125,16 @@ TEST_F(QueueTestSmpl3, DefaultConstructor) { // Tests Dequeue(). TEST_F(QueueTestSmpl3, Dequeue) { int * n = q0_.Dequeue(); - EXPECT_TRUE(n == NULL); + EXPECT_TRUE(n == nullptr); n = q1_.Dequeue(); - ASSERT_TRUE(n != NULL); + ASSERT_TRUE(n != nullptr); EXPECT_EQ(1, *n); EXPECT_EQ(0u, q1_.Size()); delete n; n = q2_.Dequeue(); - ASSERT_TRUE(n != NULL); + ASSERT_TRUE(n != nullptr); EXPECT_EQ(2, *n); EXPECT_EQ(1u, q2_.Size()); delete n; |