本文整理汇总了C++中ASIO_TEST_CASE函数的典型用法代码示例。如果您正苦于以下问题:C++ ASIO_TEST_CASE函数的具体用法?C++ ASIO_TEST_CASE怎么用?C++ ASIO_TEST_CASE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ASIO_TEST_CASE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: catch
socket1.write_some(buffer(mutable_char_buffer), ec);
socket1.write_some(buffer(const_char_buffer), ec);
socket1.write_some(null_buffers(), ec);
socket1.async_write_some(buffer(mutable_char_buffer), write_some_handler);
socket1.async_write_some(buffer(const_char_buffer), write_some_handler);
socket1.async_write_some(null_buffers(), write_some_handler);
socket1.read_some(buffer(mutable_char_buffer));
socket1.read_some(buffer(mutable_char_buffer), ec);
socket1.read_some(null_buffers(), ec);
socket1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
socket1.async_read_some(null_buffers(), read_some_handler);
}
catch (std::exception&)
{
}
#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
}
} // namespace local_stream_protocol_socket_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"local/stream_protocol",
ASIO_TEST_CASE(local_stream_protocol_socket_compile::test)
)
开发者ID:Dagarman,项目名称:mame,代码行数:30,代码来源:stream_protocol.cpp
示例2: buffer_copy
mv1.clear();
mv1.push_back(asio::buffer(dest_data, 7));
mv1.push_back(asio::buffer(dest_data) + 7);
cb1 = asio::buffer(source_data);
n = buffer_copy(mv1, cb1, 10);
ASIO_CHECK(n == 10);
ASIO_CHECK(memcmp(dest_data, source_data, n) == 0);
memset(dest_data, 0, sizeof(dest_data));
mv1.clear();
mv1.push_back(asio::buffer(dest_data, 7));
mv1.push_back(asio::buffer(dest_data) + 7);
cv1.clear();
cv1.push_back(asio::buffer(source_data, 8));
cv1.push_back(asio::buffer(source_data) + 8);
n = buffer_copy(mv1, cv1, 10);
ASIO_CHECK(n == 10);
ASIO_CHECK(memcmp(dest_data, source_data, n) == 0);
}
} // namespace buffer_copy_runtime
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"buffer",
ASIO_COMPILE_TEST_CASE(buffer_compile::test)
ASIO_TEST_CASE(buffer_copy_runtime::test)
)
开发者ID:Corvusoft,项目名称:asio-dependency,代码行数:30,代码来源:buffer.cpp
示例3: s2
dp::socket s2(io_context);
local::connect_pair(s1, s2);
dp::socket s3(io_context);
dp::socket s4(io_context);
ec1 = local::connect_pair(s3, s4, ec2);
sp::socket s5(io_context);
sp::socket s6(io_context);
local::connect_pair(s5, s6);
sp::socket s7(io_context);
sp::socket s8(io_context);
ec1 = local::connect_pair(s7, s8, ec2);
}
catch (std::exception&)
{
}
#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
}
} // namespace local_connect_pair_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"local/connect_pair",
ASIO_TEST_CASE(local_connect_pair_compile::test)
)
开发者ID:0xbda2d2f8,项目名称:asio,代码行数:30,代码来源:connect_pair.cpp
示例4: ASIO_CHECK
ASIO_CHECK(!enable_connection_aborted3.value());
ASIO_CHECK(!static_cast<bool>(enable_connection_aborted3));
ASIO_CHECK(!enable_connection_aborted3);
tcp_acceptor.set_option(enable_connection_aborted3, ec);
ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
socket_base::enable_connection_aborted enable_connection_aborted4;
tcp_acceptor.get_option(enable_connection_aborted4, ec);
ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
ASIO_CHECK(!enable_connection_aborted4.value());
ASIO_CHECK(!static_cast<bool>(enable_connection_aborted4));
ASIO_CHECK(!enable_connection_aborted4);
// bytes_readable class.
socket_base::bytes_readable bytes_readable;
udp_sock.io_control(bytes_readable, ec);
ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
}
} // namespace socket_base_runtime
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"socket_base",
ASIO_TEST_CASE(socket_base_compile::test)
ASIO_TEST_CASE(socket_base_runtime::test)
)
开发者ID:CPB9,项目名称:asio,代码行数:30,代码来源:socket_base.cpp
示例5: ASIO_TEST_CASE
//
// descriptor_base.cpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2016 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)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/posix/descriptor_base.hpp"
#include "../unit_test.hpp"
ASIO_TEST_SUITE
(
"posix/descriptor_base",
ASIO_TEST_CASE(null_test)
)
开发者ID:Dagarman,项目名称:mame,代码行数:25,代码来源:descriptor_base.cpp
示例6: test_error_code
test_error_code(asio::error::in_progress);
test_error_code(asio::error::interrupted);
test_error_code(asio::error::invalid_argument);
test_error_code(asio::error::message_size);
test_error_code(asio::error::network_down);
test_error_code(asio::error::network_reset);
test_error_code(asio::error::network_unreachable);
test_error_code(asio::error::no_descriptors);
test_error_code(asio::error::no_buffer_space);
test_error_code(asio::error::no_data);
test_error_code(asio::error::no_memory);
test_error_code(asio::error::no_permission);
test_error_code(asio::error::no_protocol_option);
test_error_code(asio::error::no_recovery);
test_error_code(asio::error::not_connected);
test_error_code(asio::error::not_socket);
test_error_code(asio::error::operation_aborted);
test_error_code(asio::error::operation_not_supported);
test_error_code(asio::error::service_not_found);
test_error_code(asio::error::shut_down);
test_error_code(asio::error::timed_out);
test_error_code(asio::error::try_again);
test_error_code(asio::error::would_block);
}
ASIO_TEST_SUITE
(
"error",
ASIO_TEST_CASE(error_test)
)
开发者ID:FromPointer,项目名称:asio,代码行数:30,代码来源:error.cpp
示例7: catch
socket1.write_some(null_buffers());
socket1.write_some(buffer(mutable_char_buffer), ec);
socket1.write_some(buffer(const_char_buffer), ec);
socket1.write_some(null_buffers(), ec);
socket1.async_write_some(buffer(mutable_char_buffer), write_some_handler);
socket1.async_write_some(buffer(const_char_buffer), write_some_handler);
socket1.async_write_some(null_buffers(), write_some_handler);
socket1.read_some(buffer(mutable_char_buffer));
socket1.read_some(buffer(mutable_char_buffer), ec);
socket1.read_some(null_buffers(), ec);
socket1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
socket1.async_read_some(null_buffers(), read_some_handler);
}
catch (std::exception&)
{
}
}
} // namespace generic_stream_protocol_socket_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"generic/stream_protocol",
ASIO_TEST_CASE(generic_stream_protocol_socket_compile::test)
)
开发者ID:Endofunctor,项目名称:noobwerkz-engine,代码行数:30,代码来源:stream_protocol.cpp
示例8: ASIO_CHECK
ASIO_CHECK(!static_cast<bool>(v6_only3));
ASIO_CHECK(!v6_only3);
ip::v6_only v6_only4(true);
ASIO_CHECK(v6_only4.value());
ASIO_CHECK(static_cast<bool>(v6_only4));
ASIO_CHECK(!!v6_only4);
acceptor_v6.set_option(v6_only4, ec);
ASIO_CHECK(!ec);
ip::v6_only v6_only5;
acceptor_v6.get_option(v6_only5, ec);
ASIO_CHECK(!ec);
ASIO_CHECK(v6_only5.value());
ASIO_CHECK(static_cast<bool>(v6_only5));
ASIO_CHECK(!!v6_only5);
}
}
}
} // namespace ip_v6_only_runtime
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"ip/v6_only",
ASIO_TEST_CASE(ip_v6_only_compile::test)
ASIO_TEST_CASE(ip_v6_only_runtime::test)
)
开发者ID:cypherpunkengineering,项目名称:asio,代码行数:30,代码来源:v6_only.cpp
示例9: catch
socket1.receive_from(null_buffers(), endpoint);
socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags);
socket1.receive_from(null_buffers(), endpoint, in_flags);
socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags, ec);
socket1.receive_from(null_buffers(), endpoint, in_flags, ec);
socket1.async_receive_from(buffer(mutable_char_buffer),
endpoint, receive_handler);
socket1.async_receive_from(null_buffers(),
endpoint, receive_handler);
socket1.async_receive_from(buffer(mutable_char_buffer),
endpoint, in_flags, receive_handler);
socket1.async_receive_from(null_buffers(),
endpoint, in_flags, receive_handler);
}
catch (std::exception&)
{
}
#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
}
} // namespace local_datagram_protocol_socket_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"local/datagram_protocol",
ASIO_TEST_CASE(local_datagram_protocol_socket_compile::test)
)
开发者ID:chriskohlhoff,项目名称:asio,代码行数:30,代码来源:datagram_protocol.cpp
示例10: catch
b = (addr1 <= addr2);
(void)b;
b = (addr1 >= addr2);
(void)b;
// address I/O.
std::ostringstream os;
os << addr1;
#if !defined(BOOST_NO_STD_WSTREAMBUF)
std::wostringstream wos;
wos << addr1;
#endif // !defined(BOOST_NO_STD_WSTREAMBUF)
}
catch (std::exception&)
{
}
}
} // namespace ip_address_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"ip/address",
ASIO_TEST_CASE(ip_address_compile::test)
)
开发者ID:FromPointer,项目名称:asio,代码行数:30,代码来源:address.cpp
示例11: ASIO_CHECK
ASIO_CHECK(sb.size() == 1);
char buf[1];
sb.sgetn(buf, 1);
ASIO_CHECK(sb.size() == 0);
sb.sputn("ab", 2);
ASIO_CHECK(sb.size() == 2);
asio::buffer_copy(sb.prepare(10), asio::buffer("cd", 2));
sb.commit(2);
ASIO_CHECK(sb.size() == 4);
}
ASIO_CHECK(sb.size() == 4);
sb.consume(4);
ASIO_CHECK(sb.size() == 0);
}
ASIO_TEST_SUITE
(
"streambuf",
ASIO_TEST_CASE(streambuf_test)
)
开发者ID:FromPointer,项目名称:asio,代码行数:29,代码来源:streambuf.cpp
示例12: catch
set1.add(1);
set1.add(1, ec);
set1.remove(1);
set1.remove(1, ec);
set1.clear();
set1.clear(ec);
set1.cancel();
set1.cancel(ec);
set1.async_wait(&signal_handler);
int i = set1.async_wait(lazy);
(void)i;
}
catch (std::exception&)
{
}
}
} // namespace signal_set_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"signal_set",
ASIO_TEST_CASE(signal_set_compile::test)
)
开发者ID:Isaaccs5512,项目名称:isaac,代码行数:30,代码来源:signal_set.cpp
示例13: catch
bi11 = (-1) + bi11;
bi12 = (-1) + bi12;
(void)static_cast<std::ptrdiff_t>(bi13 - bi1);
(void)static_cast<std::ptrdiff_t>(bi14 - bi2);
(void)static_cast<std::ptrdiff_t>(bi15 - bi3);
(void)static_cast<std::ptrdiff_t>(bi16 - bi4);
(void)static_cast<std::ptrdiff_t>(bi17 - bi5);
(void)static_cast<std::ptrdiff_t>(bi18 - bi6);
(void)static_cast<std::ptrdiff_t>(bi19 - bi7);
(void)static_cast<std::ptrdiff_t>(bi20 - bi8);
(void)static_cast<std::ptrdiff_t>(bi21 - bi9);
(void)static_cast<std::ptrdiff_t>(bi22 - bi10);
(void)static_cast<std::ptrdiff_t>(bi23 - bi11);
(void)static_cast<std::ptrdiff_t>(bi24 - bi12);
}
catch (std::exception&)
{
}
}
} // namespace buffers_iterator_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"buffers_iterator",
ASIO_TEST_CASE(buffers_iterator_compile::test)
)
开发者ID:0xbda2d2f8,项目名称:asio,代码行数:30,代码来源:buffers_iterator.cpp
示例14: catch
= handle1.native_handle();
(void)native_handle3;
handle1.cancel();
handle1.cancel(ec);
// basic_object_handle functions.
handle1.wait();
handle1.wait(ec);
handle1.async_wait(&wait_handler);
int i1 = handle1.async_wait(lazy);
(void)i1;
}
catch (std::exception&)
{
}
#endif // defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE)
}
} // namespace windows_object_handle_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"windows/object_handle",
ASIO_TEST_CASE(windows_object_handle_compile::test)
)
开发者ID:Dagarman,项目名称:mame,代码行数:30,代码来源:object_handle.cpp
示例15: catch
socket1.async_send(null_buffers(), in_flags, send_handler);
socket1.receive(buffer(mutable_char_buffer), out_flags);
socket1.receive(null_buffers(), out_flags);
socket1.receive(buffer(mutable_char_buffer), in_flags, out_flags);
socket1.receive(null_buffers(), in_flags, out_flags);
socket1.receive(buffer(mutable_char_buffer), in_flags, out_flags, ec);
socket1.receive(null_buffers(), in_flags, out_flags, ec);
socket1.async_receive(buffer(mutable_char_buffer), out_flags,
receive_handler);
socket1.async_receive(null_buffers(), out_flags, receive_handler);
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
out_flags, receive_handler);
socket1.async_receive(null_buffers(), in_flags, out_flags, receive_handler);
}
catch (std::exception&)
{
}
}
} // namespace generic_seq_packet_protocol_socket_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"generic/seq_packet_protocol",
ASIO_TEST_CASE(generic_seq_packet_protocol_socket_compile::test)
)
开发者ID:CPB9,项目名称:asio,代码行数:30,代码来源:seq_packet_protocol.cpp
示例16: ASIO_CHECK
ASIO_CHECK(net15.network() == address_v6::from_string("2001:0db8::"));
// iterator
//ASIO_CHECK(std::distance(net12.hosts().begin(),net12.hosts().end()) == 18446744073709552000);
ASIO_CHECK(std::distance(net13.hosts().begin(),net13.hosts().end()) == 2);
ASIO_CHECK(std::distance(net14.hosts().begin(),net14.hosts().end()) == 8);
ASIO_CHECK(std::distance(net15.hosts().begin(),net15.hosts().end()) == 512);
ASIO_CHECK(*net12.hosts().begin() == address_v6::from_string("2001:0370::"));
ASIO_CHECK(net12.hosts().end() != net12.hosts().find(address_v6::from_string("2001:0370::ffff:ffff:ffff:ffff")));
ASIO_CHECK(*net13.hosts().begin() == address_v6::from_string("2001:0db8::"));
ASIO_CHECK(net13.hosts().end() != net13.hosts().find(address_v6::from_string("2001:0db8::1")));
ASIO_CHECK(net13.hosts().end() == net13.hosts().find(address_v6::from_string("2001:0db8::2")));
ASIO_CHECK(*net14.hosts().begin() == address_v6::from_string("2001:0db8::"));
ASIO_CHECK(net14.hosts().end() != net14.hosts().find(address_v6::from_string("2001:0db8::7")));
ASIO_CHECK(net14.hosts().end() == net14.hosts().find(address_v6::from_string("2001:0db8::8")));
ASIO_CHECK(*net15.hosts().begin() == address_v6::from_string("2001:0db8::"));
ASIO_CHECK(net15.hosts().end() != net15.hosts().find(address_v6::from_string("2001:0db8::01ff")));
ASIO_CHECK(net15.hosts().end() == net15.hosts().find(address_v6::from_string("2001:0db8::0200")));
}
} // namespace ip_network_v6_runtime
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"ip/network_v6",
ASIO_TEST_CASE(ip_network_v6_compile::test)
ASIO_TEST_CASE(ip_network_v6_runtime::test)
)
开发者ID:CPB9,项目名称:asio,代码行数:30,代码来源:network_v6.cpp
示例17: ASIO_CHECK
ASIO_CHECK(!mcast_link_local_address.is_multicast_org_local());
ASIO_CHECK(!mcast_node_local_address.is_multicast_org_local());
ASIO_CHECK(mcast_org_local_address.is_multicast_org_local());
ASIO_CHECK(!mcast_site_local_address.is_multicast_org_local());
ASIO_CHECK(!unspecified_address.is_multicast_site_local());
ASIO_CHECK(!loopback_address.is_multicast_site_local());
ASIO_CHECK(!link_local_address.is_multicast_site_local());
ASIO_CHECK(!site_local_address.is_multicast_site_local());
ASIO_CHECK(!v4_mapped_address.is_multicast_site_local());
ASIO_CHECK(!v4_compat_address.is_multicast_site_local());
ASIO_CHECK(!mcast_global_address.is_multicast_site_local());
ASIO_CHECK(!mcast_link_local_address.is_multicast_site_local());
ASIO_CHECK(!mcast_node_local_address.is_multicast_site_local());
ASIO_CHECK(!mcast_org_local_address.is_multicast_site_local());
ASIO_CHECK(mcast_site_local_address.is_multicast_site_local());
ASIO_CHECK(address_v6::loopback().is_loopback());
}
} // namespace ip_address_v6_runtime
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"ip/address_v6",
ASIO_TEST_CASE(ip_address_v6_compile::test)
ASIO_TEST_CASE(ip_address_v6_runtime::test)
)
开发者ID:cypherpunkengineering,项目名称:asio,代码行数:30,代码来源:address_v6.cpp
示例18: resolve_handler
(void)iter4;
resolver.async_resolve(q, resolve_handler());
int i1 = resolver.async_resolve(q, lazy);
(void)i1;
resolver.async_resolve(e, resolve_handler());
int i2 = resolver.async_resolve(e, lazy);
(void)i2;
}
catch (std::exception&)
{
}
}
} // namespace ip_tcp_resolver_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"ip/tcp",
ASIO_TEST_CASE(ip_tcp_compile::test)
ASIO_TEST_CASE(ip_tcp_runtime::test)
ASIO_TEST_CASE(ip_tcp_socket_compile::test)
ASIO_TEST_CASE(ip_tcp_socket_runtime::test)
ASIO_TEST_CASE(ip_tcp_acceptor_compile::test)
ASIO_TEST_CASE(ip_tcp_acceptor_runtime::test)
ASIO_TEST_CASE(ip_tcp_resolver_compile::test)
)
开发者ID:Endofunctor,项目名称:noobwerkz-engine,代码行数:30,代码来源:tcp.cpp
示例19: catch
socket1.receive_from(buffer(mutable_char_buffer), endpoint);
socket1.receive_from(null_buffers(), endpoint);
socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags);
socket1.receive_from(null_buffers(), endpoint, in_flags);
socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags, ec);
socket1.receive_from(null_buffers(), endpoint, in_flags, ec);
socket1.async_receive_from(buffer(mutable_char_buffer),
endpoint, receive_handler);
socket1.async_receive_from(null_buffers(),
endpoint, receive_handler);
socket1.async_receive_from(buffer(mutable_char_buffer),
endpoint, in_flags, receive_handler);
socket1.async_receive_from(null_buffers(),
endpoint, in_flags, receive_handler);
}
catch (std::exception&)
{
}
}
} // namespace generic_raw_protocol_socket_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"generic/raw_protocol",
ASIO_TEST_CASE(generic_raw_protocol_socket_compile::test)
)
开发者ID:FromPointer,项目名称:asio,代码行数:30,代码来源:raw_protocol.cpp
示例20: ptr4
OVERLAPPED* ov1 = ptr1.get();
(void)ov1;
const win::overlapped_ptr& ptr4(ptr1);
const OVERLAPPED* ov2 = ptr4.get();
(void)ov2;
OVERLAPPED* ov3 = ptr1.release();
(void)ov3;
asio::error_code ec;
std::size_t bytes_transferred = 0;
ptr1.complete(ec, bytes_transferred);
}
catch (std::exception&)
{
}
#endif // defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
}
} // namespace windows_overlapped_ptr_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"windows/overlapped_ptr",
ASIO_TEST_CASE(windows_overlapped_ptr_compile::test)
)
开发者ID:0xbda2d2f8,项目名称:asio,代码行数:29,代码来源:overlapped_ptr.cpp
注:本文中的ASIO_TEST_CASE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论