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

Method Check

cpp/src/arrow/array/array_test.cc:1285–1314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1283 }
1284
1285 void Check(const std::unique_ptr<BuilderType>& builder, bool nullable) {
1286 int64_t size = builder->length();
1287 auto ex_data = Buffer::Wrap(draws_.data(), size);
1288
1289 std::shared_ptr<Buffer> ex_null_bitmap;
1290 int64_t ex_null_count = 0;
1291
1292 if (nullable) {
1293 ASSERT_OK_AND_ASSIGN(ex_null_bitmap, internal::BytesToBits(valid_bytes_));
1294 ex_null_count = CountNulls(valid_bytes_);
1295 } else {
1296 ex_null_bitmap = nullptr;
1297 }
1298
1299 auto expected =
1300 std::make_shared<ArrayType>(size, ex_data, ex_null_bitmap, ex_null_count);
1301
1302 std::shared_ptr<Array> out;
1303 FinishAndCheckPadding(builder.get(), &out);
1304
1305 std::shared_ptr<ArrayType> result = checked_pointer_cast<ArrayType>(out);
1306
1307 // Builder is now reset
1308 ASSERT_EQ(0, builder->length());
1309 ASSERT_EQ(0, builder->capacity());
1310 ASSERT_EQ(0, builder->null_count());
1311
1312 ASSERT_EQ(ex_null_count, result->null_count());
1313 ASSERT_TRUE(result->Equals(*expected));
1314 }
1315
1316 void FlipValue(CType* ptr) {
1317 auto byteptr = reinterpret_cast<uint8_t*>(ptr);

Callers 1

TYPED_TESTFunction · 0.45

Calls 11

WrapFunction · 0.85
BytesToBitsFunction · 0.85
CountNullsFunction · 0.85
FinishAndCheckPaddingFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.70
lengthMethod · 0.45
dataMethod · 0.45
getMethod · 0.45
capacityMethod · 0.45
null_countMethod · 0.45
EqualsMethod · 0.45

Tested by

no test coverage detected