summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io/filesystem/path
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-04-30 11:39:59 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2019-04-30 11:39:59 +0100
commit95767c6597e32256b3850c9bed4fd8ce1f0da089 (patch)
tree0bd4a9c2babb4798a8d651ac383663e51622d0f7 /libstdc++-v3/testsuite/27_io/filesystem/path
parent0d67a51060e7d67b685ace6ba5395d9a98e2f5be (diff)
Fix filesystem::path tests
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
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/filesystem/path')
-rw-r--r--libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc5
-rw-r--r--libstdc++-v3/testsuite/27_io/filesystem/path/native/string-char8_t.cc9
2 files changed, 5 insertions, 9 deletions
diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc
index 4f4c531819f..d573b4899c0 100644
--- a/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc
+++ b/libstdc++-v3/testsuite/27_io/filesystem/path/decompose/root_path.cc
@@ -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) );
}
}
diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/native/string-char8_t.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/native/string-char8_t.cc
index f5bb1afca5d..d333787a71e 100644
--- a/libstdc++-v3/testsuite/27_io/filesystem/path/native/string-char8_t.cc
+++ b/libstdc++-v3/testsuite/27_io/filesystem/path/native/string-char8_t.cc
@@ -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() );
}