From 230b4edeee99f2585aefe233f6832cb2d4d68631 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Sat, 14 Nov 2015 17:24:42 +0000 Subject: [PATCH] Fix std::wstring capacity test for short wchar_t * testsuite/21_strings/basic_string/capacity/char/18654.cc: Use real minimum capacity. * testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc: Likewise. From-SVN: r230378 --- libstdc++-v3/ChangeLog | 7 +++++++ .../21_strings/basic_string/capacity/char/18654.cc | 2 +- .../21_strings/basic_string/capacity/wchar_t/18654.cc | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4672501b682..6f5ecebe329 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2015-11-14 Jonathan Wakely + + * testsuite/21_strings/basic_string/capacity/char/18654.cc: Use + real minimum capacity. + * testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc: + Likewise. + 2015-11-13 David Edelsohn * testsuite/experimental/random/randint.cc: Add dg-add-options tls. diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc index 694462768f6..21980777ecd 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc @@ -38,7 +38,7 @@ void test01() #if _GLIBCXX_USE_CXX11_ABI // Can't shrink below small string size. - const size_type minsize = 2 << 3; + const size_type minsize = string().capacity() + 1; #else // Exact shrink-to-size and shrink-to-fit const size_type minsize = 2 << 0; diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc index 3bd853a42bb..d6202c9804a 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc @@ -38,7 +38,7 @@ void test01() #if _GLIBCXX_USE_CXX11_ABI // Can't shrink below small string size. - const size_type minsize = 2 << 1; + const size_type minsize = wstring().capacity() + 1; #else // Exact shrink-to-size and shrink-to-fit const size_type minsize = 2 << 0; -- 2.30.2