aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc9
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc9
2 files changed, 14 insertions, 4 deletions
diff --git a/libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc b/libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
index 1c8ea4c..a26b29f 100644
--- a/libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
+++ b/libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
@@ -107,7 +107,7 @@ void
test02()
{
namespace fs = std::filesystem;
- auto dir = __gnu_test::nonexistent_path();
+ const auto dir = __gnu_test::nonexistent_path();
fs::create_directories(dir/"subdir");
std::error_code ec;
@@ -137,7 +137,12 @@ test02()
}
#endif
- fs::remove_all(dir, ec);
+ // Cannot use fs::remove_all here because that uses
+ // recursive_directory_iterator which would use the fake readdir above.
+#ifndef _GLIBCXX_FILESYSTEM_IS_WINDOWS
+ ::rmdir((dir/"subdir").c_str());
+ ::rmdir(dir.c_str());
+#endif
}
int
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc b/libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc
index 806c511..f005b7d 100644
--- a/libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc
+++ b/libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc
@@ -99,7 +99,7 @@ void
test02()
{
namespace fs = std::experimental::filesystem;
- auto dir = __gnu_test::nonexistent_path();
+ const auto dir = __gnu_test::nonexistent_path();
fs::create_directories(dir/"subdir");
std::error_code ec;
@@ -129,7 +129,12 @@ test02()
}
#endif
- fs::remove_all(dir, ec);
+ // Cannot use fs::remove_all here because that depends on
+ // recursive_directory_iterator which would use the fake readdir above.
+#ifndef _GLIBCXX_FILESYSTEM_IS_WINDOWS
+ ::rmdir((dir/"subdir").c_str());
+ ::rmdir(dir.c_str());
+#endif
}
int