]> git.proxmox.com Git - ceph.git/blob - ceph/src/Beast/test/core/handler_alloc.cpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / Beast / test / core / handler_alloc.cpp
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/handler_alloc.hpp>
10
11 #include <beast/unit_test/suite.hpp>
12 #include <vector>
13
14 namespace beast {
15
16 class handler_alloc_test : public beast::unit_test::suite
17 {
18 public:
19 struct handler
20 {
21 void
22 operator()() const
23 {
24 }
25 };
26
27 void
28 run() override
29 {
30 handler h;
31 handler h2;
32 handler_alloc<char, handler> a1{h};
33 handler_alloc<char, handler> a2{h2};
34 BEAST_EXPECT(a2 == a1);
35 auto a3 = a1;
36 BEAST_EXPECT(a3 == a1);
37 {
38 std::vector<char,
39 handler_alloc<char, handler>> v(a1);
40 v.reserve(32);
41 v.resize(10);
42 }
43 }
44 };
45
46 BEAST_DEFINE_TESTSUITE(handler_alloc,core,beast);
47
48 } // beast
49