MCPcopy Create free account
hub / github.com/catboost/catboost / TestCapacity

Method TestCapacity

util/generic/vector_ut.cpp:302–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300 };
301
302 void TestCapacity() {
303 {
304 TVector<int> v;
305
306 UNIT_ASSERT(v.capacity() == 0);
307 v.push_back(42);
308 UNIT_ASSERT(v.capacity() >= 1);
309 v.reserve(5000);
310 UNIT_ASSERT(v.capacity() >= 5000);
311 }
312
313 {
314 TVector<int> v(Reserve(100));
315
316 UNIT_ASSERT(v.capacity() >= 100);
317 UNIT_ASSERT(v.size() == 0);
318 }
319
320 {
321 // Test that used to generate an assertion when using __debug_alloc.
322 TVector<TestStruct> va;
323 va.reserve(1);
324 va.reserve(2);
325 }
326 }
327
328 void TestAt() {
329 TVector<int> v;

Callers

nothing calls this directly

Calls 5

ReserveFunction · 0.85
capacityMethod · 0.45
push_backMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected