mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Fix flush test in test_async.cpp
This commit is contained in:
parent
ec661f98dc
commit
a19c76a4e7
@ -98,7 +98,7 @@ TEST_CASE("multithread flush", "[async]") {
|
|||||||
size_t queue_size = 2;
|
size_t queue_size = 2;
|
||||||
size_t messages = 10;
|
size_t messages = 10;
|
||||||
size_t n_threads = 10;
|
size_t n_threads = 10;
|
||||||
size_t flush_count = 2048;
|
size_t flush_count = 1024;
|
||||||
std::mutex mtx;
|
std::mutex mtx;
|
||||||
std::vector<std::string> errmsgs;
|
std::vector<std::string> errmsgs;
|
||||||
{
|
{
|
||||||
@ -132,9 +132,11 @@ TEST_CASE("multithread flush", "[async]") {
|
|||||||
}
|
}
|
||||||
REQUIRE(test_sink->flush_counter() >= 1);
|
REQUIRE(test_sink->flush_counter() >= 1);
|
||||||
REQUIRE(test_sink->flush_counter() + errmsgs.size() == n_threads * flush_count);
|
REQUIRE(test_sink->flush_counter() + errmsgs.size() == n_threads * flush_count);
|
||||||
REQUIRE(errmsgs.size() >= 1);
|
|
||||||
|
if (errmsgs.size() > 0) {
|
||||||
REQUIRE(errmsgs[0] == "Broken promise");
|
REQUIRE(errmsgs[0] == "Broken promise");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE("async periodic flush", "[async]") {
|
TEST_CASE("async periodic flush", "[async]") {
|
||||||
auto logger = spdlog::create_async<spdlog::sinks::test_sink_mt>("as");
|
auto logger = spdlog::create_async<spdlog::sinks::test_sink_mt>("as");
|
||||||
|
Loading…
Reference in New Issue
Block a user