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

Method testCopySingleRangeFromAllNulls

bolt/vector/tests/VectorTest.cpp:602–626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

600 }
601
602 void testCopySingleRangeFromAllNulls(
603 const VectorPtr& vector,
604 const VectorPtr& allNullSource) {
605 SCOPED_TRACE(vector->toString());
606
607 const vector_size_t size = 1'000;
608
609 ASSERT_GE(vector->size(), size);
610
611 // Save a copy of the 'vector' to compare results after copy.
612 auto vectorCopy = BaseVector::copy(*vector);
613
614 vector->copy(allNullSource.get(), 40, 33, 78);
615
616 for (auto i = 0; i < size; ++i) {
617 if (i < 40 || i >= 40 + 78) {
618 EXPECT_FALSE(vector->isNullAt(i));
619 EXPECT_TRUE(vector->equalValueAt(vectorCopy.get(), i, i))
620 << "at " << i << ": " << vector->toString(i) << " vs. "
621 << vectorCopy->toString(i);
622 } else {
623 EXPECT_TRUE(vector->isNullAt(i)) << "at " << i;
624 }
625 }
626 }
627
628 void testCopyRangesFromAllNulls(
629 const VectorPtr& vector,

Callers

nothing calls this directly

Calls 7

equalValueAtMethod · 0.80
copyFunction · 0.50
toStringMethod · 0.45
sizeMethod · 0.45
copyMethod · 0.45
getMethod · 0.45
isNullAtMethod · 0.45

Tested by

no test coverage detected