mirror of
https://github.com/gabime/spdlog.git
synced 2026-01-02 09:57:55 +08:00
@@ -82,8 +82,13 @@ TEST_CASE("GMT offset ", "[pattern_formatter]") {
|
||||
const auto now = std::chrono::system_clock::now();
|
||||
const auto yesterday = now - 24h;
|
||||
|
||||
#ifndef SPDLOG_NO_TZ_OFFSET
|
||||
const std::string expected_result = "+00:00\n";
|
||||
#else
|
||||
const std::string expected_result = "+??:??\n";
|
||||
#endif
|
||||
REQUIRE(log_to_str_with_time(yesterday, "Some message", "%z", spdlog::pattern_time_type::utc,
|
||||
"\n") == "+00:00\n");
|
||||
"\n") == expected_result);
|
||||
}
|
||||
|
||||
TEST_CASE("color range test1", "[pattern_formatter]") {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "includes.h"
|
||||
#include "spdlog/sinks/stdout_sinks.h"
|
||||
#include "spdlog/sinks/stdout_color_sinks.h"
|
||||
|
||||
TEST_CASE("stdout_st", "[stdout]") {
|
||||
auto l = spdlog::stdout_logger_st("test");
|
||||
l->set_pattern("%+");
|
||||
@@ -72,8 +73,14 @@ TEST_CASE("stderr_color_mt", "[stderr]") {
|
||||
spdlog::drop_all();
|
||||
}
|
||||
|
||||
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
||||
TEST_CASE("show_utc_offset", "[stdout]") {
|
||||
auto l = spdlog::stdout_color_mt("test");
|
||||
l->set_pattern("[%c %z] [%n] [%^%l%$] %v");
|
||||
l->info("Full date");
|
||||
spdlog::drop_all();
|
||||
}
|
||||
|
||||
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
||||
TEST_CASE("wchar_api", "[stdout]") {
|
||||
auto l = spdlog::stdout_logger_st("wchar_logger");
|
||||
l->set_pattern("%+");
|
||||
@@ -86,5 +93,4 @@ TEST_CASE("wchar_api", "[stdout]") {
|
||||
SPDLOG_LOGGER_DEBUG(l, L"Test SPDLOG_LOGGER_DEBUG {}", L"param");
|
||||
spdlog::drop_all();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user