summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings/basic.string/string.capacity/capacity.pass.cpp
diff options
context:
space:
mode:
authorRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-11-29 16:40:19 +0000
committerRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-11-29 16:40:19 +0000
commit9d03c03858e99525969edade670a8f8ccb706d64 (patch)
tree8c8f87c41bbd438cc51384d2387a0125ca3d20d4 /libcxx/test/std/strings/basic.string/string.capacity/capacity.pass.cpp
parentf2e50651f653adaaa72cfe6c3c9a7c6fc87124cb (diff)
downloadbcm5719-llvm-9d03c03858e99525969edade670a8f8ccb706d64.tar.gz
bcm5719-llvm-9d03c03858e99525969edade670a8f8ccb706d64.zip
Protect std::string tests under libcpp-no-exceptions
Skip tests that expect an exception be thrown and/or disable unreachable catch handlers. Differential Revision: https://reviews.llvm.org/D26612 llvm-svn: 288158
Diffstat (limited to 'libcxx/test/std/strings/basic.string/string.capacity/capacity.pass.cpp')
-rw-r--r--libcxx/test/std/strings/basic.string/string.capacity/capacity.pass.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libcxx/test/std/strings/basic.string/string.capacity/capacity.pass.cpp b/libcxx/test/std/strings/basic.string/string.capacity/capacity.pass.cpp
index 4b09c096792..79fbd2e9632 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/capacity.pass.cpp
+++ b/libcxx/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;
}
OpenPOWER on IntegriCloud