diff --git a/tests/test_file_helper.cpp b/tests/test_file_helper.cpp index 3b61ff2c..53c7e83a 100644 --- a/tests/test_file_helper.cpp +++ b/tests/test_file_helper.cpp @@ -136,7 +136,7 @@ TEST_CASE("file_event_handlers", "[file_helper]") { events.clear(); helper.close(); REQUIRE(events == std::vector{flags::before_close, flags::after_close}); - REQUIRE(file_contents(TEST_FILENAME) == "after_open\nbefore_close\n"); + REQUIRE(file_contents(SPDLOG_FILENAME_T(TEST_FILENAME)) == "after_open\nbefore_close\n"); helper.reopen(true); events.clear(); diff --git a/tests/utils.cpp b/tests/utils.cpp index 5a4a4d19..c566152d 100644 --- a/tests/utils.cpp +++ b/tests/utils.cpp @@ -18,7 +18,7 @@ void prepare_logdir() { #endif } -std::string file_contents(const std::string &filename) { +std::string file_contents(const std::filesystem::path &filename) { std::ifstream ifs(filename, std::ios_base::binary); if (!ifs) { throw std::runtime_error("Failed open file "); @@ -26,7 +26,7 @@ std::string file_contents(const std::string &filename) { return std::string((std::istreambuf_iterator(ifs)), (std::istreambuf_iterator())); } -std::size_t count_lines(const spdlog::filename_t &filename) { +std::size_t count_lines(const std::filesystem::path &filename) { std::ifstream ifs(filename); if (!ifs) { throw std::runtime_error("Failed open file "); diff --git a/tests/utils.h b/tests/utils.h index af66a937..949f8f55 100644 --- a/tests/utils.h +++ b/tests/utils.h @@ -8,7 +8,7 @@ std::size_t count_files(const std::string &folder); void prepare_logdir(); -std::string file_contents(const std::string &filename); +std::string file_contents(const std::filesystem::path &filename); // std::size_t count_lines(const std::string &filename); std::size_t count_lines(const std::filesystem::path &filename); @@ -17,4 +17,4 @@ void require_message_count(const std::filesystem::path &filename, const std::siz std::size_t get_filesize(const std::string &filename); -bool ends_with(std::string const &value, std::string const &ending); \ No newline at end of file +bool ends_with(std::string const &value, std::string const &ending);