summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/asio/src/tests/unit/read.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/asio/src/tests/unit/read.cpp')
-rw-r--r--3rdparty/asio/src/tests/unit/read.cpp76
1 files changed, 6 insertions, 70 deletions
diff --git a/3rdparty/asio/src/tests/unit/read.cpp b/3rdparty/asio/src/tests/unit/read.cpp
index bd0e9592ca9..a268c041d9b 100644
--- a/3rdparty/asio/src/tests/unit/read.cpp
+++ b/3rdparty/asio/src/tests/unit/read.cpp
@@ -2,7 +2,7 @@
// read.cpp
// ~~~~~~~~
//
-// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,9 @@
// Test that header file is self-contained.
#include "asio/read.hpp"
+#include <array>
#include <cstring>
+#include <functional>
#include <vector>
#include "archetypes/async_result.hpp"
#include "asio/io_context.hpp"
@@ -24,20 +26,10 @@
#include "asio/streambuf.hpp"
#include "unit_test.hpp"
-#if defined(ASIO_HAS_BOOST_BIND)
-# include <boost/bind/bind.hpp>
-#else // defined(ASIO_HAS_BOOST_BIND)
-# include <functional>
-#endif // defined(ASIO_HAS_BOOST_BIND)
-
#if defined(ASIO_HAS_BOOST_ARRAY)
#include <boost/array.hpp>
#endif // defined(ASIO_HAS_BOOST_ARRAY)
-#if defined(ASIO_HAS_STD_ARRAY)
-# include <array>
-#endif // defined(ASIO_HAS_STD_ARRAY)
-
using namespace std; // For memcmp, memcpy and memset.
class test_stream
@@ -53,7 +45,7 @@ public:
{
}
- executor_type get_executor() ASIO_NOEXCEPT
+ executor_type get_executor() noexcept
{
return io_context_.get_executor();
}
@@ -121,12 +113,12 @@ public:
template <typename Mutable_Buffers, typename Handler>
void async_read_some(const Mutable_Buffers& buffers,
- ASIO_MOVE_ARG(Handler) handler)
+ Handler&& handler)
{
size_t bytes_transferred = read_some(buffers);
asio::post(get_executor(),
asio::detail::bind_handler(
- ASIO_MOVE_CAST(Handler)(handler),
+ static_cast<Handler&&>(handler),
asio::error_code(), bytes_transferred));
}
@@ -439,11 +431,7 @@ bool old_style_transfer_all(const asio::error_code& ec,
struct short_transfer
{
short_transfer() {}
-#if defined(ASIO_HAS_MOVE)
short_transfer(short_transfer&&) {}
-#else // defined(ASIO_HAS_MOVE)
- short_transfer(const short_transfer&) {}
-#endif // defined(ASIO_HAS_MOVE)
size_t operator()(const asio::error_code& ec,
size_t /*bytes_transferred*/)
{
@@ -2475,11 +2463,7 @@ void async_read_handler(const asio::error_code& e,
void test_3_arg_mutable_buffer_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2535,11 +2519,7 @@ void test_3_arg_mutable_buffer_async_read()
void test_3_arg_boost_array_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2598,15 +2578,10 @@ void test_3_arg_boost_array_buffers_async_read()
void test_3_arg_std_array_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
-#if defined(ASIO_HAS_STD_ARRAY)
asio::io_context ioc;
test_stream s(ioc);
char read_buf[sizeof(read_data)];
@@ -2656,16 +2631,11 @@ void test_3_arg_std_array_buffers_async_read()
ioc.restart();
ioc.run();
ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
-#endif // defined(ASIO_HAS_STD_ARRAY)
}
void test_3_arg_vector_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2723,11 +2693,7 @@ void test_3_arg_vector_buffers_async_read()
void test_3_arg_dynamic_string_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2789,11 +2755,7 @@ void test_3_arg_dynamic_string_async_read()
void test_3_arg_streambuf_async_read()
{
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -2852,11 +2814,7 @@ void test_3_arg_streambuf_async_read()
void test_4_arg_mutable_buffer_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3193,11 +3151,7 @@ void test_4_arg_mutable_buffer_async_read()
void test_4_arg_boost_array_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -3537,15 +3491,10 @@ void test_4_arg_boost_array_buffers_async_read()
void test_4_arg_std_array_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
-#if defined(ASIO_HAS_STD_ARRAY)
asio::io_context ioc;
test_stream s(ioc);
char read_buf[sizeof(read_data)];
@@ -3876,16 +3825,11 @@ void test_4_arg_std_array_buffers_async_read()
ioc.restart();
ioc.run();
ASIO_CHECK(s.check_buffers(buffers, sizeof(read_data)));
-#endif // defined(ASIO_HAS_STD_ARRAY)
}
void test_4_arg_vector_buffers_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -4224,11 +4168,7 @@ void test_4_arg_vector_buffers_async_read()
void test_4_arg_dynamic_string_async_read()
{
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;
@@ -4595,11 +4535,7 @@ void test_4_arg_dynamic_string_async_read()
void test_4_arg_streambuf_async_read()
{
#if !defined(ASIO_NO_DYNAMIC_BUFFER_V1)
-#if defined(ASIO_HAS_BOOST_BIND)
- namespace bindns = boost;
-#else // defined(ASIO_HAS_BOOST_BIND)
namespace bindns = std;
-#endif // defined(ASIO_HAS_BOOST_BIND)
using bindns::placeholders::_1;
using bindns::placeholders::_2;