]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix filesystem::path tests
authorJonathan Wakely <jwakely@redhat.com>
Tue, 30 Apr 2019 10:39:59 +0000 (11:39 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 30 Apr 2019 10:39:59 +0000 (11:39 +0100)
The root_path.cc test had some debugging macros left in accidentally, so
didn't FAIL correctly if an assertion failed.

The string-char8_t.cc tests didn't compile on Windows.

* testsuite/27_io/filesystem/path/decompose/root_path.cc: Remove
macros accidentally left in.
* testsuite/27_io/filesystem/path/native/string-char8_t.cc: Remove
unnecessary -lstdc++fs option. Fix test for mingw.
* testsuite/experimental/filesystem/path/native/string-char8_t.cc:
Fix test for mingw.

From-SVN: r270685

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc
libstdc++-v3/testsuite/27_io/filesystem/path/native/string-char8_t.cc
libstdc++-v3/testsuite/experimental/filesystem/path/native/string-char8_t.cc

index 6798f4d3846aeef941bf5b613536fc95850aea3a..9ea672ff691b7533c796d5f16c493f2d1caac8b6 100644 (file)
@@ -1,3 +1,12 @@
+2019-04-30  Jonathan Wakely  <jwakely@redhat.com>
+
+       * testsuite/27_io/filesystem/path/decompose/root_path.cc: Remove
+       macros accidentally left in.
+       * testsuite/27_io/filesystem/path/native/string-char8_t.cc: Remove
+       unnecessary -lstdc++fs option. Fix test for mingw.
+       * testsuite/experimental/filesystem/path/native/string-char8_t.cc:
+       Fix test for mingw.
+
 2019-04-30  Jakub Jelinek  <jakub@redhat.com>
 
        * config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: Update.
index 4f4c531819feaceb73aeb2cfe4650f597afc8445..d573b4899c0f7a779e2e6e235072083b570c1887 100644 (file)
@@ -35,10 +35,6 @@ test01()
   VERIFY( p2.root_path() == path("/") );
 }
 
-#undef VERIFY
-#define VERIFY(X) do { if (!(X)) { __builtin_puts("FAIL: " #X); } } while(false)
-#define DUMP(X, Y, Z) do { if (!(Y == Z)) { __builtin_printf("%s %s %s\n", X.c_str(), Y.c_str(), Z.c_str()); } } while(false)
-
 void
 test02()
 {
@@ -48,7 +44,6 @@ test02()
     path rootn = p.root_name();
     path rootd = p.root_directory();
     VERIFY( rootp == (rootn / rootd) );
-    DUMP(p,  rootp , (rootn / rootd) );
   }
 }
 
index f5bb1afca5d9a17dd2feb18e84df3750a5f04798..d333787a71e11e43a5e7807138eba4a9ab5e6495 100644 (file)
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-options "-std=gnu++17 -lstdc++fs -fchar8_t" }
+// { dg-options "-std=gnu++17 -fchar8_t" }
 // { dg-do run { target c++17 } }
 // { dg-require-filesystem-ts "" }
 
@@ -27,14 +27,15 @@ void
 test01()
 {
   using namespace std::filesystem;
-  const std::string s = "abc";
+  using string_type = std::basic_string<path::value_type>;
+  const string_type s{ 'a', 'b', 'c' };
   path p(s);
 
   VERIFY( p.native() == s );
   VERIFY( p.c_str() == s );
-  VERIFY( static_cast<std::string>(p) == s );
+  VERIFY( static_cast<string_type>(p) == s );
 
-  std::string s2 = p; // implicit conversion
+  string_type s2 = p; // implicit conversion
   VERIFY( s2 == p.native() );
 }
 
index a0d8058bdfc8d472d6d2407eb372cdcb5afb4548..091663f4e823556ca0e107dc1133e824a8a9e12e 100644 (file)
@@ -27,14 +27,15 @@ void
 test01()
 {
   using namespace std::experimental::filesystem;
-  const std::string s = "abc";
+  using string_type = std::basic_string<path::value_type>;
+  const string_type s{ 'a', 'b', 'c' };
   path p(s);
 
   VERIFY( p.native() == s );
   VERIFY( p.c_str() == s );
-  VERIFY( static_cast<std::string>(p) == s );
+  VERIFY( static_cast<string_type>(p) == s );
 
-  std::string s2 = p; // implicit conversion
+  string_type s2 = p; // implicit conversion
   VERIFY( s2 == p.native() );
 }