Protect std::array tests under noexceptions

Skip tests that expect exceptions be thrown. Also add missing asserts.

Differential Revision: https://reviews.llvm.org/D27095

llvm-svn: 288165
This commit is contained in:
Roger Ferrer Ibanez 2016-11-29 17:10:29 +00:00
parent 2dfeb6e3c2
commit 86663cd0ef
1 changed files with 14 additions and 3 deletions

View File

@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
// XFAIL: libcpp-no-exceptions
// <array>
// reference operator[] (size_type)
@ -40,8 +39,14 @@ int main()
r2 = 7.5;
assert(c.back() == 7.5);
try { (void) c.at(3); }
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
(void) c.at(3);
assert(false);
}
catch (const std::out_of_range &) {}
#endif
}
{
typedef double T;
@ -53,8 +58,14 @@ int main()
C::const_reference r2 = c.at(2);
assert(r2 == 3.5);
try { (void) c.at(3); }
#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
(void) c.at(3);
assert(false);
}
catch (const std::out_of_range &) {}
#endif
}
#if TEST_STD_VER > 11