aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/experimental/filesystem
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-03-05 17:21:24 +0000
committerJonathan Wakely <jwakely@redhat.com>2020-03-05 17:23:44 +0000
commit9412b35affa46a18f7e657fb449b449ac9a4a599 (patch)
treeeec7292e17469155635d3b3152635b1085020405 /libstdc++-v3/testsuite/experimental/filesystem
parenta5090de45af6c9c0f93306de4b6a4d3b56fccd94 (diff)
downloadgcc-9412b35affa46a18f7e657fb449b449ac9a4a599.zip
gcc-9412b35affa46a18f7e657fb449b449ac9a4a599.tar.gz
gcc-9412b35affa46a18f7e657fb449b449ac9a4a599.tar.bz2
libstdc++: Fix some warnings in filesystem tests
There's a -Wunused-but-set-variable warning in operations/all.cc which can be fixed with [[maybe_unused]]. The statements in operations/copy.cc give -Wunused-value warnings. I think I meant to use |= rather than !=. And operations/file_size.cc gets -Wsign-compare warnings. * testsuite/27_io/filesystem/operations/all.cc: Mark unused variable. * testsuite/27_io/filesystem/operations/copy.cc: Fix typo. * testsuite/experimental/filesystem/operations/copy.cc: Likewise. * testsuite/27_io/filesystem/operations/file_size.cc: Use correct type for return value, and in comparison. * testsuite/experimental/filesystem/operations/file_size.cc: Likewise.
Diffstat (limited to 'libstdc++-v3/testsuite/experimental/filesystem')
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/operations/copy.cc2
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/operations/file_size.cc12
2 files changed, 7 insertions, 7 deletions
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/operations/copy.cc b/libstdc++-v3/testsuite/experimental/filesystem/operations/copy.cc
index e1bda0f..e1e6d1d 100644
--- a/libstdc++-v3/testsuite/experimental/filesystem/operations/copy.cc
+++ b/libstdc++-v3/testsuite/experimental/filesystem/operations/copy.cc
@@ -57,7 +57,7 @@ test01()
VERIFY( !exists(to) );
ec.clear();
- opts != fs::copy_options::recursive;
+ opts |= fs::copy_options::recursive;
fs::copy("/", to, opts, ec);
VERIFY( ec == std::make_error_code(std::errc::is_a_directory) );
VERIFY( !exists(to) );
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/operations/file_size.cc b/libstdc++-v3/testsuite/experimental/filesystem/operations/file_size.cc
index f609da7..ea4df63 100644
--- a/libstdc++-v3/testsuite/experimental/filesystem/operations/file_size.cc
+++ b/libstdc++-v3/testsuite/experimental/filesystem/operations/file_size.cc
@@ -29,9 +29,9 @@ void
test01()
{
std::error_code ec;
- size_t size = fs::file_size(".", ec);
+ auto size = fs::file_size(".", ec);
VERIFY( ec == std::errc::is_a_directory );
- VERIFY( size == -1 );
+ VERIFY( size == (std::uintmax_t)-1 );
try {
size = fs::file_size(".");
@@ -40,7 +40,7 @@ test01()
ec = e.code();
}
VERIFY( ec == std::errc::is_a_directory );
- VERIFY( size == -1 );
+ VERIFY( size == (std::uintmax_t)-1 );
}
void
@@ -49,9 +49,9 @@ test02()
fs::path p = __gnu_test::nonexistent_path();
std::error_code ec;
- size_t size = fs::file_size(p, ec);
+ auto size = fs::file_size(p, ec);
VERIFY( ec );
- VERIFY( size == -1 );
+ VERIFY( size == (std::uintmax_t)-1 );
try {
size = fs::file_size(p);
@@ -60,7 +60,7 @@ test02()
ec = e.code();
}
VERIFY( ec );
- VERIFY( size == -1 );
+ VERIFY( size == (std::uintmax_t)-1 );
}
int