summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp')
-rw-r--r--3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp b/3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp
index c4de03bc58b..587445b1f05 100644
--- a/3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp
+++ b/3rdparty/asio/src/tests/unit/generic/seq_packet_protocol.cpp
@@ -2,7 +2,7 @@
// generic/seq_packet_protocol.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)
@@ -19,6 +19,7 @@
#include <cstring>
#include "asio/io_context.hpp"
#include "../unit_test.hpp"
+#include "../archetypes/async_result.hpp"
#if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
# define generic cpp_generic
@@ -64,6 +65,7 @@ void test()
socket_base::message_flags out_flags = 0;
socket_base::send_buffer_size socket_option;
socket_base::bytes_readable io_control_command;
+ archetypes::immediate_handler immediate;
asio::error_code ec;
// basic_seq_packet_socket constructors.
@@ -77,16 +79,12 @@ void test()
spp::socket socket4(ioc, spp(af_inet, 0), native_socket1);
#endif // !defined(ASIO_WINDOWS_RUNTIME)
-#if defined(ASIO_HAS_MOVE)
spp::socket socket5(std::move(socket4));
-#endif // defined(ASIO_HAS_MOVE)
// basic_seq_packet_socket operators.
-#if defined(ASIO_HAS_MOVE)
socket1 = spp::socket(ioc);
socket1 = std::move(socket2);
-#endif // defined(ASIO_HAS_MOVE)
// basic_io_object functions.
@@ -139,6 +137,7 @@ void test()
socket1.connect(spp::endpoint(), ec);
socket1.async_connect(spp::endpoint(), connect_handler);
+ socket1.async_connect(spp::endpoint(), immediate);
socket1.set_option(socket_option);
socket1.set_option(socket_option, ec);
@@ -174,6 +173,9 @@ void test()
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
socket1.async_send(null_buffers(), in_flags, send_handler);
+ socket1.async_send(buffer(mutable_char_buffer), in_flags, immediate);
+ socket1.async_send(buffer(const_char_buffer), in_flags, immediate);
+ socket1.async_send(null_buffers(), in_flags, immediate);
socket1.receive(buffer(mutable_char_buffer), out_flags);
socket1.receive(null_buffers(), out_flags);
@@ -188,6 +190,11 @@ void test()
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
out_flags, receive_handler);
socket1.async_receive(null_buffers(), in_flags, out_flags, receive_handler);
+ socket1.async_receive(buffer(mutable_char_buffer), out_flags, immediate);
+ socket1.async_receive(null_buffers(), out_flags, immediate);
+ socket1.async_receive(buffer(mutable_char_buffer), in_flags,
+ out_flags, immediate);
+ socket1.async_receive(null_buffers(), in_flags, out_flags, immediate);
}
catch (std::exception&)
{
@@ -201,5 +208,5 @@ void test()
ASIO_TEST_SUITE
(
"generic/seq_packet_protocol",
- ASIO_TEST_CASE(generic_seq_packet_protocol_socket_compile::test)
+ ASIO_COMPILE_TEST_CASE(generic_seq_packet_protocol_socket_compile::test)
)