]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/test/signal_set.cpp
f04f194d5cabb24e9ee8bf3422351d024aad2f3b
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/signal_set.hpp>
19 #include "archetypes/async_result.hpp"
20 #include <boost/asio/io_context.hpp>
21 #include "unit_test.hpp"
23 //------------------------------------------------------------------------------
25 // signal_set_compile test
26 // ~~~~~~~~~~~~~~~~~~~~~~~
27 // The following test checks that all public member functions on the class
28 // signal_set compile and link correctly. Runtime failures are ignored.
30 namespace signal_set_compile
{
32 void signal_handler(const boost::system::error_code
&, int)
38 using namespace boost::asio
;
43 archetypes::lazy_handler lazy
;
44 boost::system::error_code ec
;
46 // basic_signal_set constructors.
49 signal_set
set2(ioc
, 1);
50 signal_set
set3(ioc
, 1, 2);
51 signal_set
set4(ioc
, 1, 2, 3);
53 // basic_io_object functions.
55 signal_set::executor_type ex
= set1
.get_executor();
58 #if !defined(BOOST_ASIO_NO_DEPRECATED)
59 io_context
& ioc_ref
= set1
.get_io_context();
62 io_context
& ioc_ref2
= set1
.get_io_service();
64 #endif // !defined(BOOST_ASIO_NO_DEPRECATED)
66 // basic_signal_set functions.
80 set1
.async_wait(&signal_handler
);
81 int i
= set1
.async_wait(lazy
);
84 catch (std::exception
&)
89 } // namespace signal_set_compile
91 //------------------------------------------------------------------------------
96 BOOST_ASIO_TEST_CASE(signal_set_compile::test
)