From 4ac2b8e585cbf7064f9bdde4eabaf8ff42801142 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 10 Nov 2017 14:14:17 -0800 Subject: Enable clang-tidy as a sanity check, fix up all known failures --- test/core/slice/slice_hash_table_test.cc | 6 +++--- test/core/slice/slice_test.cc | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test/core/slice') diff --git a/test/core/slice/slice_hash_table_test.cc b/test/core/slice/slice_hash_table_test.cc index a2006b3c10..0ee4e8617d 100644 --- a/test/core/slice/slice_hash_table_test.cc +++ b/test/core/slice/slice_hash_table_test.cc @@ -46,7 +46,7 @@ static void check_values(const test_entry* input, size_t num_entries, grpc_slice key = grpc_slice_from_static_string(input[i].key); const char* actual = static_cast(grpc_slice_hash_table_get(table, key)); - GPR_ASSERT(actual != NULL); + GPR_ASSERT(actual != nullptr); GPR_ASSERT(strcmp(actual, input[i].value) == 0); grpc_slice_unref(key); } @@ -55,7 +55,7 @@ static void check_values(const test_entry* input, size_t num_entries, static void check_non_existent_value(const char* key_string, grpc_slice_hash_table* table) { grpc_slice key = grpc_slice_from_static_string(key_string); - GPR_ASSERT(grpc_slice_hash_table_get(table, key) == NULL); + GPR_ASSERT(grpc_slice_hash_table_get(table, key) == nullptr); grpc_slice_unref(key); } @@ -116,7 +116,7 @@ static void test_slice_hash_table() { }; const size_t num_entries = GPR_ARRAY_SIZE(test_entries); grpc_slice_hash_table* table = - create_table_from_entries(test_entries, num_entries, NULL); + create_table_from_entries(test_entries, num_entries, nullptr); // Check contents of table. check_values(test_entries, num_entries, table); check_non_existent_value("XX", table); diff --git a/test/core/slice/slice_test.cc b/test/core/slice/slice_test.cc index aec5636376..02f6b1ea79 100644 --- a/test/core/slice/slice_test.cc +++ b/test/core/slice/slice_test.cc @@ -50,10 +50,10 @@ static void test_slice_malloc_returns_something_sensible(void) { GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == length); /* If the slice has a refcount, it must be destroyable. */ if (slice.refcount) { - GPR_ASSERT(slice.refcount->vtable != NULL); - GPR_ASSERT(slice.refcount->vtable->ref != NULL); - GPR_ASSERT(slice.refcount->vtable->unref != NULL); - GPR_ASSERT(slice.refcount->vtable->hash != NULL); + GPR_ASSERT(slice.refcount->vtable != nullptr); + GPR_ASSERT(slice.refcount->vtable->ref != nullptr); + GPR_ASSERT(slice.refcount->vtable->unref != nullptr); + GPR_ASSERT(slice.refcount->vtable->hash != nullptr); } /* We must be able to write to every byte of the data */ for (i = 0; i < length; i++) { -- cgit v1.2.3