Index: libcxx/test/std/input.output/filesystems/class.path/path.itr/iterator.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.path/path.itr/iterator.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.path/path.itr/iterator.pass.cpp @@ -49,7 +49,11 @@ ASSERT_SAME_TYPE(It, decltype(it--)); ASSERT_SAME_TYPE(Traits::reference, decltype(*it)); ASSERT_SAME_TYPE(Traits::pointer, decltype(it.operator->())); +#ifdef _WIN32 + ASSERT_SAME_TYPE(std::wstring const&, decltype(it->native())); +#else ASSERT_SAME_TYPE(std::string const&, decltype(it->native())); +#endif ASSERT_SAME_TYPE(bool, decltype(it == it)); ASSERT_SAME_TYPE(bool, decltype(it != it)); } Index: libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp @@ -26,7 +26,11 @@ using namespace fs; path p("abc"); p = {}; +#ifdef _WIN32 + assert(p.native() == L""); +#else assert(p.native() == ""); +#endif return 0; } Index: libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/source.pass.cpp @@ -35,7 +35,7 @@ template void RunTestCase(MultiStringType const& MS) { using namespace fs; - const char* Expect = MS; + const fs::path::value_type* Expect = MS; const CharT* TestPath = MS; const CharT* TestPathEnd = StrEnd(TestPath); const std::size_t Size = TestPathEnd - TestPath; @@ -211,9 +211,9 @@ } } -void RunStringMoveTest(const char* Expect) { +void RunStringMoveTest(const fs::path::value_type* Expect) { using namespace fs; - std::string ss(Expect); + fs::path::string_type ss(Expect); path p; { DisableAllocationGuard g; ((void)g); Index: libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/path.decompose.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/path.decompose.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/path.decompose.pass.cpp @@ -55,8 +55,8 @@ #include "verbose_assert.h" struct ComparePathExact { - bool operator()(std::string const& LHS, std::string const& RHS) const { - return LHS == RHS; + bool operator()(fs::path const& LHS, std::string const& RHS) const { + return LHS.string() == RHS; } }; Index: libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp @@ -131,7 +131,7 @@ " Input: '%s'\n" " Expected: '%s'\n" " Output: '%s'\n", - ID, TC.input.c_str(), TC.expect.c_str(), output.native().c_str()); + ID, TC.input.c_str(), TC.expect.c_str(), output.string().c_str()); } } return Failed; Index: libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp @@ -69,7 +69,7 @@ " Expected: '%s'\n" " Output: '%s'\n", ID, Testing, TC.input.c_str(), TC.base.c_str(), - Expected.c_str(), Output.native().c_str()); + Expected.string().c_str(), Output.string().c_str()); }; if (!PathEq(output, TC.expect)) ReportErr("path::lexically_relative", output, TC.expect); Index: libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp +++ libcxx/test/std/input.output/filesystems/class.rec.dir.itr/rec.dir.itr.members/increment.pass.cpp @@ -314,7 +314,7 @@ ExceptionChecker Checker(std::errc::permission_denied, "recursive_directory_iterator::operator++()", format_string("attempting recursion into \"%s\"", - nestedDir.native())); + nestedDir.string().c_str())); TEST_CHECK_THROW_RESULT(filesystem_error, Checker, ++it); } } Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp @@ -38,7 +38,7 @@ const fs::path cwd = fs::current_path(); const struct { std::string input; - std::string expect; + fs::path expect; } TestCases [] = { {"", cwd / ""}, {"foo", cwd / "foo"}, Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp @@ -106,7 +106,7 @@ Times GetTimes(path const& p) { StatT st; - if (::stat(p.c_str(), &st) == -1) { + if (::stat(p.string().c_str(), &st) == -1) { std::error_code ec(errno, std::generic_category()); #ifndef TEST_HAS_NO_EXCEPTIONS throw ec; @@ -123,7 +123,7 @@ Times GetSymlinkTimes(path const& p) { StatT st; - if (::lstat(p.c_str(), &st) == -1) { + if (::lstat(p.string().c_str(), &st) == -1) { std::error_code ec(errno, std::generic_category()); #ifndef TEST_HAS_NO_EXCEPTIONS throw ec; @@ -395,7 +395,7 @@ SleepFor(Sec(2)); // update file and add a file to the directory. Make sure the times increase. - std::FILE* of = std::fopen(file.c_str(), "a"); + std::FILE* of = std::fopen(file.string().c_str(), "a"); std::fwrite("hello", 1, sizeof("hello"), of); std::fclose(of); env.create_file("dir/file1", 1); Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp @@ -60,9 +60,9 @@ path relative_cwd = cwd.native().substr(1); // clang-format off struct { - std::string input; - std::string base; - std::string expect; + fs::path input; + fs::path base; + fs::path expect; } TestCases[] = { {"", "", "."}, {cwd, "a", ".."}, @@ -104,7 +104,8 @@ " Input: '%s'\n" " Base: '%s'\n" " Expected: '%s'\n", - ID, TC.input.c_str(), TC.base.c_str(), TC.expect.c_str()); + ID, TC.input.string().c_str(), TC.base.string().c_str(), + TC.expect.string().c_str()); } else if (!PathEq(output, TC.expect)) { TEST_CHECK(PathEq(output, TC.expect)); @@ -119,9 +120,10 @@ " Lex Prox: '%s'\n" " Canon Input: '%s'\n" " Canon Base: '%s'\n", - ID, TC.input.c_str(), TC.base.c_str(), TC.expect.c_str(), - output.native().c_str(), lexically_p.native().c_str(), - canon_input.c_str(), canon_base.c_str()); + ID, TC.input.string().c_str(), TC.base.string().c_str(), + TC.expect.string().c_str(), output.string().c_str(), + lexically_p.string().c_str(), canon_input.string().c_str(), + canon_base.string().c_str()); } } } Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp @@ -86,7 +86,7 @@ // should have the same expected result. Compute this expected result // one and check that it looks semi-sane. struct statvfs expect; - TEST_REQUIRE(::statvfs(static_env.Dir.c_str(), &expect) != -1); + TEST_REQUIRE(::statvfs(static_env.Dir.string().c_str(), &expect) != -1); TEST_CHECK(expect.f_bavail > 0); TEST_CHECK(expect.f_bfree > 0); TEST_CHECK(expect.f_bsize > 0); Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp @@ -25,8 +25,8 @@ using namespace fs; -void PutEnv(std::string var, std::string value) { - assert(::setenv(var.c_str(), value.c_str(), /* overwrite */ 1) == 0); +void PutEnv(std::string var, fs::path value) { + assert(::setenv(var.c_str(), value.string().c_str(), /* overwrite */ 1) == 0); } void UnsetEnv(std::string var) { Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.weakly_canonical/weakly_canonical.pass.cpp @@ -29,8 +29,8 @@ // clang-format off struct { - std::string input; - std::string expect; + fs::path input; + fs::path expect; } TestCases[] = { {"", fs::current_path()}, {".", fs::current_path()}, @@ -69,7 +69,8 @@ " Input: '%s'\n" " Expected: '%s'\n" " Output: '%s'\n", - ID, TC.input.c_str(), TC.expect.c_str(), output.native().c_str()); + ID, TC.input.string().c_str(), TC.expect.string().c_str(), + output.string().c_str()); } } return Failed;