From 51072bd6bf79ef2bc6a922079bff57c31c1effbc Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Jul 2016 20:47:26 +0000 Subject: Vendor import of libc++ release_39 branch r276489: https://llvm.org/svn/llvm-project/libcxx/branches/release_39@276489 --- .../string.modifiers/string_assign/iterator.pass.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp') diff --git a/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp index 690aebd4c2a6..e6a57519f34b 100644 --- a/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp +++ b/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp @@ -15,6 +15,7 @@ #include #include +#include "test_macros.h" #include "test_iterators.h" #include "min_allocator.h" @@ -23,10 +24,11 @@ void test(S s, It first, It last, S expected) { s.assign(first, last); - assert(s.__invariants()); + LIBCPP_ASSERT(s.__invariants()); assert(s == expected); } +#ifndef TEST_HAS_NO_EXCEPTIONS template void test_exceptions(S s, It first, It last) @@ -35,11 +37,12 @@ test_exceptions(S s, It first, It last) try { s.assign(first, last); assert(false); - } + } catch (...) {} - assert(s.__invariants()); + LIBCPP_ASSERT(s.__invariants()); assert(s == aCopy); } +#endif int main() { @@ -101,7 +104,7 @@ int main() test(S("12345678901234567890"), input_iterator(s), input_iterator(s+52), S("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")); } -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 { typedef std::basic_string, min_allocator> S; const char* s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; @@ -161,6 +164,7 @@ int main() S("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")); } #endif +#ifndef TEST_HAS_NO_EXCEPTIONS { // test iterator operations that throw typedef std::string S; typedef ThrowingIterator TIter; @@ -174,4 +178,5 @@ int main() test_exceptions(S(), TIter(s, s+10, 5, TIter::TADereference), TIter()); test_exceptions(S(), TIter(s, s+10, 6, TIter::TAComparison), TIter()); } +#endif } -- cgit v1.2.3