From 7964f9ea9a498fb4990f5fdf47ffa7fc16553a44 Mon Sep 17 00:00:00 2001 From: Felix Heitmann Date: Tue, 8 Oct 2024 09:37:28 +0200 Subject: [PATCH] fixing signed/unsigned in test attributes --- tests/test_attributes.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_attributes.cpp b/tests/test_attributes.cpp index 53feb7b9..799619cc 100644 --- a/tests/test_attributes.cpp +++ b/tests/test_attributes.cpp @@ -173,7 +173,7 @@ TEST_CASE("attribute test - nested scoped") { } TEST_CASE("attribute test - multi threaded") { - const int n_tasks = std::thread::hardware_concurrency(); + const unsigned int n_tasks = std::thread::hardware_concurrency(); constexpr auto n_values = 30; auto mt_sink = std::make_shared(); auto logger = spdlog::logger("logger", mt_sink); @@ -181,7 +181,7 @@ TEST_CASE("attribute test - multi threaded") { // put attributes with multiple threads simultaneously std::vector> tasks; - for (auto i = 0; i < n_tasks; ++i) { + for (unsigned int i = 0; i < n_tasks; ++i) { auto task = std::async([&logger, i, n_values] { for (auto j = 0; j < n_values; ++j) logger.attrs().put(fmt_lib::format("log_{}_key_{}", i, j), fmt_lib::format("log_{}_value_{}", i, j)); @@ -194,7 +194,7 @@ TEST_CASE("attribute test - multi threaded") { logger.info(""); REQUIRE(!mt_sink->lines().empty()); auto log_line = mt_sink->lines().back(); - for (auto i = 0; i < n_tasks; ++i) { + for (unsigned int i = 0; i < n_tasks; ++i) { for (auto j = 0; j < n_values; ++j) { auto search_term = fmt_lib::format("log_{0}_key_{1}:log_{0}_value_{1}", i, j); REQUIRE(log_line.find(search_term) != std::string::npos);