Testing if submit thread task for each successfully.
288 {
289
291
292 auto func = []() -> void
293 {
294 std::this_thread::sleep_for(std::chrono::seconds(2));
295 };
296
297 m_ThreadPool.SubmitThreadTask_LightWeight_ForEach(func);
298
299
300 m_ThreadPool.Wait();
301
302 EXPECT_EQ(m_ThreadPool.GetInitThreadSize() ,nThreads );
303 EXPECT_EQ(m_ThreadPool.GetIdleThreadSize() ,nThreads );
305 EXPECT_EQ(m_ThreadPool.GetTasks() ,0 );
306 EXPECT_EQ(m_ThreadPool.GetThreadsCount() ,nThreads );
307 EXPECT_EQ(m_ThreadPool.GetThreadIdleTimeOut(),10 );
308 EXPECT_EQ(m_ThreadPool.IsPoolRunning() ,true );
309
310 for (auto& pair : m_ThreadPool.GetThreads())
311 {
312 EXPECT_EQ(pair.second->GetThreadTasksCount(), 0);
313 }
314 }
#define SPICESTEST_PROFILE_FUNCTION()