diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:58 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:58 +0000 |
commit | 53a420fba21cf1644972b34dcd811a43cdb8368d (patch) | |
tree | 66a19f6f8b65215772549a51d688492ab8addc0d /test/std/strings/basic.string/string.capacity/capacity.pass.cpp | |
parent | b50f1549701eb950921e5d6f2e55ba1a1dadbb43 (diff) |
Notes
Diffstat (limited to 'test/std/strings/basic.string/string.capacity/capacity.pass.cpp')
-rw-r--r-- | test/std/strings/basic.string/string.capacity/capacity.pass.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/std/strings/basic.string/string.capacity/capacity.pass.cpp b/test/std/strings/basic.string/string.capacity/capacity.pass.cpp index 4b09c096792c9..79fbd2e963221 100644 --- a/test/std/strings/basic.string/string.capacity/capacity.pass.cpp +++ b/test/std/strings/basic.string/string.capacity/capacity.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // <string> // size_type capacity() const; @@ -18,21 +17,27 @@ #include "test_allocator.h" #include "min_allocator.h" +#include "test_macros.h" + template <class S> void test(S s) { S::allocator_type::throw_after = 0; +#ifndef TEST_HAS_NO_EXCEPTIONS try +#endif { while (s.size() < s.capacity()) s.push_back(typename S::value_type()); assert(s.size() == s.capacity()); } +#ifndef TEST_HAS_NO_EXCEPTIONS catch (...) { assert(false); } +#endif S::allocator_type::throw_after = INT_MAX; } |