diff --git a/src/samples/test-sample/test.cpp b/src/samples/test-sample/test.cpp index 924bf305..480263c9 100644 --- a/src/samples/test-sample/test.cpp +++ b/src/samples/test-sample/test.cpp @@ -127,10 +127,27 @@ bool test_env() bool test_io() { - const auto* filename = "a.txt"; + const std::filesystem::path filename = "a.txt"; + std::error_code ec{}; + const auto absolute_file = std::filesystem::absolute(filename, ec); + + if (ec) + { + puts("Getting absolute path failed"); + return false; + } + + const auto canonical_file = std::filesystem::canonical(filename, ec); + (void)canonical_file; + + if (ec) + { + puts("Getting canonical path failed"); + return false; + } FILE* fp{}; - (void)fopen_s(&fp, filename, "wb"); + (void)fopen_s(&fp, filename.string().c_str(), "wb"); if (!fp) {