]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // |
2 | // Copyright (c) 2013-2017 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 | ||
8 | // Test that header file is self-contained. | |
9 | #include <beast/core/bind_handler.hpp> | |
10 | ||
11 | #include <beast/unit_test/suite.hpp> | |
12 | #include <functional> | |
13 | ||
14 | namespace beast { | |
15 | ||
16 | class bind_handler_test : public unit_test::suite | |
17 | { | |
18 | public: | |
19 | void | |
20 | callback(int v) | |
21 | { | |
22 | BEAST_EXPECT(v == 42); | |
23 | } | |
24 | ||
25 | void run() | |
26 | { | |
27 | auto f = bind_handler(std::bind( | |
28 | &bind_handler_test::callback, this, | |
29 | std::placeholders::_1), 42); | |
30 | f(); | |
31 | pass(); | |
32 | } | |
33 | }; | |
34 | ||
35 | BEAST_DEFINE_TESTSUITE(bind_handler,core,beast); | |
36 | ||
37 | } // beast |