From 9ae54ae42fc4b82aeeaccd4086a6483842fc462a Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Thu, 11 Apr 2024 12:08:31 +0200 Subject: [PATCH] address feedback --- cpp/src/arrow/array/array_test.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cpp/src/arrow/array/array_test.cc b/cpp/src/arrow/array/array_test.cc index e222d2b4e8f79..60efdb47683f4 100644 --- a/cpp/src/arrow/array/array_test.cc +++ b/cpp/src/arrow/array/array_test.cc @@ -1309,12 +1309,11 @@ TEST(TestBooleanArray, TrueCountFalseCount) { CheckArray(checked_cast(*arr->Slice(0, 0))); // GH-41016 true_count() with array without validity buffer with null_count of -1 - auto data = ArrayFromJSON(boolean(), "[true, false, true]")->data(); - data->null_count = -1; - auto arr_unknown_null_count = std::make_shared(data); + auto arr_unknown_null_count = ArrayFromJSON(boolean(), "[true, false, true]"); + arr_unknown_null_count->data()->null_count = kUnknownNullCount; ASSERT_EQ(arr_unknown_null_count->data()->null_count.load(), -1); ASSERT_EQ(arr_unknown_null_count->null_bitmap(), nullptr); - ASSERT_EQ(arr_unknown_null_count->true_count(), 2); + ASSERT_EQ(checked_pointer_cast(arr_unknown_null_count)->true_count(), 2); } TEST(TestPrimitiveAdHoc, TestType) {