From 0d0a841e8df52891cc71b2dffcaf4bb3a370014d Mon Sep 17 00:00:00 2001 From: gabime Date: Sun, 27 May 2018 02:21:49 +0300 Subject: [PATCH] format --- tests/test_async.cpp | 64 ++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/tests/test_async.cpp b/tests/test_async.cpp index ce1d6ed8..a57d1969 100644 --- a/tests/test_async.cpp +++ b/tests/test_async.cpp @@ -103,42 +103,42 @@ TEST_CASE("multi threads", "[async]") TEST_CASE("to_file", "[async]") { - prepare_logdir(); - size_t messages = 1024; - size_t tp_threads = 1; - std::string filename = "logs/async_test.log"; - { - auto file_sink = std::make_shared(filename, true); - auto tp = std::make_shared(messages, tp_threads); - auto logger = std::make_shared("as", std::move(file_sink), std::move(tp)); + prepare_logdir(); + size_t messages = 1024; + size_t tp_threads = 1; + std::string filename = "logs/async_test.log"; + { + auto file_sink = std::make_shared(filename, true); + auto tp = std::make_shared(messages, tp_threads); + auto logger = std::make_shared("as", std::move(file_sink), std::move(tp)); - for (size_t j = 0; j < messages; j++) - { - logger->info("Hello message #{}", j); - } - } - - REQUIRE(count_lines(filename) == messages); - auto contents = file_contents(filename); - REQUIRE(ends_with (contents, std::string("Hello message #1023") + SPDLOG_EOL)); + for (size_t j = 0; j < messages; j++) + { + logger->info("Hello message #{}", j); + } + } + + REQUIRE(count_lines(filename) == messages); + auto contents = file_contents(filename); + REQUIRE(ends_with(contents, std::string("Hello message #1023") + SPDLOG_EOL)); } TEST_CASE("to_file multi-workers", "[async]") { - prepare_logdir(); - size_t messages = 1024*10; - size_t tp_threads = 10; - std::string filename = "logs/async_test.log"; - { - auto file_sink = std::make_shared(filename, true); - auto tp = std::make_shared(messages, tp_threads); - auto logger = std::make_shared("as", std::move(file_sink), std::move(tp)); + prepare_logdir(); + size_t messages = 1024 * 10; + size_t tp_threads = 10; + std::string filename = "logs/async_test.log"; + { + auto file_sink = std::make_shared(filename, true); + auto tp = std::make_shared(messages, tp_threads); + auto logger = std::make_shared("as", std::move(file_sink), std::move(tp)); - for (size_t j = 0; j < messages; j++) - { - logger->info("Hello message #{}", j); - } - } - - REQUIRE(count_lines(filename) == messages); + for (size_t j = 0; j < messages; j++) + { + logger->info("Hello message #{}", j); + } + } + + REQUIRE(count_lines(filename) == messages); }