mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Update test_errors.cpp
This commit is contained in:
parent
763ff37348
commit
febc1e233d
@ -21,7 +21,9 @@ protected:
|
|||||||
throw std::runtime_error("some error happened during flush");
|
throw std::runtime_error("some error happened during flush");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
struct custom_ex {};
|
||||||
|
|
||||||
|
if !defined(SPDLOG_USE_STD_FORMAT) // std formt doesn't fully support tuntime strings
|
||||||
TEST_CASE("default_error_handler", "[errors]")
|
TEST_CASE("default_error_handler", "[errors]")
|
||||||
{
|
{
|
||||||
prepare_logdir();
|
prepare_logdir();
|
||||||
@ -32,16 +34,12 @@ TEST_CASE("default_error_handler", "[errors]")
|
|||||||
logger->info(SPDLOG_FMT_RUNTIME("Test message {} {}"), 1);
|
logger->info(SPDLOG_FMT_RUNTIME("Test message {} {}"), 1);
|
||||||
logger->info("Test message {}", 2);
|
logger->info("Test message {}", 2);
|
||||||
logger->flush();
|
logger->flush();
|
||||||
|
|
||||||
using spdlog::details::os::default_eol;
|
using spdlog::details::os::default_eol;
|
||||||
REQUIRE(file_contents(SIMPLE_LOG) == spdlog::fmt_lib::format("Test message 2{}", default_eol));
|
REQUIRE(file_contents(SIMPLE_LOG) == spdlog::fmt_lib::format("Test message 2{}", default_eol));
|
||||||
REQUIRE(count_lines(SIMPLE_LOG) == 1);
|
REQUIRE(count_lines(SIMPLE_LOG) == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct custom_ex
|
|
||||||
{};
|
|
||||||
|
|
||||||
#if !defined(SPDLOG_USE_STD_FORMAT) // std formt doesn't fully support tuntime strings
|
|
||||||
TEST_CASE("custom_error_handler", "[errors]")
|
TEST_CASE("custom_error_handler", "[errors]")
|
||||||
{
|
{
|
||||||
prepare_logdir();
|
prepare_logdir();
|
||||||
|
Loading…
Reference in New Issue
Block a user