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

Function TestFixedThreadName

util/thread/pool_ut.cpp:181–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179 }
180
181 void TestFixedThreadName(IThreadPool& pool, const TString& expectedName) {
182 pool.Start(1);
183 TString name;
184 pool.SafeAddFunc([&name]() {
185 name = TThread::CurrentThreadName();
186 });
187 pool.Stop();
188 if (TThread::CanGetCurrentThreadName()) {
189 UNIT_ASSERT_EQUAL(name, expectedName);
190 UNIT_ASSERT_UNEQUAL(TThread::CurrentThreadName(), expectedName);
191 }
192 }
193
194 Y_UNIT_TEST(TestFixedThreadName) {
195 const TString expectedName = "HelloWorld";

Callers 1

Y_UNIT_TESTFunction · 0.85

Calls 3

SafeAddFuncMethod · 0.80
StartMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected