summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-11-29 16:37:48 +0000
committerRoger Ferrer Ibanez <roger.ferreribanez@arm.com>2016-11-29 16:37:48 +0000
commitf2e50651f653adaaa72cfe6c3c9a7c6fc87124cb (patch)
tree175bc44ee933e3ab76ba1d285572c37dbda98617 /libcxx/test
parentd7306fb85ae44e7e5a66003ca81541c1721b5197 (diff)
downloadbcm5719-llvm-f2e50651f653adaaa72cfe6c3c9a7c6fc87124cb.tar.gz
bcm5719-llvm-f2e50651f653adaaa72cfe6c3c9a7c6fc87124cb.zip
Protect std::{,unordered_}map tests under noexceptions
Skip tests that use exceptions Differential Revision: https://reviews.llvm.org/D27093 llvm-svn: 288157
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/std/containers/associative/map/map.access/at.pass.cpp10
-rw-r--r--libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp10
2 files changed, 18 insertions, 2 deletions
diff --git a/libcxx/test/std/containers/associative/map/map.access/at.pass.cpp b/libcxx/test/std/containers/associative/map/map.access/at.pass.cpp
index c5f77bf5f0f..6d3e98e9e78 100644
--- a/libcxx/test/std/containers/associative/map/map.access/at.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.access/at.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <map>
// class map
@@ -19,6 +18,7 @@
#include <cassert>
#include "min_allocator.h"
+#include "test_macros.h"
int main()
{
@@ -43,6 +43,7 @@ int main()
assert(m.at(3) == 3.5);
assert(m.at(4) == 4.5);
assert(m.at(5) == 5.5);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
m.at(6);
@@ -51,6 +52,7 @@ int main()
catch (std::out_of_range&)
{
}
+#endif
assert(m.at(7) == 7.5);
assert(m.at(8) == 8.5);
assert(m.size() == 7);
@@ -74,6 +76,7 @@ int main()
assert(m.at(3) == 3.5);
assert(m.at(4) == 4.5);
assert(m.at(5) == 5.5);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
m.at(6);
@@ -82,6 +85,7 @@ int main()
catch (std::out_of_range&)
{
}
+#endif
assert(m.at(7) == 7.5);
assert(m.at(8) == 8.5);
assert(m.size() == 7);
@@ -108,6 +112,7 @@ int main()
assert(m.at(3) == 3.5);
assert(m.at(4) == 4.5);
assert(m.at(5) == 5.5);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
m.at(6);
@@ -116,6 +121,7 @@ int main()
catch (std::out_of_range&)
{
}
+#endif
assert(m.at(7) == 7.5);
assert(m.at(8) == 8.5);
assert(m.size() == 7);
@@ -139,6 +145,7 @@ int main()
assert(m.at(3) == 3.5);
assert(m.at(4) == 4.5);
assert(m.at(5) == 5.5);
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
m.at(6);
@@ -147,6 +154,7 @@ int main()
catch (std::out_of_range&)
{
}
+#endif
assert(m.at(7) == 7.5);
assert(m.at(8) == 8.5);
assert(m.size() == 7);
diff --git a/libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp b/libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
index 5504d33f299..8fbded4cd5f 100644
--- a/libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: libcpp-no-exceptions
// <unordered_map>
// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -23,6 +22,7 @@
#include "MoveOnly.h"
#include "min_allocator.h"
+#include "test_macros.h"
int main()
{
@@ -42,6 +42,7 @@ int main()
assert(c.size() == 4);
c.at(1) = "ONE";
assert(c.at(1) == "ONE");
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
c.at(11) = "eleven";
@@ -51,6 +52,7 @@ int main()
{
}
assert(c.size() == 4);
+#endif
}
{
typedef std::unordered_map<int, std::string> C;
@@ -67,6 +69,7 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.size() == 4);
assert(c.at(1) == "one");
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
c.at(11);
@@ -76,6 +79,7 @@ int main()
{
}
assert(c.size() == 4);
+#endif
}
#if TEST_STD_VER >= 11
{
@@ -95,6 +99,7 @@ int main()
assert(c.size() == 4);
c.at(1) = "ONE";
assert(c.at(1) == "ONE");
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
c.at(11) = "eleven";
@@ -104,6 +109,7 @@ int main()
{
}
assert(c.size() == 4);
+#endif
}
{
typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
@@ -121,6 +127,7 @@ int main()
const C c(a, a + sizeof(a)/sizeof(a[0]));
assert(c.size() == 4);
assert(c.at(1) == "one");
+#ifndef TEST_HAS_NO_EXCEPTIONS
try
{
c.at(11);
@@ -130,6 +137,7 @@ int main()
{
}
assert(c.size() == 4);
+#endif
}
#endif
}
OpenPOWER on IntegriCloud