Missed a test with exceptions disabled earlier. Oops.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286883 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -31,7 +31,7 @@ test(SV sv, unsigned pos, unsigned n)
|
|||||||
{
|
{
|
||||||
typedef typename S::traits_type T;
|
typedef typename S::traits_type T;
|
||||||
typedef typename S::allocator_type A;
|
typedef typename S::allocator_type A;
|
||||||
try
|
if (pos <= sv.size())
|
||||||
{
|
{
|
||||||
S s2(sv, pos, n);
|
S s2(sv, pos, n);
|
||||||
LIBCPP_ASSERT(s2.__invariants());
|
LIBCPP_ASSERT(s2.__invariants());
|
||||||
@@ -42,11 +42,21 @@ test(SV sv, unsigned pos, unsigned n)
|
|||||||
assert(s2.get_allocator() == A());
|
assert(s2.get_allocator() == A());
|
||||||
assert(s2.capacity() >= s2.size());
|
assert(s2.capacity() >= s2.size());
|
||||||
}
|
}
|
||||||
|
#ifndef TEST_HAS_NO_EXCEPTIONS
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
S s2(sv, pos, n);
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
catch (std::out_of_range&)
|
catch (std::out_of_range&)
|
||||||
{
|
{
|
||||||
assert(pos > sv.size());
|
assert(pos > sv.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
template <class S, class SV>
|
template <class S, class SV>
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user