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

Method TestAligned

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

Source from the content-addressed store, hash-verified

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