diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/copy.pass.cpp @@ -29,8 +29,8 @@ const path p(s); path p2; path& pref = (p2 = p); - assert(p.native() == s); - assert(p2.native() == s); + assert(p.string() == s); + assert(p2.string() == s); assert(&pref == &p2); return 0; diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/move.pass.cpp @@ -29,13 +29,14 @@ const std::string s("we really really really really really really really " "really really long string so that we allocate"); assert(globalMemCounter.checkOutstandingNewEq(1)); + const fs::path::string_type ps(s.begin(), s.end()); path p(s); { DisableAllocationGuard g; path p2; path& pref = (p2 = std::move(p)); - assert(p2.native() == s); - assert(p.native() != s); // Testing moved from state + assert(p2.native() == ps); + assert(p.native() != ps); // Testing moved from state assert(&pref == &p2); } diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp @@ -28,8 +28,8 @@ const std::string s("foo"); const path p(s); path p2(p); - assert(p.native() == s); - assert(p2.native() == s); + assert(p.string() == s); + assert(p2.string() == s); return 0; } diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/move.pass.cpp @@ -29,12 +29,13 @@ const std::string s("we really really really really really really really " "really really long string so that we allocate"); assert(globalMemCounter.checkOutstandingNewEq(1)); + const fs::path::string_type ps(s.begin(), s.end()); path p(s); { DisableAllocationGuard g; path p2(std::move(p)); - assert(p2.native() == s); - assert(p.native() != s); // Testing moved from state + assert(p2.native() == ps); + assert(p.native() != ps); // Testing moved from state } return 0; diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/source.pass.cpp @@ -31,7 +31,7 @@ template void RunTestCaseImpl(MultiStringType const& MS, Args... args) { 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; diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/c_str.pass.cpp @@ -28,6 +28,7 @@ using namespace fs; const char* const value = "hello world"; const std::string str_value = value; + const fs::path::string_type pathstr_value(str_value.begin(), str_value.end()); { // Check signature path p(value); ASSERT_SAME_TYPE(path::value_type const*, decltype(p.c_str())); @@ -35,7 +36,7 @@ } { path p(value); - assert(p.c_str() == str_value); + assert(p.c_str() == pathstr_value); assert(p.native().c_str() == p.c_str()); } diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/native.pass.cpp @@ -26,6 +26,8 @@ { using namespace fs; const char* const value = "hello world"; + std::string value_str(value); + fs::path::string_type pathstr_value(value_str.begin(), value_str.end()); { // Check signature path p(value); ASSERT_SAME_TYPE(path::string_type const&, decltype(p.native())); @@ -33,7 +35,7 @@ } { // native() is tested elsewhere path p(value); - assert(p.native() == value); + assert(p.native() == pathstr_value); } return 0; diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.native.obs/operator_string.pass.cpp @@ -28,6 +28,8 @@ using namespace fs; using string_type = path::string_type; const char* const value = "hello world"; + std::string value_str(value); + fs::path::string_type pathstr_value(value_str.begin(), value_str.end()); { // Check signature path p(value); static_assert(std::is_convertible::value, ""); @@ -37,10 +39,10 @@ } { path p(value); - assert(p.native() == value); + assert(p.native() == pathstr_value); string_type s = p; - assert(s == value); - assert(p == value); + assert(s == pathstr_value); + assert(p == pathstr_value); } return 0; diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.io.pass.cpp @@ -53,7 +53,7 @@ { // test input path p_in; auto& ret = ss >> p_in; - assert(p_in.native() == (const char*)InStr); + assert(p_in.native() == (const path::value_type*)InStr); assert(&ret == &ss); } } diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/swap.pass.cpp @@ -29,6 +29,8 @@ const char* value2 = "_THIS_IS_LONG_THIS_IS_LONG_THIS_IS_LONG_THIS_IS_LONG_THIS_IS_LONG_THIS_IS_LONG_THIS_IS_LONG"; path p1(value1); path p2(value2); + fs::path::string_type ps1 = p1.native(); + fs::path::string_type ps2 = p2.native(); { using namespace std; using namespace fs; ASSERT_NOEXCEPT(swap(p1, p2)); @@ -39,11 +41,11 @@ using namespace std; using namespace fs; swap(p1, p2); - assert(p1.native() == value2); - assert(p2.native() == value1); + assert(p1.native() == ps2); + assert(p2.native() == ps1); swap(p1, p2); - assert(p1.native() == value1); - assert(p2.native() == value2); + assert(p1.native() == ps1); + assert(p2.native() == ps2); } return 0; diff --git a/libcxx/test/std/input.output/filesystems/class.path/synop.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/synop.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/synop.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/synop.pass.cpp @@ -25,13 +25,21 @@ int main(int, char**) { using namespace fs; +#ifdef _WIN32 + ASSERT_SAME_TYPE(path::value_type, wchar_t); +#else ASSERT_SAME_TYPE(path::value_type, char); +#endif ASSERT_SAME_TYPE(path::string_type, std::basic_string); { ASSERT_SAME_TYPE(const path::value_type, decltype(path::preferred_separator)); +#ifdef _WIN32 + static_assert(path::preferred_separator == '\\', ""); +#else static_assert(path::preferred_separator == '/', ""); +#endif // Make preferred_separator ODR used by taking its address. - const char* dummy = &path::preferred_separator; + const path::value_type* dummy = &path::preferred_separator; ((void)dummy); }