Added async test to tests

This commit is contained in:
gabime 2018-07-21 00:33:27 +03:00
parent 41d248f442
commit 989a10e48b

View File

@ -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<sinks::test_sink_mt>();
size_t queue_size = 2;
size_t messages = 1024;
{
//auto tp = std::make_shared<details::thread_pool>(queue_size, 1);
auto logger = spdlog::create_async_nb<sinks::test_sink_mt>("as2");
for (size_t i = 0; i < messages; i++)
{
logger->info("Hello message #{}", i);
}
auto sink = std::static_pointer_cast<sinks::test_sink_mt>(logger->sinks()[0]);
REQUIRE(sink->msg_counter() < messages);
}
}
TEST_CASE("flush", "[async]")
{
using namespace spdlog;