5 // Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 // Disable autolinking for unit tests.
12 #if !defined(BOOST_ALL_NO_LIB)
13 #define BOOST_ALL_NO_LIB 1
14 #endif // !defined(BOOST_ALL_NO_LIB)
16 // Test that header file is self-contained.
17 #include <boost/asio/local/connect_pair.hpp>
19 #include <boost/asio/io_service.hpp>
20 #include <boost/asio/local/datagram_protocol.hpp>
21 #include <boost/asio/local/stream_protocol.hpp>
22 #include "../unit_test.hpp"
24 //------------------------------------------------------------------------------
26 // local_connect_pair_compile test
27 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28 // The following test checks that all host_name functions compile and link
29 // correctly. Runtime failures are ignored.
31 namespace local_connect_pair_compile {
35 #if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
36 using namespace boost::asio;
37 namespace local = boost::asio::local;
38 typedef local::datagram_protocol dp;
39 typedef local::stream_protocol sp;
43 boost::asio::io_service io_service;
44 boost::system::error_code ec1;
45 boost::system::error_code ec2;
47 dp::socket s1(io_service);
48 dp::socket s2(io_service);
49 local::connect_pair(s1, s2);
51 dp::socket s3(io_service);
52 dp::socket s4(io_service);
53 ec1 = local::connect_pair(s3, s4, ec2);
55 sp::socket s5(io_service);
56 sp::socket s6(io_service);
57 local::connect_pair(s5, s6);
59 sp::socket s7(io_service);
60 sp::socket s8(io_service);
61 ec1 = local::connect_pair(s7, s8, ec2);
63 catch (std::exception&)
66 #endif // defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
69 } // namespace local_connect_pair_compile
71 //------------------------------------------------------------------------------
76 BOOST_ASIO_TEST_CASE(local_connect_pair_compile::test)