diff --git a/tests/ulib/system/thread_pool_unittest.cpp b/tests/ulib/system/thread_pool_unittest.cpp index 3d29d71..9879915 100644 --- a/tests/ulib/system/thread_pool_unittest.cpp +++ b/tests/ulib/system/thread_pool_unittest.cpp @@ -4,7 +4,10 @@ class ThreadPoolTest : public ::testing::Test { protected: - void SetUp() override { thread_pool_ = std::make_unique(10); } + void SetUp() override + { + thread_pool_ = std::make_unique(10); + } std::unique_ptr thread_pool_; }; @@ -32,3 +35,15 @@ TEST_F(ThreadPoolTest, MultiTask) for (auto &future : futures) { ASSERT_EQ(future.get(), 3); } } + +TEST_F(ThreadPoolTest, NoArgs) +{ + std::vector> futures; + for (int i = 0; i < 1000; ++i) { + futures.emplace_back(thread_pool_->Submit([]() { + ulib::Thread::Sleep(1000); + return 1; + })); + } + for (auto &future : futures) { future.get(); } +}