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

Method resize

util/generic/string_ut.cpp:414–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412 }
413
414 void resize() {
415 TStringType s;
416
417 s.resize(0);
418
419 UNIT_ASSERT(*s.c_str() == 0);
420
421 s = Data_._1234567();
422
423 s.resize(0);
424 UNIT_ASSERT(*s.c_str() == 0);
425
426 s = Data_._1234567();
427 s.resize(1);
428 UNIT_ASSERT(s.size() == 1);
429 UNIT_ASSERT(*s.c_str() == *Data_._1());
430 UNIT_ASSERT(*(s.c_str() + 1) == 0);
431
432 s = Data_._1234567();
433#if 0
434 s.resize(10);
435#else
436 s.resize(10, 0);
437#endif
438 UNIT_ASSERT(s.size() == 10);
439 UNIT_ASSERT(s[6] == *Data_._7());
440 UNIT_ASSERT(s[7] == 0);
441 UNIT_ASSERT(s[8] == 0);
442 UNIT_ASSERT(s[9] == 0);
443 }
444
445 void find() {
446 TStringType s(Data_.one_two_three_one_two_three());

Callers 15

LoadSizeAndResizeFunction · 0.45
CheckMoveAllocMethod · 0.45
GetNetworkInterfacesFunction · 0.45
TestShrinkMethod · 0.45
TestFuncsMethod · 0.45
ResizeUninitializedFunction · 0.45
string.hFile · 0.45
reserveMethod · 0.45
Y_UNIT_TESTFunction · 0.45
TryGetEnvFunction · 0.45
UTF8ToWCHARFunction · 0.45
ValuePtrMethod · 0.45

Calls 5

_1234567Method · 0.80
_1Method · 0.80
_7Method · 0.80
c_strMethod · 0.45
sizeMethod · 0.45

Tested by 4

TestShrinkMethod · 0.36
TestFuncsMethod · 0.36
TestCollapseBufferMethod · 0.36