| 54 | }; |
| 55 | |
| 56 | TEST_F(TestChunkedArray, Make) { |
| 57 | ASSERT_RAISES(Invalid, ChunkedArray::Make({})); |
| 58 | |
| 59 | ASSERT_OK_AND_ASSIGN(std::shared_ptr<ChunkedArray> result, |
| 60 | ChunkedArray::Make({}, int64())); |
| 61 | AssertTypeEqual(*int64(), *result->type()); |
| 62 | ASSERT_EQ(result->num_chunks(), 0); |
| 63 | // Empty chunked arrays are treated as CPU-allocated. |
| 64 | ASSERT_TRUE(result->is_cpu()); |
| 65 | |
| 66 | auto chunk0 = ArrayFromJSON(int8(), "[0, 1, 2]"); |
| 67 | auto chunk1 = ArrayFromJSON(int16(), "[3, 4, 5]"); |
| 68 | |
| 69 | ASSERT_OK_AND_ASSIGN(result, ChunkedArray::Make({chunk0, chunk0})); |
| 70 | ASSERT_OK_AND_ASSIGN(auto result2, ChunkedArray::Make({chunk0, chunk0}, int8())); |
| 71 | // All chunks are CPU-accessible. |
| 72 | ASSERT_TRUE(result->is_cpu()); |
| 73 | ASSERT_TRUE(result2->is_cpu()); |
| 74 | AssertChunkedEqual(*result, *result2); |
| 75 | |
| 76 | ASSERT_RAISES(TypeError, ChunkedArray::Make({chunk0, chunk1})); |
| 77 | ASSERT_RAISES(TypeError, ChunkedArray::Make({chunk0}, int16())); |
| 78 | } |
| 79 | |
| 80 | TEST_F(TestChunkedArray, ComputeLogicalNullCount) { |
| 81 | // For types with a validity bitmap, the logical null count matches |
nothing calls this directly
no test coverage detected