From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 6EA1E388A42B; Tue, 20 Apr 2021 18:53:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6EA1E388A42B MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r9-9385] Improve tests for std::vector printer X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-9 X-Git-Oldrev: 6cc765a7917004478770f27bade1ecbb55906ae0 X-Git-Newrev: b2a1a375141bb3d79a6d4d6e7579230ec3687f23 Message-Id: <20210420185341.6EA1E388A42B@sourceware.org> Date: Tue, 20 Apr 2021 18:53:41 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 18:53:41 -0000 https://gcc.gnu.org/g:b2a1a375141bb3d79a6d4d6e7579230ec3687f23 commit r9-9385-gb2a1a375141bb3d79a6d4d6e7579230ec3687f23 Author: Jonathan Wakely Date: Thu Jun 20 10:04:55 2019 +0100 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. (cherry picked from commit 94872d7f99ceb9da9ecb90064d59d4518c9a6f37) Diff: --- libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc | 3 ++- libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc index 86b7c27d861..5f9526f56b2 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc @@ -121,11 +121,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 5d47bdcd648..414cfed2fd8 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc @@ -114,11 +114,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);