summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp')
-rw-r--r--3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp b/3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp
index 8826c937a9f..a8fdc4b2c19 100644
--- a/3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp
+++ b/3rdparty/asio/src/tests/unit/posix/stream_descriptor.cpp
@@ -2,7 +2,7 @@
// stream_descriptor.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)
@@ -55,6 +55,7 @@ void test()
char mutable_char_buffer[128] = "";
const char const_char_buffer[128] = "";
posix::descriptor_base::bytes_readable io_control_command;
+ archetypes::immediate_handler immediate;
archetypes::lazy_handler lazy;
asio::error_code ec;
@@ -66,16 +67,16 @@ void test()
posix::stream_descriptor descriptor3(ioc, native_descriptor1);
posix::stream_descriptor descriptor4(ioc_ex, native_descriptor1);
-#if defined(ASIO_HAS_MOVE)
posix::stream_descriptor descriptor5(std::move(descriptor2));
-#endif // defined(ASIO_HAS_MOVE)
+
+ posix::basic_stream_descriptor<io_context::executor_type> descriptor6(ioc);
+ posix::stream_descriptor descriptor7(std::move(descriptor6));
// basic_stream_descriptor operators.
-#if defined(ASIO_HAS_MOVE)
descriptor1 = posix::stream_descriptor(ioc);
descriptor1 = std::move(descriptor2);
-#endif // defined(ASIO_HAS_MOVE)
+ descriptor1 = std::move(descriptor6);
// basic_io_object functions.
@@ -88,9 +89,9 @@ void test()
= descriptor1.lowest_layer();
(void)lowest_layer;
- const posix::stream_descriptor& descriptor6 = descriptor1;
+ const posix::stream_descriptor& descriptor8 = descriptor1;
const posix::stream_descriptor::lowest_layer_type& lowest_layer2
- = descriptor6.lowest_layer();
+ = descriptor8.lowest_layer();
(void)lowest_layer2;
int native_descriptor2 = -1;
@@ -130,6 +131,7 @@ void test()
descriptor1.wait(posix::descriptor_base::wait_write, ec);
descriptor1.async_wait(posix::descriptor_base::wait_read, &wait_handler);
+ descriptor1.async_wait(posix::descriptor_base::wait_read, immediate);
int i1 = descriptor1.async_wait(posix::descriptor_base::wait_write, lazy);
(void)i1;
@@ -148,6 +150,9 @@ void test()
write_some_handler);
descriptor1.async_write_some(null_buffers(),
write_some_handler);
+ descriptor1.async_write_some(buffer(mutable_char_buffer), immediate);
+ descriptor1.async_write_some(buffer(const_char_buffer), immediate);
+ descriptor1.async_write_some(null_buffers(), immediate);
int i2 = descriptor1.async_write_some(buffer(mutable_char_buffer), lazy);
(void)i2;
int i3 = descriptor1.async_write_some(buffer(const_char_buffer), lazy);
@@ -161,6 +166,8 @@ void test()
descriptor1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
descriptor1.async_read_some(null_buffers(), read_some_handler);
+ descriptor1.async_read_some(buffer(mutable_char_buffer), immediate);
+ descriptor1.async_read_some(null_buffers(), immediate);
int i5 = descriptor1.async_read_some(buffer(mutable_char_buffer), lazy);
(void)i5;
int i6 = descriptor1.async_read_some(null_buffers(), lazy);
@@ -179,5 +186,5 @@ void test()
ASIO_TEST_SUITE
(
"posix/stream_descriptor",
- ASIO_TEST_CASE(posix_stream_descriptor_compile::test)
+ ASIO_COMPILE_TEST_CASE(posix_stream_descriptor_compile::test)
)