| 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 | |
| 234 | TEST(ConcatenateEmptyArraysTest, TestValueBuffersNullPtr) { |
no test coverage detected