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

Method TestCrop

util/generic/vector_ut.cpp:539–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537 };
538
539 void TestCrop() {
540 TVector<TNoDefaultConstructor> vec;
541 vec.emplace_back(42);
542 vec.emplace_back(1337);
543 vec.emplace_back(8888);
544 vec.crop(1); // Should not require default constructor
545 UNIT_ASSERT(vec.size() == 1);
546 UNIT_ASSERT(vec[0].Val == 42);
547 vec.crop(50); // Does nothing if new size is greater than the current size()
548 UNIT_ASSERT(vec.size() == 1);
549 UNIT_ASSERT(vec[0].Val == 42);
550 }
551
552 void TestYResize() {
553 TestYResize<int>();

Callers

nothing calls this directly

Calls 3

cropMethod · 0.80
emplace_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected