[libcxx] [test] Use string() instead of native() as parameter to std::ifstream/ofstre...
authorMartin Storsjö <martin@martin.st>
Fri, 16 Oct 2020 10:12:57 +0000 (13:12 +0300)
committerMartin Storsjö <martin@martin.st>
Fri, 16 Oct 2020 14:36:56 +0000 (17:36 +0300)
This fixes building with libstdc++ for windows. MS STL has got
ifstream/ofstream overloads that taken wide strings though.

Differential Revision: https://reviews.llvm.org/D89539

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp

index 1f43584..1678b0e 100644 (file)
@@ -54,7 +54,7 @@ TEST_CASE(large_file) {
   const std::string additional_data(additional_size, 'x');
   // Append known data to the end of the source file.
   {
-    std::ofstream outf(file.native(), std::ios_base::app);
+    std::ofstream outf(file.string(), std::ios_base::app);
     TEST_REQUIRE(outf.good());
     outf << additional_data;
     TEST_REQUIRE(outf);
@@ -74,7 +74,7 @@ TEST_CASE(large_file) {
   std::string out_data;
   out_data.reserve(additional_size);
   {
-    std::ifstream dest_file(dest.native());
+    std::ifstream dest_file(dest.string());
     TEST_REQUIRE(dest_file);
     dest_file.seekg(sendfile_size_limit);
     TEST_REQUIRE(dest_file);