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

Method TestMessageCrop

util/generic/yexception_ut.cpp:344–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342 }
343
344 void TestMessageCrop() {
345 TTempBuf tmp;
346 size_t size = tmp.Size() * 1.5;
347 TString s;
348 s.reserve(size);
349 TMersenne<ui64> generator(42);
350 for (int j = 0; j < 50; ++j) {
351 for (size_t i = 0; i < size; ++i) {
352 s += static_cast<char>('a' + generator() % 26);
353 }
354 yexception e;
355 e << s;
356 UNIT_ASSERT_EQUAL(e.AsStrBuf(), s.substr(0, tmp.Size() - 1));
357 }
358 }
359
360 void TestTIoSystemErrorSpecialMethods() {
361 TString testStr{"systemError"};

Callers

nothing calls this directly

Calls 4

AsStrBufMethod · 0.80
SizeMethod · 0.45
reserveMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected