MCPcopy Create free account
hub / github.com/boostorg/asio / test

Function test

test/windows/random_access_handle.cpp:41–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void test()
42{
43#if defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
44 using namespace boost::asio;
45 namespace win = boost::asio::windows;
46
47 try
48 {
49 io_context ioc;
50 const io_context::executor_type ioc_ex = ioc.get_executor();
51 char mutable_char_buffer[128] = "";
52 const char const_char_buffer[128] = "";
53 boost::asio::uint64_t offset = 0;
54 archetypes::lazy_handler lazy;
55 boost::system::error_code ec;
56
57 // basic_random_access_handle constructors.
58
59 win::random_access_handle handle1(ioc);
60 HANDLE native_handle1 = INVALID_HANDLE_VALUE;
61#if defined(BOOST_ASIO_MSVC) && (_MSC_VER < 1910)
62 // Skip this on older MSVC due to mysterious ambiguous overload errors.
63#else
64 win::random_access_handle handle2(ioc, native_handle1);
65#endif
66
67 win::random_access_handle handle3(ioc_ex);
68 HANDLE native_handle2 = INVALID_HANDLE_VALUE;
69 win::random_access_handle handle4(ioc_ex, native_handle2);
70
71 win::random_access_handle handle5(std::move(handle4));
72
73 win::basic_random_access_handle<io_context::executor_type> handle6(ioc);
74 win::random_access_handle handle7(std::move(handle6));
75
76 // basic_random_access_handle operators.
77
78 handle1 = win::random_access_handle(ioc);
79 handle1 = std::move(handle4);
80 handle1 = std::move(handle6);
81
82 // I/O object functions.
83
84 windows::random_access_handle::executor_type ex = handle1.get_executor();
85 (void)ex;
86
87 // basic_overlapped_handle functions.
88
89 win::random_access_handle::lowest_layer_type& lowest_layer
90 = handle1.lowest_layer();
91 (void)lowest_layer;
92
93 const win::random_access_handle& handle8 = handle1;
94 const win::random_access_handle::lowest_layer_type& lowest_layer2
95 = handle8.lowest_layer();
96 (void)lowest_layer2;
97
98 HANDLE native_handle3 = INVALID_HANDLE_VALUE;

Callers

nothing calls this directly

Calls 12

bufferFunction · 0.85
get_executorMethod · 0.45
assignMethod · 0.45
is_openMethod · 0.45
closeMethod · 0.45
releaseMethod · 0.45
native_handleMethod · 0.45
cancelMethod · 0.45
write_some_atMethod · 0.45
async_write_some_atMethod · 0.45
read_some_atMethod · 0.45
async_read_some_atMethod · 0.45

Tested by

no test coverage detected