5 // Copyright (c) 2003-2019 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/ip/host_name.hpp>
19 #include "../unit_test.hpp"
21 //------------------------------------------------------------------------------
23 // ip_host_name_compile test
24 // ~~~~~~~~~~~~~~~~~~~~~~~~~
25 // The following test checks that all host_name functions compile and link
26 // correctly. Runtime failures are ignored.
28 namespace ip_host_name_compile {
32 using namespace boost::asio;
33 namespace ip = boost::asio::ip;
37 boost::system::error_code ec;
39 std::string host_name = ip::host_name();
40 std::string host_name2 = ip::host_name(ec);
42 catch (std::exception&)
47 } // namespace ip_host_name_compile
49 //------------------------------------------------------------------------------
54 BOOST_ASIO_TEST_CASE(ip_host_name_compile::test)