5 // Copyright (c) 2003-2017 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_context.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_context io_context
;
44 boost::system::error_code ec1
;
46 dp::socket
s1(io_context
);
47 dp::socket
s2(io_context
);
48 local::connect_pair(s1
, s2
);
50 dp::socket
s3(io_context
);
51 dp::socket
s4(io_context
);
52 local::connect_pair(s3
, s4
, ec1
);
54 sp::socket
s5(io_context
);
55 sp::socket
s6(io_context
);
56 local::connect_pair(s5
, s6
);
58 sp::socket
s7(io_context
);
59 sp::socket
s8(io_context
);
60 local::connect_pair(s7
, s8
, ec1
);
62 catch (std::exception
&)
65 #endif // defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
68 } // namespace local_connect_pair_compile
70 //------------------------------------------------------------------------------
75 BOOST_ASIO_TEST_CASE(local_connect_pair_compile::test
)