From 924ffc4fbdd63455498c92e0f9fa60d02ce1a9f2 Mon Sep 17 00:00:00 2001 From: gabime Date: Sun, 8 Dec 2024 22:37:41 +0200 Subject: [PATCH] Fix tests --- tests/test_async.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_async.cpp b/tests/test_async.cpp index 7feeaf8b..63dbdd4d 100644 --- a/tests/test_async.cpp +++ b/tests/test_async.cpp @@ -113,10 +113,9 @@ TEST_CASE("multi threads", "[async]") { size_t n_threads = 10; { auto [logger, async_sink] = creat_async_logger(queue_size, test_sink); - std::vector threads; for (size_t i = 0; i < n_threads; i++) { - threads.emplace_back([logger, messages] { + threads.emplace_back([&] { for (size_t j = 0; j < messages; j++) { logger->info("Hello message #{}", j); }