From: Jonathan Wakely Date: Thu, 20 Jun 2019 09:04:55 +0000 (+0100) Subject: Improve tests for std::vector printer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=94872d7f99ceb9da9ecb90064d59d4518c9a6f37;p=gcc.git Improve tests for std::vector printer The current tests wouldn't notice if the vector contents were printed in reverse, because it would read the same forwards and backwards. Change the content so the tests would fail if that happened. * testsuite/libstdc++-prettyprinters/simple.cc: Use non-palindromic vector for test. * testsuite/libstdc++-prettyprinters/simple11.cc: Likewise. From-SVN: r272499 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 40df69ee49c..84d54789a13 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2019-06-20 Jonathan Wakely + + * testsuite/libstdc++-prettyprinters/simple.cc: Use non-palindromic + vector for test. + * testsuite/libstdc++-prettyprinters/simple11.cc: Likewise. + 2019-06-19 Jonathan Wakely * include/bits/stream_iterator.h (istream_iterator::_M_equal()): Make diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc index 04c1ef683a6..2e7f07b649f 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc @@ -120,11 +120,12 @@ main() vb.reserve(100); vb.push_back(true); vb.push_back(true); + vb.push_back(true); vb.push_back(false); vb.push_back(false); vb.push_back(true); vb.erase(vb.begin()); -// { dg-final { regexp-test vb {std::(__debug::)?vector of length 4, capacity 128 = \\{true, false, false, true\\}} } } +// { dg-final { regexp-test vb {std::(__debug::)?vector of length 5, capacity 128 = \\{true, true, false, false, true\\}} } } __gnu_cxx::slist sll; sll.push_front(23); diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc index ace217cc9e8..24c871f6fba 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc @@ -113,11 +113,12 @@ main() vb.reserve(100); vb.push_back(true); vb.push_back(true); + vb.push_back(true); vb.push_back(false); vb.push_back(false); vb.push_back(true); vb.erase(vb.begin()); -// { dg-final { regexp-test vb {std::(__debug::)?vector of length 4, capacity 128 = \\{true, false, false, true\\}} } } +// { dg-final { regexp-test vb {std::(__debug::)?vector of length 5, capacity 128 = \\{true, true, false, false, true\\}} } } __gnu_cxx::slist sll; sll.push_front(23);