当前位置: 首页>>代码示例>>C++>>正文


C++ BOOST_ASIO_TEST_CASE函数代码示例

本文整理汇总了C++中BOOST_ASIO_TEST_CASE函数的典型用法代码示例。如果您正苦于以下问题:C++ BOOST_ASIO_TEST_CASE函数的具体用法?C++ BOOST_ASIO_TEST_CASE怎么用?C++ BOOST_ASIO_TEST_CASE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了BOOST_ASIO_TEST_CASE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: buffer

        buffer(mutable_char_buffer), lazy);
    (void)i1;
    int i2 = handle1.async_write_some_at(offset,
        buffer(const_char_buffer), lazy);
    (void)i2;

    handle1.read_some_at(offset, buffer(mutable_char_buffer));
    handle1.read_some_at(offset, buffer(mutable_char_buffer), ec);

    handle1.async_read_some_at(offset,
        buffer(mutable_char_buffer), &read_some_handler);
    int i3 = handle1.async_read_some_at(offset,
        buffer(mutable_char_buffer), lazy);
    (void)i3;
  }
  catch (std::exception&)
  {
  }
#endif // defined(BOOST_ASIO_HAS_WINDOWS_RANDOM_ACCESS_HANDLE)
}

} // namespace windows_random_access_handle_compile

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "windows/random_access_handle",
  BOOST_ASIO_TEST_CASE(windows_random_access_handle_compile::test)
)
开发者ID:LancelotGHX,项目名称:Simula,代码行数:30,代码来源:random_access_handle.cpp

示例2: BOOST_ASIO_CHECK

      BOOST_ASIO_CHECK(!static_cast<bool>(v6_only3));
      BOOST_ASIO_CHECK(!v6_only3);

      ip::v6_only v6_only4(true);
      BOOST_ASIO_CHECK(v6_only4.value());
      BOOST_ASIO_CHECK(static_cast<bool>(v6_only4));
      BOOST_ASIO_CHECK(!!v6_only4);
      acceptor_v6.set_option(v6_only4, ec);
      BOOST_ASIO_CHECK(!ec);

      ip::v6_only v6_only5;
      acceptor_v6.get_option(v6_only5, ec);
      BOOST_ASIO_CHECK(!ec);
      BOOST_ASIO_CHECK(v6_only5.value());
      BOOST_ASIO_CHECK(static_cast<bool>(v6_only5));
      BOOST_ASIO_CHECK(!!v6_only5);
    }
  }
}

} // namespace ip_v6_only_runtime

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "ip/v6_only",
  BOOST_ASIO_TEST_CASE(ip_v6_only_compile::test)
  BOOST_ASIO_TEST_CASE(ip_v6_only_runtime::test)
)
开发者ID:OggYiu,项目名称:rag-engine,代码行数:30,代码来源:v6_only.cpp

示例3: 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;

    boost::system::error_code ec;
    std::size_t bytes_transferred = 0;
    ptr1.complete(ec, bytes_transferred);
  }
  catch (std::exception&)
  {
  }
#endif // defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
}

} // namespace windows_overlapped_ptr_compile

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "windows/overlapped_ptr",
  BOOST_ASIO_TEST_CASE(windows_overlapped_ptr_compile::test)
)
开发者ID:AlexMioMio,项目名称:boost,代码行数:29,代码来源:overlapped_ptr.cpp

示例4: test_error_code

  test_error_code(boost::asio::error::in_progress);
  test_error_code(boost::asio::error::interrupted);
  test_error_code(boost::asio::error::invalid_argument);
  test_error_code(boost::asio::error::message_size);
  test_error_code(boost::asio::error::network_down);
  test_error_code(boost::asio::error::network_reset);
  test_error_code(boost::asio::error::network_unreachable);
  test_error_code(boost::asio::error::no_descriptors);
  test_error_code(boost::asio::error::no_buffer_space);
  test_error_code(boost::asio::error::no_data);
  test_error_code(boost::asio::error::no_memory);
  test_error_code(boost::asio::error::no_permission);
  test_error_code(boost::asio::error::no_protocol_option);
  test_error_code(boost::asio::error::no_recovery);
  test_error_code(boost::asio::error::not_connected);
  test_error_code(boost::asio::error::not_socket);
  test_error_code(boost::asio::error::operation_aborted);
  test_error_code(boost::asio::error::operation_not_supported);
  test_error_code(boost::asio::error::service_not_found);
  test_error_code(boost::asio::error::shut_down);
  test_error_code(boost::asio::error::timed_out);
  test_error_code(boost::asio::error::try_again);
  test_error_code(boost::asio::error::would_block);
}

