diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-11-06 19:49:09 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-11-06 20:08:25 +0300 |
commit | 16732def37c5a66f3ea28dbe247b09cc6bca6677 (patch) | |
tree | 5d14f5c920a1411e336bd80b12becbb3f73de19a /source/blender/blenlib/tests/BLI_heap_test.cc | |
parent | 88926375a0e4e45f72c87b9e487c060ddd3c9216 (diff) |
Cleanup: Clang-Tidy modernize-use-nullptr
Replace `NULL` with `nullptr` in C++ code.
No functional changes.
Diffstat (limited to 'source/blender/blenlib/tests/BLI_heap_test.cc')
-rw-r--r-- | source/blender/blenlib/tests/BLI_heap_test.cc | 22 |
1 files changed, 11 insertions, 11 deletions
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); } |