This revision was automatically updated to reflect the committed changes.
Closed by commit rL288157: Protect std::{,unordered_}map tests under 
noexceptions (authored by rogfer01).

Changed prior to commit:
  https://reviews.llvm.org/D27093?vs=79212&id=79582#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D27093

Files:
  libcxx/trunk/test/std/containers/associative/map/map.access/at.pass.cpp
  libcxx/trunk/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp

Index: libcxx/trunk/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
===================================================================
--- libcxx/trunk/test/std/containers/unord/unord.map/unord.map.elem/at.pass.cpp
+++ libcxx/trunk/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 @@
         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 @@
         {
         }
         assert(c.size() == 4);
+#endif
     }
     {
         typedef std::unordered_map<int, std::string> C;
@@ -67,6 +69,7 @@
         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 @@
         {
         }
         assert(c.size() == 4);
+#endif
     }
 #if TEST_STD_VER >= 11
     {
@@ -95,6 +99,7 @@
         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 @@
         {
         }
         assert(c.size() == 4);
+#endif
     }
     {
         typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
@@ -121,6 +127,7 @@
         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 @@
         {
         }
         assert(c.size() == 4);
+#endif
     }
 #endif
 }
Index: libcxx/trunk/test/std/containers/associative/map/map.access/at.pass.cpp
===================================================================
--- libcxx/trunk/test/std/containers/associative/map/map.access/at.pass.cpp
+++ libcxx/trunk/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,14 +43,16 @@
         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);
             assert(false);
         }
         catch (std::out_of_range&)
         {
         }
+#endif
         assert(m.at(7) == 7.5);
         assert(m.at(8) == 8.5);
         assert(m.size() == 7);
@@ -74,14 +76,16 @@
         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);
             assert(false);
         }
         catch (std::out_of_range&)
         {
         }
+#endif
         assert(m.at(7) == 7.5);
         assert(m.at(8) == 8.5);
         assert(m.size() == 7);
@@ -108,14 +112,16 @@
         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);
             assert(false);
         }
         catch (std::out_of_range&)
         {
         }
+#endif
         assert(m.at(7) == 7.5);
         assert(m.at(8) == 8.5);
         assert(m.size() == 7);
@@ -139,14 +145,16 @@
         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);
             assert(false);
         }
         catch (std::out_of_range&)
         {
         }
+#endif
         assert(m.at(7) == 7.5);
         assert(m.at(8) == 8.5);
         assert(m.size() == 7);
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to