From 3dabd45870e9be5a06bf34f0a44ca13e30a255b1 Mon Sep 17 00:00:00 2001 From: Paul T Date: Wed, 3 Jul 2024 17:23:01 -0400 Subject: [PATCH] test: add variety to tests and added missing include --- test/source/thread_pool.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/source/thread_pool.cpp b/test/source/thread_pool.cpp index fc67998..f5596eb 100644 --- a/test/source/thread_pool.cpp +++ b/test/source/thread_pool.cpp @@ -9,6 +9,7 @@ #include #include #include +#include auto multiply(int a, int b) { return a * b; } @@ -491,8 +492,8 @@ TEST_CASE("Ensure wait_for_tasks() can be called multiple times on the same pool for (size_t i = 0; i < task_count; i++) { counter_wrapper cnt_wrp{}; - for (size_t var1 = 0; var1 < 17; var1++) { - for (int var2 = 0; var2 < 12; var2++) { + for (size_t var1 = 0; var1 < 16; var1++) { + for (int var2 = 0; var2 < 13; var2++) { local_pool.enqueue_detach([&cnt_wrp]() { cnt_wrp.increment_counter(); }); } } @@ -502,9 +503,9 @@ TEST_CASE("Ensure wait_for_tasks() can be called multiple times on the same pool } auto all_correct_count = - std::ranges::all_of(counts, [](int count) { return count == 17 * 12; }); + std::ranges::all_of(counts, [](int count) { return count == 16 * 13; }); auto sum = std::accumulate(counts.begin(), counts.end(), 0); - CHECK_EQ(sum, 17 * 12 * task_count); + CHECK_EQ(sum, 16 * 13 * task_count); CHECK(all_correct_count); for (size_t i = 0; i < task_count; i++) {