BOOST_ASIO_TEST_SUITE
(
  "error",
  BOOST_ASIO_TEST_CASE(error_test)
)
开发者ID:boostorg,项目名称:asio,代码行数:30,代码来源:error.cpp

示例5: BOOST_ASIO_CHECK

  BOOST_ASIO_CHECK(net14.netmask() == make_address_v4("255.255.255.240"));
  // broadcast
  BOOST_ASIO_CHECK(net12.broadcast() == make_address_v4("192.168.0.255"));
  BOOST_ASIO_CHECK(net13.broadcast() == make_address_v4("192.168.1.15"));
  BOOST_ASIO_CHECK(net14.broadcast() == make_address_v4("192.168.1.31"));
  // iterator
  BOOST_ASIO_CHECK(std::distance(net12.hosts().begin(),net12.hosts().end()) == 254);
  BOOST_ASIO_CHECK(*net12.hosts().begin() == make_address_v4("192.168.0.1"));
  BOOST_ASIO_CHECK(net12.hosts().end() != net12.hosts().find(make_address_v4("192.168.0.10")));
  BOOST_ASIO_CHECK(net12.hosts().end() == net12.hosts().find(make_address_v4("192.168.1.10")));
  BOOST_ASIO_CHECK(std::distance(net13.hosts().begin(),net13.hosts().end()) == 14);
  BOOST_ASIO_CHECK(*net13.hosts().begin() == make_address_v4("192.168.1.1"));
  BOOST_ASIO_CHECK(net13.hosts().end() != net13.hosts().find(make_address_v4("192.168.1.14")));
  BOOST_ASIO_CHECK(net13.hosts().end() == net13.hosts().find(make_address_v4("192.168.1.15")));
  BOOST_ASIO_CHECK(std::distance(net14.hosts().begin(),net14.hosts().end()) == 14);
  BOOST_ASIO_CHECK(*net14.hosts().begin() == make_address_v4("192.168.1.17"));
  BOOST_ASIO_CHECK(net14.hosts().end() != net14.hosts().find(make_address_v4("192.168.1.30")));
  BOOST_ASIO_CHECK(net14.hosts().end() == net14.hosts().find(make_address_v4("192.168.1.31")));
}

} // namespace ip_network_v4_runtime

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "ip/network_v4",
  BOOST_ASIO_TEST_CASE(ip_network_v4_compile::test)
  BOOST_ASIO_TEST_CASE(ip_network_v4_runtime::test)
)
开发者ID:arvidn,项目名称:asio,代码行数:30,代码来源:network_v4.cpp

示例6: BOOST_ASIO_TEST_CASE

//
// generic/basic_endpoint.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2013 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 <boost/asio/generic/basic_endpoint.hpp>

#include "../unit_test.hpp"

BOOST_ASIO_TEST_SUITE
(
  "generic/basic_endpoint",
  BOOST_ASIO_TEST_CASE(null_test)
)
开发者ID:avasopht,项目名称:boost_1_55_0-llvm,代码行数:25,代码来源:basic_endpoint.cpp

示例7: BOOST_ASIO_CHECK

    BOOST_ASIO_CHECK(sb.size() == 1);

    char buf[1];
    sb.sgetn(buf, 1);

    BOOST_ASIO_CHECK(sb.size() == 0);

    sb.sputn("ab", 2);

    BOOST_ASIO_CHECK(sb.size() == 2);

    boost::asio::buffer_copy(sb.prepare(10), boost::asio::buffer("cd", 2));
    sb.commit(2);

    BOOST_ASIO_CHECK(sb.size() == 4);
  }

  BOOST_ASIO_CHECK(sb.size() == 4);

  sb.consume(4);

  BOOST_ASIO_CHECK(sb.size() == 0);
}

BOOST_ASIO_TEST_SUITE
(
  "streambuf",
  BOOST_ASIO_TEST_CASE(streambuf_test)
)
开发者ID:LancelotGHX,项目名称:Simula,代码行数:29,代码来源:streambuf.cpp

示例8: BOOST_ASIO_CHECK

  BOOST_ASIO_CHECK(!static_cast<bool>(enable_connection_aborted4));
  BOOST_ASIO_CHECK(!enable_connection_aborted4);

  // non_blocking_io class.

  socket_base::non_blocking_io non_blocking_io1(true);
  tcp_sock.io_control(non_blocking_io1, ec);
  BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());

  socket_base::non_blocking_io non_blocking_io2(false);
  tcp_sock.io_control(non_blocking_io2, ec);
  BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());

  // bytes_readable class.

  socket_base::bytes_readable bytes_readable;
  udp_sock.io_control(bytes_readable, ec);
  BOOST_ASIO_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
}

} // namespace socket_base_runtime

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "socket_base",
  BOOST_ASIO_TEST_CASE(socket_base_compile::test)
  BOOST_ASIO_TEST_CASE(socket_base_runtime::test)
)
开发者ID:OggYiu,项目名称:rag-engine,代码行数:30,代码来源:socket_base.cpp

