]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/experimental/filesystem/operations/canonical.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / experimental / filesystem / operations / canonical.cc
index 55572d61cef3f5a49b2b16c75d8ea03c60778855..505e3c4b1e41544d58d827289098d7c4bc393b7d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2019 Free Software Foundation, Inc.
+// Copyright (C) 2015-2023 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -30,31 +30,33 @@ test01()
 {
   std::error_code ec;
   auto p = __gnu_test::nonexistent_path();
-  canonical( p, ec );
+  (void) canonical( p, ec );
   VERIFY( ec );
 
   p = fs::current_path();
-  canonical( p, ec );
+  (void) canonical( p, ec );
   VERIFY( !ec );
 
+  const auto root = fs::absolute("/");
+
   p = "/";
   p = canonical( p, ec );
-  VERIFY( p == "/" );
+  VERIFY( p == root );
   VERIFY( !ec );
 
   p = "/.";
   p = canonical( p, ec );
-  VERIFY( p == "/" );
+  VERIFY( p == root );
   VERIFY( !ec );
 
   p = "/..";
   p = canonical( p, ec );
-  VERIFY( p == "/" );
+  VERIFY( p == root );
   VERIFY( !ec );
 
   p = "/../.././.";
   p = canonical( p, ec );
-  VERIFY( p == "/" );
+  VERIFY( p == root );
   VERIFY( !ec );
 }
 
@@ -65,7 +67,7 @@ test02()
   fs::path p = "rel", base = __gnu_test::nonexistent_path();
   fs::path e1, e2;
   try {
-    canonical(p, base);
+    (void) canonical(p, base);
   } catch (const fs::filesystem_error& e) {
     e1 = e.path1();
     e2 = e.path2();