MCPcopy Create free account
hub / github.com/apache/arrow / Check

Method Check

cpp/src/arrow/array/concatenate_test.cc:207–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205
206 template <typename ArrayFactory>
207 void Check(ArrayFactory&& factory) {
208 for (auto size : this->sizes_) {
209 auto offsets = rag.Offsets<int32_t>(size, 3);
210 for (auto null_probability : this->null_probabilities_) {
211 std::shared_ptr<Array> array;
212 factory(size, null_probability, &array);
213 ASSERT_OK(array->ValidateFull());
214 auto expected = array->Slice(offsets.front(), offsets.back() - offsets.front());
215 ASSERT_OK(expected->ValidateFull());
216 auto slices = rag.Slices(array, offsets);
217 for (auto slice : slices) {
218 ASSERT_OK(slice->ValidateFull());
219 }
220 ASSERT_OK_AND_ASSIGN(auto actual, Concatenate(slices));
221 ASSERT_OK(actual->ValidateFull());
222 AssertArraysEqual(*expected, *actual);
223 if (actual->data()->buffers[0]) {
224 CheckTrailingBitsAreZeroed(actual->data()->buffers[0], actual->length());
225 }
226 if (actual->type_id() == Type::BOOL) {
227 CheckTrailingBitsAreZeroed(actual->data()->buffers[1], actual->length());
228 }
229 }
230 }
231 }
232};
233
234TEST(ConcatenateEmptyArraysTest, TestValueBuffersNullPtr) {

Callers 1

TYPED_TESTFunction · 0.45

Calls 9

factoryFunction · 0.85
AssertArraysEqualFunction · 0.85
backMethod · 0.80
ValidateFullMethod · 0.45
SliceMethod · 0.45
SlicesMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45
type_idMethod · 0.45

Tested by

no test coverage detected