aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/experimental/filesystem
diff options
context:
space:
mode:
authorKen Matsui <kmatsui@gcc.gnu.org>2024-01-10 22:08:07 -0800
committerKen Matsui <kmatsui@gcc.gnu.org>2024-01-11 03:36:14 -0800
commitdf147e2ee7199d33d66959c6509ce9c21072077f (patch)
treebd959a135eeb37aa09fdc478e0a28bd89c5fffcd /libstdc++-v3/testsuite/experimental/filesystem
parentea2a9c76a1dcffbbec6e53655bef9236d3a8e691 (diff)
downloadgcc-df147e2ee7199d33d66959c6509ce9c21072077f.zip
gcc-df147e2ee7199d33d66959c6509ce9c21072077f.tar.gz
gcc-df147e2ee7199d33d66959c6509ce9c21072077f.tar.bz2
libstdc++: Fix error handling in filesystem::equivalent [PR113250]
This patch made std::filesystem::equivalent correctly throw an exception when either path does not exist as per [fs.op.equivalent]/4. PR libstdc++/113250 libstdc++-v3/ChangeLog: * src/c++17/fs_ops.cc (fs::equivalent): Use || instead of &&. * src/filesystem/ops.cc (fs::equivalent): Likewise. * testsuite/27_io/filesystem/operations/equivalent.cc: Handle error codes. * testsuite/experimental/filesystem/operations/equivalent.cc: Likewise. Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org> Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Diffstat (limited to 'libstdc++-v3/testsuite/experimental/filesystem')
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/operations/equivalent.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/operations/equivalent.cc b/libstdc++-v3/testsuite/experimental/filesystem/operations/equivalent.cc
index 929a6ca..5bc477a 100644
--- a/libstdc++-v3/testsuite/experimental/filesystem/operations/equivalent.cc
+++ b/libstdc++-v3/testsuite/experimental/filesystem/operations/equivalent.cc
@@ -35,13 +35,13 @@ test01()
bool result;
result = equivalent(p1, p2, ec);
- VERIFY( ec );
+ VERIFY( ec == std::errc::no_such_file_or_directory );
VERIFY( !result );
const auto bad_ec = ec;
__gnu_test::scoped_file f1(p1);
result = equivalent(p1, p2, ec);
- VERIFY( !ec );
+ VERIFY( ec == std::errc::no_such_file_or_directory );
VERIFY( !result );
__gnu_test::scoped_file f2(p2);