[PATCH] D27253: Protect futures test under libcpp-no-exceptions

Roger Ferrer Ibanez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 30 03:33:19 PST 2016


rogfer01 created this revision.
rogfer01 added reviewers: mclow.lists, EricWF, rmaprath.
rogfer01 added a subscriber: cfe-commits.

Skip tests that expect an exception be thrown.


https://reviews.llvm.org/D27253

Files:
  test/std/thread/futures/futures.promise/move_assign.pass.cpp


Index: test/std/thread/futures/futures.promise/move_assign.pass.cpp
===================================================================
--- test/std/thread/futures/futures.promise/move_assign.pass.cpp
+++ test/std/thread/futures/futures.promise/move_assign.pass.cpp
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// XFAIL: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
 // UNSUPPORTED: c++98, c++03
 
@@ -20,6 +19,7 @@
 #include <future>
 #include <cassert>
 
+#include "test_macros.h"
 #include "test_allocator.h"
 
 int main()
@@ -34,6 +34,7 @@
         std::future<int> f = p.get_future();
         assert(test_alloc_base::alloc_count == 1);
         assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
         try
         {
             f = p0.get_future();
@@ -43,6 +44,7 @@
         {
             assert(e.code() == make_error_code(std::future_errc::no_state));
         }
+#endif
         assert(test_alloc_base::alloc_count == 1);
     }
     assert(test_alloc_base::alloc_count == 0);
@@ -55,6 +57,7 @@
         std::future<int&> f = p.get_future();
         assert(test_alloc_base::alloc_count == 1);
         assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
         try
         {
             f = p0.get_future();
@@ -64,6 +67,7 @@
         {
             assert(e.code() == make_error_code(std::future_errc::no_state));
         }
+#endif
         assert(test_alloc_base::alloc_count == 1);
     }
     assert(test_alloc_base::alloc_count == 0);
@@ -76,6 +80,7 @@
         std::future<void> f = p.get_future();
         assert(test_alloc_base::alloc_count == 1);
         assert(f.valid());
+#ifndef TEST_HAS_NO_EXCEPTIONS
         try
         {
             f = p0.get_future();
@@ -85,6 +90,7 @@
         {
             assert(e.code() == make_error_code(std::future_errc::no_state));
         }
+#endif
         assert(test_alloc_base::alloc_count == 1);
     }
     assert(test_alloc_base::alloc_count == 0);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27253.79718.patch
Type: text/x-patch
Size: 2006 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161130/57a3d615/attachment.bin>


More information about the cfe-commits mailing list