libstdc++: Make tests for std::ranges access functions more robust
authorJonathan Wakely <jwakely@redhat.com>
Wed, 29 Jan 2020 13:36:15 +0000 (13:36 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 29 Jan 2020 13:36:15 +0000 (13:36 +0000)
commit5cd2e126f5c5705fa1aa7fafef3d6b94a99593da
treed759fca7ab12d32e415c712b9afef00827a6a259
parent6693911f069b1ada7c04aa1d00c3653ba694958a
libstdc++: Make tests for std::ranges access functions more robust

* testsuite/std/ranges/access/end.cc: Do not assume test_range::end()
returns the same type as test_range::begin(). Add comments.
* testsuite/std/ranges/access/rbegin.cc: Likewise.
* testsuite/std/ranges/access/rend.cc: Likewise.
* testsuite/std/ranges/range.cc: Do not assume the sentinel for
test_range is the same as its iterator type.
* testsuite/util/testsuite_iterators.h (test_range::sentinel): Add
operator- overloads to satisfy sized_sentinel_for when the iterator
satisfies random_access_iterator.
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/std/ranges/access/end.cc
libstdc++-v3/testsuite/std/ranges/access/rbegin.cc
libstdc++-v3/testsuite/std/ranges/access/rend.cc
libstdc++-v3/testsuite/std/ranges/range.cc
libstdc++-v3/testsuite/util/testsuite_iterators.h