diff mbox

[v3] Fix FAIL in experimental/filesystem/operations/current_path.cc

Message ID 20150730124048.GN13355@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely July 30, 2015, 12:40 p.m. UTC
This test is failing on Darwin, it turns out to be because TMPDIR is
set to a symlink, so after changing to that directory current_path()
returns a different path. We should canonicalize the paths before
comparing them.

Tested x86_64-linux, committed to trunk.
diff mbox

Patch

commit 4948553fcf04e6d3255d6c440bfc82aac71cfbe3
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jul 30 13:32:15 2015 +0100

    	* testsuite/experimental/filesystem/operations/current_path.cc: Use
    	canonical paths for comparisons.

diff --git a/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc
index 325a5a8..c242ac0 100644
--- a/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc
+++ b/libstdc++-v3/testsuite/experimental/filesystem/operations/current_path.cc
@@ -42,11 +42,11 @@  test02()
   auto oldwd = fs::current_path();
   auto tmpdir = fs::temp_directory_path();
   current_path(tmpdir);
-  VERIFY( fs::current_path() == tmpdir );
+  VERIFY( canonical(fs::current_path()) == canonical(tmpdir) );
   std::error_code ec;
   current_path(oldwd, ec);
-  VERIFY( fs::current_path() == oldwd );
-  VERIFY( fs::current_path(ec) == oldwd );
+  VERIFY( canonical(fs::current_path()) == canonical(oldwd) );
+  VERIFY( canonical(fs::current_path(ec)) == canonical(oldwd) );
 }
 
 int