diff options
Diffstat (limited to 'libstdc++-v3/testsuite/21_strings/capacity.cc')
-rw-r--r-- | libstdc++-v3/testsuite/21_strings/capacity.cc | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/libstdc++-v3/testsuite/21_strings/capacity.cc b/libstdc++-v3/testsuite/21_strings/capacity.cc index b93e6fe64c8..8239f1b6488 100644 --- a/libstdc++-v3/testsuite/21_strings/capacity.cc +++ b/libstdc++-v3/testsuite/21_strings/capacity.cc @@ -22,7 +22,7 @@ #include <string> #include <cstdio> -#include <debug_assert.h> +#include <testsuite_hooks.h> template<typename T> struct A { }; @@ -169,11 +169,30 @@ bool test01() return test; } +// libstdc++/4548 +// http://gcc.gnu.org/ml/libstdc++/2001-11/msg00150.html +bool test02() +{ + bool test = true; + + std::string str01 = "twelve chars"; + // str01 becomes shared + std::string str02 = str01; + str01.reserve(1); + VERIFY( str01.capacity() == 12 ); + +#ifdef DEBUG_ASSERT + assert(test); +#endif + + return test; +} + + int main() { test01(); + test02(); return 0; } - - |