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

Function TEST_F

cpp/src/gandiva/selection_vector_test.cc:39–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37static inline uint32_t RoundUpNumi64(uint32_t value) { return (value + 63) >> 6; }
38
39TEST_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
60TEST_F(TestSelectionVector, TestInt16MakeNegative) {
61 int max_slots = 10;

Callers

nothing calls this directly

Calls 13

RoundUpNumi64Function · 0.85
SetBitFunction · 0.85
GetMaxSlotsMethod · 0.80
GetNumSlotsMethod · 0.80
SetIndexMethod · 0.80
GetIndexMethod · 0.80
SetNumSlotsMethod · 0.80
PopulateFromBitMapMethod · 0.80
okMethod · 0.45
ToArrayMethod · 0.45
lengthMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected