MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

libs/coding/coding_tests/compressed_bit_vector_test.cpp:84–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82} // namespace
83
84UNIT_TEST(CompressedBitVector_Intersect1)
85{
86 size_t const kNumBits = 100;
87 vector<uint64_t> setBits1;
88 vector<uint64_t> setBits2;
89 for (size_t i = 0; i < kNumBits; ++i)
90 {
91 if (i > 0)
92 setBits1.push_back(i);
93 if (i + 1 < kNumBits)
94 setBits2.push_back(i);
95 }
96 auto cbv1 = coding::CompressedBitVectorBuilder::FromBitPositions(setBits1);
97 auto cbv2 = coding::CompressedBitVectorBuilder::FromBitPositions(setBits2);
98 TEST(cbv1.get(), ());
99 TEST(cbv2.get(), ());
100
101 auto cbv3 = coding::CompressedBitVector::Intersect(*cbv1, *cbv2);
102 TEST_EQUAL(coding::CompressedBitVector::StorageStrategy::Dense, cbv3->GetStorageStrategy(), ());
103 CheckIntersection(setBits1, setBits2, *cbv3);
104}
105
106UNIT_TEST(CompressedBitVector_Intersect2)
107{

Callers

nothing calls this directly

Calls 15

TESTFunction · 0.85
CheckIntersectionFunction · 0.85
SubtractFunction · 0.85
CheckSubtractionFunction · 0.85
CheckUnionFunction · 0.85
ForEachFunction · 0.85
GetStorageStrategyMethod · 0.80
LeaveFirstSetNBitsMethod · 0.80
IntersectFunction · 0.70
getMethod · 0.65
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected