diff options
Diffstat (limited to 'libcxx/test/std/thread/futures/futures.promise')
18 files changed, 127 insertions, 186 deletions
diff --git a/libcxx/test/std/thread/futures/futures.promise/alloc_ctor.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/alloc_ctor.pass.cpp index 70a4e00b0d6..c0fe2ef881e 100644 --- a/libcxx/test/std/thread/futures/futures.promise/alloc_ctor.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/alloc_ctor.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> @@ -19,36 +20,36 @@ #include <future> #include <cassert> -#include "../test_allocator.h" +#include "test_allocator.h" #include "min_allocator.h" int main() { - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { - std::promise<int> p(std::allocator_arg, test_allocator<int>()); - assert(test_alloc_base::count == 1); + std::promise<int> p(std::allocator_arg, test_allocator<int>(42)); + assert(test_alloc_base::alloc_count == 1); std::future<int> f = p.get_future(); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); assert(f.valid()); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { - std::promise<int&> p(std::allocator_arg, test_allocator<int>()); - assert(test_alloc_base::count == 1); + std::promise<int&> p(std::allocator_arg, test_allocator<int>(42)); + assert(test_alloc_base::alloc_count == 1); std::future<int&> f = p.get_future(); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); assert(f.valid()); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { - std::promise<void> p(std::allocator_arg, test_allocator<void>()); - assert(test_alloc_base::count == 1); + std::promise<void> p(std::allocator_arg, test_allocator<void>(42)); + assert(test_alloc_base::alloc_count == 1); std::future<void> f = p.get_future(); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); assert(f.valid()); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); // Test with a minimal allocator { std::promise<int> p(std::allocator_arg, bare_allocator<void>()); diff --git a/libcxx/test/std/thread/futures/futures.promise/copy_assign.fail.cpp b/libcxx/test/std/thread/futures/futures.promise/copy_assign.fail.cpp index c0827812222..e150ba0df65 100644 --- a/libcxx/test/std/thread/futures/futures.promise/copy_assign.fail.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/copy_assign.fail.cpp @@ -14,74 +14,36 @@ // promise& operator=(const promise& rhs) = delete; #include <future> -#include <cassert> -#include "../test_allocator.h" +#include "test_macros.h" int main() { - assert(test_alloc_base::count == 0); +#if TEST_STD_VER >= 11 { - std::promise<int> p0(std::allocator_arg, test_allocator<int>()); - std::promise<int> p(std::allocator_arg, test_allocator<int>()); - assert(test_alloc_base::count == 2); - p = p0; - assert(test_alloc_base::count == 1); - std::future<int> f = p.get_future(); - assert(test_alloc_base::count == 1); - assert(f.valid()); - try - { - f = p0.get_future(); - assert(false); - } - catch (const std::future_error& e) - { - assert(e.code() == make_error_code(std::future_errc::no_state)); - } - assert(test_alloc_base::count == 1); + std::promise<int> p0, p; + p = p0; // expected-error {{overload resolution selected deleted operator '='}} } - assert(test_alloc_base::count == 0); { - std::promise<int&> p0(std::allocator_arg, test_allocator<int>()); - std::promise<int&> p(std::allocator_arg, test_allocator<int>()); - assert(test_alloc_base::count == 2); - p = p0; - assert(test_alloc_base::count == 1); - std::future<int&> f = p.get_future(); - assert(test_alloc_base::count == 1); - assert(f.valid()); - try - { - f = p0.get_future(); - assert(false); - } - catch (const std::future_error& e) - { - assert(e.code() == make_error_code(std::future_errc::no_state)); - } - assert(test_alloc_base::count == 1); + std::promise<int&> p0, p; + p = p0; // expected-error {{overload resolution selected deleted operator '='}} } - assert(test_alloc_base::count == 0); { - std::promise<void> p0(std::allocator_arg, test_allocator<void>()); - std::promise<void> p(std::allocator_arg, test_allocator<void>()); - assert(test_alloc_base::count == 2); - p = p0; - assert(test_alloc_base::count == 1); - std::future<void> f = p.get_future(); - assert(test_alloc_base::count == 1); - assert(f.valid()); - try - { - f = p0.get_future(); - assert(false); - } - catch (const std::future_error& e) - { - assert(e.code() == make_error_code(std::future_errc::no_state)); - } - assert(test_alloc_base::count == 1); + std::promise<void> p0, p; + p = p0; // expected-error {{overload resolution selected deleted operator '='}} } - assert(test_alloc_base::count == 0); +#else + { + std::promise<int> p0, p; + p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise<int>'}} + } + { + std::promise<int&> p0, p; + p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise<int &>'}} + } + { + std::promise<void> p0, p; + p = p0; // expected-error {{'operator=' is a private member of 'std::__1::promise<void>'}} + } +#endif } diff --git a/libcxx/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp b/libcxx/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp index 36a3555aed4..34becbc1259 100644 --- a/libcxx/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/copy_ctor.fail.cpp @@ -14,68 +14,36 @@ // promise(const promise&) = delete; #include <future> -#include <cassert> -#include "../test_allocator.h" +#include "test_macros.h" int main() { - assert(test_alloc_base::count == 0); +#if TEST_STD_VER >= 11 { - std::promise<int> p0(std::allocator_arg, test_allocator<int>()); - std::promise<int> p(p0); - assert(test_alloc_base::count == 1); - std::future<int> f = p.get_future(); - assert(test_alloc_base::count == 1); - assert(f.valid()); - try - { - f = p0.get_future(); - assert(false); - } - catch (const std::future_error& e) - { - assert(e.code() == make_error_code(std::future_errc::no_state)); - } - assert(test_alloc_base::count == 1); + std::promise<int> p0; + std::promise<int> p(p0); // expected-error {{call to deleted constructor of 'std::promise<int>'}} } - assert(test_alloc_base::count == 0); { - std::promise<int&> p0(std::allocator_arg, test_allocator<int>()); - std::promise<int&> p(p0); - assert(test_alloc_base::count == 1); - std::future<int&> f = p.get_future(); - assert(test_alloc_base::count == 1); - assert(f.valid()); - try - { - f = p0.get_future(); - assert(false); - } - catch (const std::future_error& e) - { - assert(e.code() == make_error_code(std::future_errc::no_state)); - } - assert(test_alloc_base::count == 1); + std::promise<int &> p0; + std::promise<int &> p(p0); // expected-error {{call to deleted constructor of 'std::promise<int &>'}} } - assert(test_alloc_base::count == 0); { - std::promise<void> p0(std::allocator_arg, test_allocator<void>()); - std::promise<void> p(p0); - assert(test_alloc_base::count == 1); - std::future<void> f = p.get_future(); - assert(test_alloc_base::count == 1); - assert(f.valid()); - try - { - f = p0.get_future(); - assert(false); - } - catch (const std::future_error& e) - { - assert(e.code() == make_error_code(std::future_errc::no_state)); - } - assert(test_alloc_base::count == 1); + std::promise<void> p0; + std::promise<void> p(p0); // expected-error {{call to deleted constructor of 'std::promise<void>'}} } - assert(test_alloc_base::count == 0); +#else + { + std::promise<int> p0; + std::promise<int> p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise<int>'}} + } + { + std::promise<int &> p0; + std::promise<int &> p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise<int &>'}} + } + { + std::promise<void> p0; + std::promise<void> p(p0); // expected-error {{calling a private constructor of class 'std::__1::promise<void>'}} + } +#endif } diff --git a/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp index 95c9657c633..d108b42756e 100644 --- a/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.promise/dtor.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/dtor.pass.cpp index 78912f12adb..a28e886bc27 100644 --- a/libcxx/test/std/thread/futures/futures.promise/dtor.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/dtor.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.promise/get_future.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/get_future.pass.cpp index a7d084ee787..8392c9f7bbb 100644 --- a/libcxx/test/std/thread/futures/futures.promise/get_future.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/get_future.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.promise/move_assign.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/move_assign.pass.cpp index c3097df7499..80f4046dbca 100644 --- a/libcxx/test/std/thread/futures/futures.promise/move_assign.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/move_assign.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> @@ -18,20 +19,19 @@ #include <future> #include <cassert> -#include "../test_allocator.h" +#include "test_allocator.h" int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { std::promise<int> p0(std::allocator_arg, test_allocator<int>()); std::promise<int> p(std::allocator_arg, test_allocator<int>()); - assert(test_alloc_base::count == 2); + assert(test_alloc_base::alloc_count == 2); p = std::move(p0); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); std::future<int> f = p.get_future(); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); assert(f.valid()); try { @@ -42,17 +42,17 @@ int main() { assert(e.code() == make_error_code(std::future_errc::no_state)); } - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { std::promise<int&> p0(std::allocator_arg, test_allocator<int>()); std::promise<int&> p(std::allocator_arg, test_allocator<int>()); - assert(test_alloc_base::count == 2); + assert(test_alloc_base::alloc_count == 2); p = std::move(p0); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); std::future<int&> f = p.get_future(); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); assert(f.valid()); try { @@ -63,17 +63,17 @@ int main() { assert(e.code() == make_error_code(std::future_errc::no_state)); } - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { std::promise<void> p0(std::allocator_arg, test_allocator<void>()); std::promise<void> p(std::allocator_arg, test_allocator<void>()); - assert(test_alloc_base::count == 2); + assert(test_alloc_base::alloc_count == 2); p = std::move(p0); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); std::future<void> f = p.get_future(); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); assert(f.valid()); try { @@ -84,8 +84,7 @@ int main() { assert(e.code() == make_error_code(std::future_errc::no_state)); } - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); } - assert(test_alloc_base::count == 0); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + assert(test_alloc_base::alloc_count == 0); } diff --git a/libcxx/test/std/thread/futures/futures.promise/move_ctor.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/move_ctor.pass.cpp index eeec4fb15b9..d45c48a9504 100644 --- a/libcxx/test/std/thread/futures/futures.promise/move_ctor.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/move_ctor.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> @@ -18,18 +19,17 @@ #include <future> #include <cassert> -#include "../test_allocator.h" +#include "test_allocator.h" int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { std::promise<int> p0(std::allocator_arg, test_allocator<int>()); std::promise<int> p(std::move(p0)); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); std::future<int> f = p.get_future(); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); assert(f.valid()); try { @@ -40,15 +40,15 @@ int main() { assert(e.code() == make_error_code(std::future_errc::no_state)); } - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { std::promise<int&> p0(std::allocator_arg, test_allocator<int>()); std::promise<int&> p(std::move(p0)); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); std::future<int&> f = p.get_future(); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); assert(f.valid()); try { @@ -59,15 +59,15 @@ int main() { assert(e.code() == make_error_code(std::future_errc::no_state)); } - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { std::promise<void> p0(std::allocator_arg, test_allocator<void>()); std::promise<void> p(std::move(p0)); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); std::future<void> f = p.get_future(); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); assert(f.valid()); try { @@ -78,8 +78,7 @@ int main() { assert(e.code() == make_error_code(std::future_errc::no_state)); } - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); } - assert(test_alloc_base::count == 0); -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + assert(test_alloc_base::alloc_count == 0); } diff --git a/libcxx/test/std/thread/futures/futures.promise/set_exception.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/set_exception.pass.cpp index 51c05eb803c..00668f18e99 100644 --- a/libcxx/test/std/thread/futures/futures.promise/set_exception.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/set_exception.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp index 5e57692563d..77a6d123e73 100644 --- a/libcxx/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp index cdc37775012..5a75429ac1a 100644 --- a/libcxx/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/set_lvalue.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.promise/set_lvalue_at_thread_exit.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/set_lvalue_at_thread_exit.pass.cpp index 18f87c596a0..e127d2c37fa 100644 --- a/libcxx/test/std/thread/futures/futures.promise/set_lvalue_at_thread_exit.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/set_lvalue_at_thread_exit.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.promise/set_value_at_thread_exit_const.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/set_value_at_thread_exit_const.pass.cpp index ec50cc31029..79137488e60 100644 --- a/libcxx/test/std/thread/futures/futures.promise/set_value_at_thread_exit_const.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/set_value_at_thread_exit_const.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.promise/set_value_at_thread_exit_void.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/set_value_at_thread_exit_void.pass.cpp index 8c092084668..6a0ce36326e 100644 --- a/libcxx/test/std/thread/futures/futures.promise/set_value_at_thread_exit_void.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/set_value_at_thread_exit_void.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.promise/set_value_const.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/set_value_const.pass.cpp index 6673f630757..315956d4a54 100644 --- a/libcxx/test/std/thread/futures/futures.promise/set_value_const.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/set_value_const.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.promise/set_value_void.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/set_value_void.pass.cpp index 5012e0bfe5f..5ede0819123 100644 --- a/libcxx/test/std/thread/futures/futures.promise/set_value_void.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/set_value_void.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> diff --git a/libcxx/test/std/thread/futures/futures.promise/swap.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/swap.pass.cpp index 1ed3e646813..21c946981a2 100644 --- a/libcxx/test/std/thread/futures/futures.promise/swap.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/swap.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads +// UNSUPPORTED: c++98, c++03 // <future> @@ -20,65 +21,65 @@ #include <future> #include <cassert> -#include "../test_allocator.h" +#include "test_allocator.h" int main() { - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { std::promise<int> p0(std::allocator_arg, test_allocator<int>()); std::promise<int> p(std::allocator_arg, test_allocator<int>()); - assert(test_alloc_base::count == 2); + assert(test_alloc_base::alloc_count == 2); p.swap(p0); - assert(test_alloc_base::count == 2); + assert(test_alloc_base::alloc_count == 2); std::future<int> f = p.get_future(); - assert(test_alloc_base::count == 2); + assert(test_alloc_base::alloc_count == 2); assert(f.valid()); f = p0.get_future(); assert(f.valid()); - assert(test_alloc_base::count == 2); + assert(test_alloc_base::alloc_count == 2); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { std::promise<int> p0(std::allocator_arg, test_allocator<int>()); std::promise<int> p(std::allocator_arg, test_allocator<int>()); - assert(test_alloc_base::count == 2); + assert(test_alloc_base::alloc_count == 2); swap(p, p0); - assert(test_alloc_base::count == 2); + assert(test_alloc_base::alloc_count == 2); std::future<int> f = p.get_future(); - assert(test_alloc_base::count == 2); + assert(test_alloc_base::alloc_count == 2); assert(f.valid()); f = p0.get_future(); assert(f.valid()); - assert(test_alloc_base::count == 2); + assert(test_alloc_base::alloc_count == 2); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { std::promise<int> p0(std::allocator_arg, test_allocator<int>()); std::promise<int> p; - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); p.swap(p0); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); std::future<int> f = p.get_future(); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); assert(f.valid()); f = p0.get_future(); assert(f.valid()); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); { std::promise<int> p0(std::allocator_arg, test_allocator<int>()); std::promise<int> p; - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); swap(p, p0); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); std::future<int> f = p.get_future(); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); assert(f.valid()); f = p0.get_future(); assert(f.valid()); - assert(test_alloc_base::count == 1); + assert(test_alloc_base::alloc_count == 1); } - assert(test_alloc_base::count == 0); + assert(test_alloc_base::alloc_count == 0); } diff --git a/libcxx/test/std/thread/futures/futures.promise/uses_allocator.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/uses_allocator.pass.cpp index 458826e956e..9a1d41cc0cb 100644 --- a/libcxx/test/std/thread/futures/futures.promise/uses_allocator.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.promise/uses_allocator.pass.cpp @@ -18,7 +18,7 @@ // : true_type { }; #include <future> -#include "../test_allocator.h" +#include "test_allocator.h" int main() { |

