| 37 | static inline uint32_t RoundUpNumi64(uint32_t value) { return (value + 63) >> 6; } |
| 38 | |
| 39 | TEST_F(TestSelectionVector, TestInt16Make) { |
| 40 | int max_slots = 10; |
| 41 | |
| 42 | // Test with pool allocation |
| 43 | std::shared_ptr<SelectionVector> selection; |
| 44 | auto status = SelectionVector::MakeInt16(max_slots, pool_, &selection); |
| 45 | EXPECT_EQ(status.ok(), true) << status.message(); |
| 46 | EXPECT_EQ(selection->GetMaxSlots(), max_slots); |
| 47 | EXPECT_EQ(selection->GetNumSlots(), 0); |
| 48 | |
| 49 | // Test with pre-alloced buffer |
| 50 | std::shared_ptr<SelectionVector> selection2; |
| 51 | auto buffer_len = max_slots * sizeof(int16_t); |
| 52 | ASSERT_OK_AND_ASSIGN(auto buffer, arrow::AllocateBuffer(buffer_len, pool_)); |
| 53 | |
| 54 | status = SelectionVector::MakeInt16(max_slots, std::move(buffer), &selection2); |
| 55 | EXPECT_EQ(status.ok(), true) << status.message(); |
| 56 | EXPECT_EQ(selection2->GetMaxSlots(), max_slots); |
| 57 | EXPECT_EQ(selection2->GetNumSlots(), 0); |
| 58 | } |
| 59 | |
| 60 | TEST_F(TestSelectionVector, TestInt16MakeNegative) { |
| 61 | int max_slots = 10; |
nothing calls this directly
no test coverage detected