MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

libs/base/base_tests/thread_pool_tests.cpp:36–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34} // namespace
35
36UNIT_TEST(ThreadPool_CanceledTaskTest)
37{
38 int finishCounter = 0;
39 Condition cond;
40 base::ThreadPool pool(4,
41 std::bind(&JoinFinishFunction, std::placeholders::_1, std::ref(finishCounter), std::ref(cond)));
42
43 for (int i = 0; i < TASK_COUNT; ++i)
44 pool.PushBack(new CanceledTask());
45
46 pool.Stop();
47
48 TEST_EQUAL(finishCounter, TASK_COUNT, ());
49}
50
51namespace
52{

Callers

nothing calls this directly

Calls 5

SleepFunction · 0.85
waitMethod · 0.80
PushBackMethod · 0.45
StopMethod · 0.45
CancelMethod · 0.45

Tested by

no test coverage detected