From 989a10e48b5de7c737933dec1c8a1e578be56806 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 21 Jul 2018 00:33:27 +0300 Subject: [PATCH] Added async test to tests --- tests/test_async.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_async.cpp b/tests/test_async.cpp index 5ef66374..c422f39a 100644 --- a/tests/test_async.cpp +++ b/tests/test_async.cpp @@ -40,6 +40,26 @@ TEST_CASE("discard policy ", "[async]") REQUIRE(test_sink->msg_counter() < messages); } +TEST_CASE("discard policy using factory ", "[async]") +{ + using namespace spdlog; + //auto test_sink = std::make_shared(); + size_t queue_size = 2; + size_t messages = 1024; + { + //auto tp = std::make_shared(queue_size, 1); + auto logger = spdlog::create_async_nb("as2"); + for (size_t i = 0; i < messages; i++) + { + logger->info("Hello message #{}", i); + } + auto sink = std::static_pointer_cast(logger->sinks()[0]); + REQUIRE(sink->msg_counter() < messages); + } + + +} + TEST_CASE("flush", "[async]") { using namespace spdlog;