diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2017-11-15 18:22:43 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2017-11-15 18:22:43 +0000 |
commit | 4e6c42983787bcec345526ab04a4e541e0b0afb2 (patch) | |
tree | 955f0e4fccb055cb658257b3d5fee13b3bc11817 /libstdc++-v3 | |
parent | 54b6c06b49ec3cdfafb087bdafa512b66b916c8c (diff) | |
download | gcc-4e6c42983787bcec345526ab04a4e541e0b0afb2.zip gcc-4e6c42983787bcec345526ab04a4e541e0b0afb2.tar.gz gcc-4e6c42983787bcec345526ab04a4e541e0b0afb2.tar.bz2 |
Minor improvements to Filesystem tests
* testsuite/27_io/filesystem/iterators/directory_iterator.cc: Leave
error_code unset.
* testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
Check for past-the-end before dereferencing.
* testsuite/experimental/filesystem/iterators/
recursive_directory_iterator.cc: Likewise.
From-SVN: r254781
Diffstat (limited to 'libstdc++-v3')
4 files changed, 11 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5f0bcca..7011317 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,12 @@ 2017-11-15 Jonathan Wakely <jwakely@redhat.com> + * testsuite/27_io/filesystem/iterators/directory_iterator.cc: Leave + error_code unset. + * testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc: + Check for past-the-end before dereferencing. + * testsuite/experimental/filesystem/iterators/ + recursive_directory_iterator.cc: Likewise. + * include/bits/range_access.h (size, empty, data): Add conditional noexcept to generic overloads. diff --git a/libstdc++-v3/testsuite/27_io/filesystem/iterators/directory_iterator.cc b/libstdc++-v3/testsuite/27_io/filesystem/iterators/directory_iterator.cc index c3e6f01..9cdbd7a 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/iterators/directory_iterator.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/iterators/directory_iterator.cc @@ -61,7 +61,6 @@ test01() ec = bad_ec; permissions(p, fs::perms::none, ec); VERIFY( !ec ); - ec = bad_ec; iter = fs::directory_iterator(p, ec); VERIFY( ec ); VERIFY( iter == end(iter) ); diff --git a/libstdc++-v3/testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc b/libstdc++-v3/testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc index 1ef450f..d41a150 100644 --- a/libstdc++-v3/testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc +++ b/libstdc++-v3/testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc @@ -87,6 +87,7 @@ test01() VERIFY( iter != end(iter) ); VERIFY( iter->path() == p/"d1" ); ++iter; // should recurse into d1 + VERIFY( iter != end(iter) ); VERIFY( iter->path() == p/"d1/d2" ); iter.increment(ec); // should fail to recurse into p/d1/d2 VERIFY( ec ); @@ -99,6 +100,7 @@ test01() VERIFY( iter != end(iter) ); VERIFY( iter->path() == p/"d1" ); ++iter; // should recurse into d1 + VERIFY( iter != end(iter) ); VERIFY( iter->path() == p/"d1/d2" ); ec = bad_ec; iter.increment(ec); // should fail to recurse into p/d1/d2, so skip it diff --git a/libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc b/libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc index 50cc7d4..584cfee 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc @@ -56,6 +56,7 @@ test01() VERIFY( iter != end(iter) ); VERIFY( iter->path() == p/"d1" ); ++iter; + VERIFY( iter != end(iter) ); VERIFY( iter->path() == p/"d1/d2" ); ++iter; VERIFY( iter == end(iter) ); @@ -88,6 +89,7 @@ test01() VERIFY( iter != end(iter) ); VERIFY( iter->path() == p/"d1" ); ++iter; // should recurse into d1 + VERIFY( iter != end(iter) ); VERIFY( iter->path() == p/"d1/d2" ); iter.increment(ec); // should fail to recurse into p/d1/d2 VERIFY( ec ); |