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

Method CheckClear

cpp/src/arrow/util/small_vector_test.cc:233–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231
232 template <size_t N>
233 void CheckClear(bool expect_overflow) {
234 IntVectorType<N> ints = MakeVector<N>({5, 6, 7, 8, 9});
235 ASSERT_EQ(ints.size(), 5);
236 size_t capacity = ints.capacity();
237
238 ints.clear();
239 ASSERT_EQ(ints.size(), 0);
240 ASSERT_EQ(ints.capacity(), capacity);
241 ASSERT_EQ(UsesStaticStorage(ints), !expect_overflow);
242 }
243
244 void TestClear() {
245 CheckClear<Traits::TestSizeFor(5)>(/*expect_overflow=*/Traits::CanOverflow());

Callers

nothing calls this directly

Calls 4

UsesStaticStorageFunction · 0.85
sizeMethod · 0.45
capacityMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected