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

Method TestShrink

util/generic/vector_ut.cpp:411–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409 }
410
411 void TestShrink() {
412 TVector<int> v;
413 v.resize(1000);
414 v.resize(10);
415 v.shrink_to_fit();
416 UNIT_ASSERT_EQUAL(v.capacity(), 10);
417 v.push_back(0);
418 v.shrink_to_fit();
419 UNIT_ASSERT_EQUAL(v.capacity(), 11);
420 }
421
422 /* This test check a potential issue with empty base class
423 * optimization. Some compilers (VC6) do not implement it

Callers

nothing calls this directly

Calls 4

shrink_to_fitMethod · 0.80
resizeMethod · 0.45
capacityMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected