From: Stephen Seo Date: Wed, 8 Sep 2021 01:46:26 +0000 (+0900) Subject: Fix UnitTests for ThreadPool X-Git-Tag: 1.0~25 X-Git-Url: https://git.seodisparate.com/stephenseo/static/search/searchdata.js?a=commitdiff_plain;h=64e9b18f890d409cad7a1324595114d839fdf4ce;p=EntityComponentMetaSystem Fix UnitTests for ThreadPool --- diff --git a/src/test/ThreadPoolTest.cpp b/src/test/ThreadPoolTest.cpp index d5ca0d3..8a9badc 100644 --- a/src/test/ThreadPoolTest.cpp +++ b/src/test/ThreadPoolTest.cpp @@ -20,7 +20,7 @@ TEST(ECThreadPool, CannotCompile) { do { std::this_thread::sleep_for(std::chrono::milliseconds(10)); - } while(!p.isQueueEmpty() && !p.isAllThreadsWaiting()); + } while(!p.isQueueEmpty() || !p.isAllThreadsWaiting()); ASSERT_EQ(data.load(), 1); @@ -31,7 +31,7 @@ TEST(ECThreadPool, CannotCompile) { do { std::this_thread::sleep_for(std::chrono::milliseconds(10)); - } while(!p.isQueueEmpty() && !p.isAllThreadsWaiting()); + } while(!p.isQueueEmpty() || !p.isAllThreadsWaiting()); ASSERT_EQ(data.load(), 11); } @@ -51,7 +51,7 @@ TEST(ECThreadPool, Simple) { do { std::this_thread::sleep_for(std::chrono::milliseconds(10)); - } while(!p.isQueueEmpty() && !p.isAllThreadsWaiting()); + } while(!p.isQueueEmpty() || !p.isAllThreadsWaiting()); ASSERT_EQ(data.load(), 1); @@ -62,7 +62,7 @@ TEST(ECThreadPool, Simple) { do { std::this_thread::sleep_for(std::chrono::milliseconds(10)); - } while(!p.isQueueEmpty() && !p.isAllThreadsWaiting()); + } while(!p.isQueueEmpty() || !p.isAllThreadsWaiting()); ASSERT_EQ(data.load(), 11); }