mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-28 00:10:21 +08:00
Fix tests
This commit is contained in:
parent
924ffc4fbd
commit
6cbddcba39
@ -113,11 +113,12 @@ TEST_CASE("multi threads", "[async]") {
|
|||||||
size_t n_threads = 10;
|
size_t n_threads = 10;
|
||||||
{
|
{
|
||||||
auto [logger, async_sink] = creat_async_logger(queue_size, test_sink);
|
auto [logger, async_sink] = creat_async_logger(queue_size, test_sink);
|
||||||
|
|
||||||
std::vector<std::thread> threads;
|
std::vector<std::thread> threads;
|
||||||
for (size_t i = 0; i < n_threads; i++) {
|
for (size_t i = 0; i < n_threads; i++) {
|
||||||
threads.emplace_back([&] {
|
threads.emplace_back([l=logger, msgs = messages] {
|
||||||
for (size_t j = 0; j < messages; j++) {
|
for (size_t j = 0; j < msgs; j++) {
|
||||||
logger->info("Hello message #{}", j);
|
l->info("Hello message #{}", j);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
logger->flush();
|
logger->flush();
|
||||||
|
Loading…
Reference in New Issue
Block a user