Update test_errors.cpp

This commit is contained in:
Gabi Melman 2023-03-05 21:34:02 +02:00 committed by GitHub
parent 763ff37348
commit febc1e233d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();