Improve tests for std::vector<bool> printer
authorJonathan Wakely <jwakely@redhat.com>
Thu, 20 Jun 2019 09:04:55 +0000 (10:04 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 20 Jun 2019 09:04:55 +0000 (10:04 +0100)
The current tests wouldn't notice if the vector<bool> 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<bool> for test.
* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.

From-SVN: r272499

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc

index 40df69ee49c8b1a651a551cd5eb94cc3daefc0d5..84d54789a139ce8d1400638544a580c05e981512 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-20  Jonathan Wakely  <jwakely@redhat.com>
+
+       * testsuite/libstdc++-prettyprinters/simple.cc: Use non-palindromic
+       vector<bool> for test.
+       * testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
+
 2019-06-19  Jonathan Wakely  <jwakely@redhat.com>
 
        * include/bits/stream_iterator.h (istream_iterator::_M_equal()): Make
index 04c1ef683a68c675cd6d5ba16c06a4985e4acb82..2e7f07b649fd8c9397c553f57b1dc99fd007721a 100644 (file)
@@ -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<bool> of length 4, capacity 128 = \\{true, false, false, true\\}} } }
+// { dg-final { regexp-test vb {std::(__debug::)?vector<bool> of length 5, capacity 128 = \\{true, true, false, false, true\\}} } }
 
   __gnu_cxx::slist<int> sll;
   sll.push_front(23);
index ace217cc9e8cce3bd78bfc7797a2ef1305c616a1..24c871f6fba02cd7cd0768931e192b21a600ffc3 100644 (file)
@@ -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<bool> of length 4, capacity 128 = \\{true, false, false, true\\}} } }
+// { dg-final { regexp-test vb {std::(__debug::)?vector<bool> of length 5, capacity 128 = \\{true, true, false, false, true\\}} } }
 
   __gnu_cxx::slist<int> sll;
   sll.push_front(23);