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

Method TestAligned

cpp/src/arrow/util/bitmap_test.cc:1197–1223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1195class BitmapOp : public ::testing::Test {
1196 public:
1197 void TestAligned(const BitmapOperation& op, const std::vector<int>& left_bits,
1198 const std::vector<int>& right_bits,
1199 const std::vector<int>& result_bits) {
1200 std::shared_ptr<Buffer> left, right, out;
1201 int64_t length;
1202
1203 for (int64_t left_offset : {0, 1, 3, 5, 7, 8, 13, 21, 38, 75, 120, 65536}) {
1204 BitmapFromVector(left_bits, left_offset, &left, &length);
1205 for (int64_t right_offset : {left_offset, left_offset + 8, left_offset + 40}) {
1206 BitmapFromVector(right_bits, right_offset, &right, &length);
1207 for (int64_t out_offset : {left_offset, left_offset + 16, left_offset + 24}) {
1208 ASSERT_OK_AND_ASSIGN(
1209 out, op.Call(default_memory_pool(), left->mutable_data(), left_offset,
1210 right->mutable_data(), right_offset, length, out_offset));
1211 auto reader = BitmapReader(out->mutable_data(), out_offset, length);
1212 ASSERT_READER_VALUES(reader, result_bits);
1213
1214 // Clear out buffer and try non-allocating version
1215 std::memset(out->mutable_data(), 0, out->size());
1216 ASSERT_OK(op.Call(left->mutable_data(), left_offset, right->mutable_data(),
1217 right_offset, length, out_offset, out->mutable_data()));
1218 reader = BitmapReader(out->mutable_data(), out_offset, length);
1219 ASSERT_READER_VALUES(reader, result_bits);
1220 }
1221 }
1222 }
1223 }
1224
1225 void TestUnaligned(const BitmapOperation& op, const std::vector<int>& left_bits,
1226 const std::vector<int>& right_bits,

Callers

nothing calls this directly

Calls 8

default_memory_poolFunction · 0.85
ASSERT_READER_VALUESFunction · 0.85
BitmapFromVectorFunction · 0.70
ASSERT_OK_AND_ASSIGNFunction · 0.70
BitmapReaderClass · 0.70
CallMethod · 0.45
mutable_dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected