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

Method TestAligned

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

Source from the content-addressed store, hash-verified

1072class BitmapOp : public ::testing::Test {
1073 public:
1074 void TestAligned(const BitmapOperation& op, const std::vector<int>& left_bits,
1075 const std::vector<int>& right_bits,
1076 const std::vector<int>& result_bits) {
1077 std::shared_ptr<Buffer> left, right, out;
1078 int64_t length;
1079
1080 for (int64_t left_offset : {0, 1, 3, 5, 7, 8, 13, 21, 38, 75, 120, 65536}) {
1081 BitmapFromVector(left_bits, left_offset, &left, &length);
1082 for (int64_t right_offset : {left_offset, left_offset + 8, left_offset + 40}) {
1083 BitmapFromVector(right_bits, right_offset, &right, &length);
1084 for (int64_t out_offset : {left_offset, left_offset + 16, left_offset + 24}) {
1085 ASSERT_OK_AND_ASSIGN(
1086 out, op.Call(default_memory_pool(), left->mutable_data(), left_offset,
1087 right->mutable_data(), right_offset, length, out_offset));
1088 auto reader = BitmapReader(out->mutable_data(), out_offset, length);
1089 ASSERT_READER_VALUES(reader, result_bits);
1090
1091 // Clear out buffer and try non-allocating version
1092 std::memset(out->mutable_data(), 0, out->size());
1093 ASSERT_OK(op.Call(left->mutable_data(), left_offset, right->mutable_data(),
1094 right_offset, length, out_offset, out->mutable_data()));
1095 reader = BitmapReader(out->mutable_data(), out_offset, length);
1096 ASSERT_READER_VALUES(reader, result_bits);
1097 }
1098 }
1099 }
1100 }
1101
1102 void TestUnaligned(const BitmapOperation& op, const std::vector<int>& left_bits,
1103 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