From 16732def37c5a66f3ea28dbe247b09cc6bca6677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 6 Nov 2020 17:49:09 +0100 Subject: Cleanup: Clang-Tidy modernize-use-nullptr Replace `NULL` with `nullptr` in C++ code. No functional changes. --- source/blender/blenlib/tests/BLI_heap_test.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source/blender/blenlib/tests/BLI_heap_test.cc') diff --git a/source/blender/blenlib/tests/BLI_heap_test.cc b/source/blender/blenlib/tests/BLI_heap_test.cc index 87e68c175a2..8b207c17c84 100644 --- a/source/blender/blenlib/tests/BLI_heap_test.cc +++ b/source/blender/blenlib/tests/BLI_heap_test.cc @@ -28,7 +28,7 @@ TEST(heap, Empty) heap = BLI_heap_new(); EXPECT_TRUE(BLI_heap_is_empty(heap)); EXPECT_EQ(BLI_heap_len(heap), 0); - BLI_heap_free(heap, NULL); + BLI_heap_free(heap, nullptr); } TEST(heap, One) @@ -44,7 +44,7 @@ TEST(heap, One) EXPECT_EQ(in, BLI_heap_pop_min(heap)); EXPECT_TRUE(BLI_heap_is_empty(heap)); EXPECT_EQ(BLI_heap_len(heap), 0); - BLI_heap_free(heap, NULL); + BLI_heap_free(heap, nullptr); } TEST(heap, Range) @@ -58,7 +58,7 @@ TEST(heap, Range) EXPECT_EQ(out_test, POINTER_AS_INT(BLI_heap_pop_min(heap))); } EXPECT_TRUE(BLI_heap_is_empty(heap)); - BLI_heap_free(heap, NULL); + BLI_heap_free(heap, nullptr); } TEST(heap, RangeReverse) @@ -72,7 +72,7 @@ TEST(heap, RangeReverse) EXPECT_EQ(-out_test, POINTER_AS_INT(BLI_heap_pop_min(heap))); } EXPECT_TRUE(BLI_heap_is_empty(heap)); - BLI_heap_free(heap, NULL); + BLI_heap_free(heap, nullptr); } TEST(heap, RangeRemove) @@ -85,13 +85,13 @@ TEST(heap, RangeRemove) } for (int i = 0; i < items_total; i += 2) { BLI_heap_remove(heap, nodes[i]); - nodes[i] = NULL; + nodes[i] = nullptr; } for (int out_test = 1; out_test < items_total; out_test += 2) { EXPECT_EQ(out_test, POINTER_AS_INT(BLI_heap_pop_min(heap))); } EXPECT_TRUE(BLI_heap_is_empty(heap)); - BLI_heap_free(heap, NULL); + BLI_heap_free(heap, nullptr); MEM_freeN(nodes); } @@ -100,13 +100,13 @@ TEST(heap, Duplicates) const int items_total = SIZE; Heap *heap = BLI_heap_new(); for (int in = 0; in < items_total; in++) { - BLI_heap_insert(heap, 1.0f, 0); + BLI_heap_insert(heap, 1.0f, nullptr); } for (int out_test = 0; out_test < items_total; out_test++) { EXPECT_EQ(0, POINTER_AS_INT(BLI_heap_pop_min(heap))); } EXPECT_TRUE(BLI_heap_is_empty(heap)); - BLI_heap_free(heap, NULL); + BLI_heap_free(heap, nullptr); } static void random_heap_helper(const int items_total, const int random_seed) @@ -122,7 +122,7 @@ static void random_heap_helper(const int items_total, const int random_seed) EXPECT_EQ(out_test, POINTER_AS_INT(BLI_heap_pop_min(heap))); } EXPECT_TRUE(BLI_heap_is_empty(heap)); - BLI_heap_free(heap, NULL); + BLI_heap_free(heap, nullptr); MEM_freeN(values); } @@ -156,7 +156,7 @@ TEST(heap, ReInsertSimple) } EXPECT_TRUE(BLI_heap_is_empty(heap)); - BLI_heap_free(heap, NULL); + BLI_heap_free(heap, nullptr); MEM_freeN(nodes); } @@ -181,7 +181,7 @@ static void random_heap_reinsert_helper(const int items_total, const int random_ BLI_heap_pop_min(heap); } EXPECT_TRUE(BLI_heap_is_empty(heap)); - BLI_heap_free(heap, NULL); + BLI_heap_free(heap, nullptr); MEM_freeN(nodes); } -- cgit v1.2.3