MCPcopy Create free account
hub / github.com/EndstoneMC/endstone / TEST

Function TEST

tests/test_thread_pool_executor.cpp:22–29  ·  view source on GitHub ↗

Test if tasks are executed

Source from the content-addressed store, hash-verified

20
21// Test if tasks are executed
22TEST(ThreadPoolExecutorTest, ExecuteTasks)
23{
24 ThreadPoolExecutor executor(4);
25 auto future1 = executor.submit([]() { return 1; });
26 auto future2 = executor.submit([](int a, int b) { return a + b; }, 2, 3);
27 EXPECT_EQ(future1.get(), 1);
28 EXPECT_EQ(future2.get(), 5);
29}
30
31// Test if tasks are executed in parallel
32TEST(ThreadPoolExecutorTest, ParallelExecution)

Callers

nothing calls this directly

Calls 5

countMethod · 0.80
push_backMethod · 0.80
submitMethod · 0.45
getMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected