From ac3bd445a4947996fa0f822de92ae75caf3a23e9 Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Wed, 11 Sep 2019 15:05:34 +0300 Subject: [PATCH] [#883, !506] fixed comments --- src/lib/dhcpsrv/tests/thread_pool_unittest.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/dhcpsrv/tests/thread_pool_unittest.cc b/src/lib/dhcpsrv/tests/thread_pool_unittest.cc index ca81f653d9..69d8cb4b60 100644 --- a/src/lib/dhcpsrv/tests/thread_pool_unittest.cc +++ b/src/lib/dhcpsrv/tests/thread_pool_unittest.cc @@ -189,7 +189,9 @@ TEST_F(ThreadPoolTest, testAddAndCount) { uint32_t items_count; ThreadPool::WorkItemCallBack call_back; ThreadPool thread_pool; + // the item count should be 0 ASSERT_EQ(thread_pool.count(), 0); + // the thread count should be 0 ASSERT_EQ(thread_pool.size(), 0); items_count = 4; @@ -210,7 +212,10 @@ TEST_F(ThreadPoolTest, testCreateAndDestroy) { uint32_t thread_count; ThreadPool::WorkItemCallBack call_back; ThreadPool thread_pool; + // the item count should be 0 ASSERT_EQ(thread_pool.count(), 0); + // the thread count should be 0 + ASSERT_EQ(thread_pool.size(), 0); items_count = 4; thread_count = 4; @@ -218,7 +223,7 @@ TEST_F(ThreadPoolTest, testCreateAndDestroy) { reset(thread_count); // create tasks which block thread pool threads until signaled by main - // to force all threads of the thread pool to run exactly one task + // thread to force all threads of the thread pool to run exactly one task call_back = std::bind(&ThreadPoolTest::runAndWait, this); // add items to stopped thread pool @@ -373,7 +378,10 @@ TEST_F(ThreadPoolTest, testStartAndStop) { uint32_t thread_count; ThreadPool::WorkItemCallBack call_back; ThreadPool thread_pool; + // the item count should be 0 ASSERT_EQ(thread_pool.count(), 0); + // the thread count should be 0 + ASSERT_EQ(thread_pool.size(), 0); items_count = 4; thread_count = 4; @@ -381,7 +389,7 @@ TEST_F(ThreadPoolTest, testStartAndStop) { reset(thread_count); // create tasks which block thread pool threads until signaled by main - // to force all threads of the thread pool to run exactly one task + // thread to force all threads of the thread pool to run exactly one task call_back = std::bind(&ThreadPoolTest::runAndWait, this); // calling start should create the threads and should keep the queued items -- 2.47.2