MCPcopy Create free account
hub / github.com/bytedance/bolt / TEST_F

Function TEST_F

bolt/vector/arrow/tests/ArrowBridgeArrayTest.cpp:418–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416};
417
418TEST_F(ArrowBridgeArrayExportTest, flatNotNull) {
419 std::vector<int64_t> inputData = {1, 2, 3, 4, 5};
420 ArrowArray arrowArray;
421 {
422 // Make sure that ArrowArray is correctly acquiring ownership, even after
423 // the initial vector shared_ptr is gone.
424 auto flatVector = vectorMaker_.flatVector(inputData);
425 bolt::exportToArrow(flatVector, arrowArray, pool_.get(), options_);
426 }
427
428 EXPECT_EQ(inputData.size(), arrowArray.length);
429 EXPECT_EQ(0, arrowArray.null_count);
430 EXPECT_EQ(0, arrowArray.offset);
431 EXPECT_EQ(0, arrowArray.n_children);
432
433 EXPECT_EQ(nullptr, arrowArray.children);
434 EXPECT_EQ(nullptr, arrowArray.dictionary);
435
436 // Validate buffers.
437 EXPECT_EQ(2, arrowArray.n_buffers); // null and values buffers.
438 EXPECT_EQ(nullptr, arrowArray.buffers[0]); // no nulls.
439
440 const int64_t* values = static_cast<const int64_t*>(arrowArray.buffers[1]);
441
442 for (size_t i = 0; i < inputData.size(); ++i) {
443 EXPECT_EQ(inputData[i], values[i]);
444 }
445
446 // Consumers are required to call release. Ensure release and private_data
447 // are null after releasing it.
448 arrowArray.release(&arrowArray);
449 EXPECT_EQ(nullptr, arrowArray.release);
450 EXPECT_EQ(nullptr, arrowArray.private_data);
451}
452
453TEST_F(ArrowBridgeArrayExportTest, flatBool) {
454 testFlatVector<bool>({

Callers

nothing calls this directly

Calls 15

lowestFunction · 0.85
isBitNullFunction · 0.85
toArrowFunction · 0.85
validateOffsetsFunction · 0.85
wrapInDictionaryFunction · 0.85
ARRAYFunction · 0.85
importFromArrowAsViewerFunction · 0.85
MAPFunction · 0.85
allocateIndicesFunction · 0.85
UNKNOWNFunction · 0.85
testConstantFunction · 0.85
makeArrowSchemaFunction · 0.85

Tested by

no test coverage detected