]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/quickbook/test/unit/cleanup_test.cpp
2 /*=============================================================================
3 Copyright (c) 2017 Daniel James
5 Use, modification and distribution is subject to the Boost Software
6 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
8 =============================================================================*/
11 #include <boost/core/lightweight_test.hpp>
12 #include "cleanup.hpp"
17 static std::vector
<int> destroyed
;
26 counted(int v
) : value(v
)
28 BOOST_TEST(value
!= -1);
32 counted(counted
const& x
) : value(x
.value
)
34 BOOST_TEST(value
!= -1);
40 BOOST_TEST(value
!= -1);
41 destroyed
.push_back(value
);
43 BOOST_TEST(count
> 0);
48 int counted::count
= 0;
49 std::vector
<int> counted::destroyed
;
57 BOOST_TEST(counted::count
== 0);
62 counted
& v1
= c
.add(new counted(1));
63 counted
& v2
= c
.add(new counted(2));
64 BOOST_TEST(v1
.value
== 1);
65 BOOST_TEST(v2
.value
== 2);
67 BOOST_TEST(counted::count
== 0);
68 BOOST_TEST(counted::destroyed
.size() == 2);
69 BOOST_TEST(counted::destroyed
[0] == 2);
70 BOOST_TEST(counted::destroyed
[1] == 1);
75 int& x
= c
.add(new int(10));
79 return boost::report_errors();