[libcxx-commits] [libcxx] aee005f - [libcxx] [test] Fix windows errors in fs.op.rename

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 19 07:12:54 PDT 2021


Author: Martin Storsjö
Date: 2021-03-19T16:12:24+02:00
New Revision: aee005f9128adeda48c5f16d2cd04cde49b79105

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

LOG: [libcxx] [test] Fix windows errors in fs.op.rename

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp
index c1491581b11c..b6930d8d5fa9 100644
--- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp
@@ -62,7 +62,13 @@ TEST_CASE(test_error_reporting)
     } cases[] = {
         {dne, dne},
         {file, dir},
-        {dir, file}
+#ifndef _WIN32
+        // The spec doesn't say that this case must be an error; fs.op.rename
+        // note 1.2.1 says that a file may be overwritten by a rename.
+        // On Windows, with rename() implemented with MoveFileExW, overwriting
+        // a file with a directory is not an error.
+        {dir, file},
+#endif
     };
     for (auto& TC : cases) {
         auto from_before = status(TC.from);


        


More information about the libcxx-commits mailing list