[libcxx] r288382 - Protect futures test under libcpp-no-exceptions
Roger Ferrer Ibanez via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 1 09:34:57 PST 2016
Author: rogfer01
Date: Thu Dec 1 11:34:57 2016
New Revision: 288382
URL: http://llvm.org/viewvc/llvm-project?rev=288382&view=rev
Log:
Protect futures test under libcpp-no-exceptions
Skip tests that expect an exception be thrown.
Differential Revision: https://reviews.llvm.org/D27253
Modified:
libcxx/trunk/test/std/thread/futures/futures.promise/move_assign.pass.cpp
Modified: libcxx/trunk/test/std/thread/futures/futures.promise/move_assign.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.promise/move_assign.pass.cpp?rev=288382&r1=288381&r2=288382&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.promise/move_assign.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.promise/move_assign.pass.cpp Thu Dec 1 11:34:57 2016
@@ -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 @@ int main()
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 @@ int main()
{
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 @@ int main()
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 @@ int main()
{
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 @@ int main()
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 @@ int main()
{
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);
More information about the cfe-commits
mailing list