[libcxx-commits] [libcxx] fdbfff8 - [libcxx] [test] Use string() instead of native() as parameter to std::ifstream/ofstream in copy_file_large.pass.cpp

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 16 07:37:43 PDT 2020


Author: Martin Storsjö
Date: 2020-10-16T17:36:56+03:00
New Revision: fdbfff8fd41f874f05a4c0a3f8f20964942d7833

URL: https://github.com/llvm/llvm-project/commit/fdbfff8fd41f874f05a4c0a3f8f20964942d7833
DIFF: https://github.com/llvm/llvm-project/commit/fdbfff8fd41f874f05a4c0a3f8f20964942d7833.diff

LOG: [libcxx] [test] Use string() instead of native() as parameter to std::ifstream/ofstream in copy_file_large.pass.cpp

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp
index 1f435840a24a..1678b0e9b9ef 100644
--- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file_large.pass.cpp
@@ -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);


        


More information about the libcxx-commits mailing list