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

Method assign

util/generic/string_ut.cpp:473–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471 }
472
473 void assign() {
474 TStringType s;
475 TChar const* cstr = Data_.test_string_for_assign();
476
477 s.assign(cstr, cstr + 22);
478 UNIT_ASSERT(s == Data_.test_string_for_assign());
479
480 TStringType s2(Data_.other_test_string());
481 s.assign(s2);
482 UNIT_ASSERT(s == s2);
483
484 static TStringType str1;
485 static TStringType str2;
486
487 // short TStringType optim:
488 str1 = Data_._123456();
489 // longer than short TStringType:
490 str2 = Data_._1234567890123456789012345678901234567890();
491
492 UNIT_ASSERT(str1[5] == *Data_._6());
493 UNIT_ASSERT(str2[29] == *Data_._0());
494 }
495
496 void copy() {
497 TStringType s(Data_.foo());

Callers 12

UnpackLeafMethod · 0.45
TestInitializeListMethod · 0.45
TestFuncsMethod · 0.45
string.hFile · 0.45
TestFillingAssignMethod · 0.45
AsStringMethod · 0.45
Y_UNIT_TESTFunction · 0.45
TVectorClass · 0.45
StripStringMethod · 0.45
Y_UNIT_TESTFunction · 0.45
string>Method · 0.45
TestIsSpaceMethod · 0.45

Calls 6

other_test_stringMethod · 0.80
_123456Method · 0.80
_6Method · 0.80
_0Method · 0.80

Tested by 4

TestInitializeListMethod · 0.36
TestFuncsMethod · 0.36
TestFillingAssignMethod · 0.36
TestIsSpaceMethod · 0.36