]> git.seodisparate.com - EntityComponentMetaSystem/commitdiff
Fix UnitTests for ThreadPool
authorStephen Seo <seo.disparate@gmail.com>
Wed, 8 Sep 2021 01:46:26 +0000 (10:46 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Wed, 8 Sep 2021 01:46:26 +0000 (10:46 +0900)
src/test/ThreadPoolTest.cpp

index d5ca0d3d368de2e3890c3a5dffc9e623ad937c16..8a9badcd80346568524dac2ed8155b128fd7c28b 100644 (file)
@@ -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);
 }