Fixed windows test

pull/3309/head
gabime 8 months ago
parent dc7b8ee205
commit 7ada31d66a

@ -136,7 +136,7 @@ TEST_CASE("file_event_handlers", "[file_helper]") {
events.clear();
helper.close();
REQUIRE(events == std::vector<flags>{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();

@ -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<char>(ifs)), (std::istreambuf_iterator<char>()));
}
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 ");

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

Loading…
Cancel
Save