summaryrefslogtreecommitdiffstats
path: root/test/std/containers/sequences/array/at.pass.cpp
diff options
context:
space:
mode:
authorRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-11-29 17:10:29 +0000
committerRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-11-29 17:10:29 +0000
commit72ac68a9806fd986198364956110094c570d2e7b (patch)
tree9c9af689fa6a5f9847422354d93f9b8bd755d25a /test/std/containers/sequences/array/at.pass.cpp
parent81086f8bfedb345855f53dc5914fac39344fa691 (diff)
downloadexternal_libcxx-72ac68a9806fd986198364956110094c570d2e7b.tar.gz
external_libcxx-72ac68a9806fd986198364956110094c570d2e7b.tar.bz2
external_libcxx-72ac68a9806fd986198364956110094c570d2e7b.zip
Protect std::array tests under noexceptions
Skip tests that expect exceptions be thrown. Also add missing asserts. Differential Revision: https://reviews.llvm.org/D27095 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/std/containers/sequences/array/at.pass.cpp')
-rw-r--r--test/std/containers/sequences/array/at.pass.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/std/containers/sequences/array/at.pass.cpp b/test/std/containers/sequences/array/at.pass.cpp
index 9707beeb3..29483153d 100644
--- a/test/std/containers/sequences/array/at.pass.cpp
+++ b/test/std/containers/sequences/array/at.pass.cpp
@@ -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