Skip to content

Commit

Permalink
try to fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime committed Nov 29, 2024
1 parent 7fe73d9 commit fefda8d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/test_daily_and_rotation_loggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@

using filename_memory_buf_t = spdlog::memory_buf_t;

#ifdef SPDLOG_WCHAR_FILENAMES
std::string filename_buf_to_utf8string(const filename_memory_buf_t &w) {
spdlog::memory_buf_t buf;
spdlog::details::os::wstr_to_utf8buf(spdlog::wstring_view_t(w.data(), w.size()), buf);
return SPDLOG_BUF_TO_STRING(buf);
}
#else
// #ifdef SPDLOG_WCHAR_FILENAMES
// std::string filename_buf_to_utf8string(const filename_memory_buf_t &w) {
// spdlog::memory_buf_t buf;
// spdlog::details::os::wstr_to_utf8buf(spdlog::wstring_view_t(w.data(), w.size()), buf);
// return SPDLOG_BUF_TO_STRING(buf);
// }
// #else
// std::string filename_buf_to_utf8string(const filename_memory_buf_t &w) { return SPDLOG_BUF_TO_STRING(w); }
// #endif

std::string filename_buf_to_utf8string(const filename_memory_buf_t &w) { return SPDLOG_BUF_TO_STRING(w); }
#endif

TEST_CASE("daily_logger with dateonly calculator", "[daily_logger]") {
using sink_type = spdlog::sinks::daily_file_sink<std::mutex, spdlog::sinks::daily_filename_calculator>;
Expand Down

0 comments on commit fefda8d

Please sign in to comment.