]>
Commit | Line | Data |
---|---|---|
92f5a8d4 TL |
1 | // |
2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) | |
3 | // | |
4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | // | |
7 | // Official repository: https://github.com/boostorg/beast | |
8 | // | |
9 | ||
10 | // Test that header file is self-contained. | |
11 | #include <boost/beast/core/net::make_strand.hpp> | |
12 | ||
13 | #include <boost/beast/_experimental/unit_test/suite.hpp> | |
14 | #include <boost/asio/executor.hpp> | |
15 | #include <boost/asio/io_context.hpp> | |
16 | ||
17 | namespace boost { | |
18 | namespace beast { | |
19 | ||
20 | class make_strand_test : public beast::unit_test::suite | |
21 | { | |
22 | public: | |
23 | void | |
24 | testFunction() | |
25 | { | |
26 | net::io_context ioc; | |
27 | net::make_strand(ioc); | |
28 | net::make_strand(ioc.get_executor()); | |
29 | net::make_strand(net::make_strand(ioc)); | |
30 | ||
20effc67 | 31 | net::any_io_executor ex(ioc.get_executor()); |
92f5a8d4 TL |
32 | net::make_strand(ex); |
33 | ||
34 | // this *should-not* compile | |
35 | //net::make_strand(ex.context()); | |
36 | } | |
37 | ||
38 | void | |
39 | run() override | |
40 | { | |
41 | testFunction(); | |
42 | pass(); | |
43 | } | |
44 | }; | |
45 | ||
46 | BEAST_DEFINE_TESTSUITE(beast,core,net::make_strand); | |
47 | ||
48 | } // beast | |
49 | } // boost |