示例9: 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

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "buffers_iterator",
  BOOST_ASIO_TEST_CASE(buffers_iterator_compile::test)
)
开发者ID:AbhinavJain13,项目名称:turicreate,代码行数:30,代码来源:buffers_iterator.cpp

示例10: 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

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "generic/seq_packet_protocol",
  BOOST_ASIO_TEST_CASE(generic_seq_packet_protocol_socket_compile::test)
)
开发者ID:eriser,项目名称:boost,代码行数:30,代码来源:seq_packet_protocol.cpp

示例11: defined

    stream1.read_some(buffer(mutable_char_buffer), ec);

    stream1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
    int i10 = stream1.async_read_some(buffer(mutable_char_buffer), lazy);
    (void)i10;

#if defined(BOOST_ASIO_ENABLE_OLD_SSL)
    stream1.peek(buffer(mutable_char_buffer));
    stream1.peek(buffer(mutable_char_buffer), ec);

    std::size_t in_avail1 = stream1.in_avail();
    (void)in_avail1;
    std::size_t in_avail2 = stream1.in_avail(ec);
    (void)in_avail2;
#endif // defined(BOOST_ASIO_ENABLE_OLD_SSL)
  }
  catch (std::exception&)
  {
  }
}

} // namespace ssl_stream_compile

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "ssl/stream",
  BOOST_ASIO_TEST_CASE(ssl_stream_compile::test)
)
开发者ID:AlexMioMio,项目名称:boost,代码行数:30,代码来源:stream.cpp

示例12: catch

    (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

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "ip/tcp",
  BOOST_ASIO_TEST_CASE(ip_tcp_compile::test)
  BOOST_ASIO_TEST_CASE(ip_tcp_runtime::test)
  BOOST_ASIO_TEST_CASE(ip_tcp_socket_compile::test)
  BOOST_ASIO_TEST_CASE(ip_tcp_socket_runtime::test)
  BOOST_ASIO_TEST_CASE(ip_tcp_acceptor_compile::test)
  BOOST_ASIO_TEST_CASE(ip_tcp_acceptor_runtime::test)
  BOOST_ASIO_TEST_CASE(ip_tcp_resolver_compile::test)
)
开发者ID:OggYiu,项目名称:rag-engine,代码行数:30,代码来源:tcp.cpp

示例13: 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(BOOST_ASIO_HAS_LOCAL_SOCKETS)
}

} // namespace local_stream_protocol_socket_compile

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "local/stream_protocol",
  BOOST_ASIO_TEST_CASE(local_stream_protocol_socket_compile::test)
)
开发者ID:arvidn,项目名称:asio,代码行数:30,代码来源:stream_protocol.cpp

示例14: test

// correctly. Runtime failures are ignored.

namespace ip_host_name_compile {

void test()
{
  using namespace boost::asio;
  namespace ip = boost::asio::ip;

  try
  {
    boost::system::error_code ec;

    std::string host_name = ip::host_name();
    std::string host_name2 = ip::host_name(ec);
  }
  catch (std::exception&)
  {
  }
}

} // namespace ip_host_name_compile

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "ip/host_name",
  BOOST_ASIO_TEST_CASE(ip_host_name_compile::test)
)
开发者ID:boostorg,项目名称:asio,代码行数:30,代码来源:host_name.cpp

示例15: s2

    dp::socket s2(io_service);
    local::connect_pair(s1, s2);

    dp::socket s3(io_service);
    dp::socket s4(io_service);
    ec1 = local::connect_pair(s3, s4, ec2);

    sp::socket s5(io_service);
    sp::socket s6(io_service);
    local::connect_pair(s5, s6);

    sp::socket s7(io_service);
    sp::socket s8(io_service);
    ec1 = local::connect_pair(s7, s8, ec2);
  }
  catch (std::exception&)
  {
  }
#endif // defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
}

} // namespace local_connect_pair_compile

//------------------------------------------------------------------------------

BOOST_ASIO_TEST_SUITE
(
  "local/connect_pair",
  BOOST_ASIO_TEST_CASE(local_connect_pair_compile::test)
)
开发者ID:OggYiu,项目名称:rag-engine,代码行数:30,代码来源:connect_pair.cpp


注:本文中的BOOST_ASIO_TEST_CASE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。