]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/make_shared_array_throws_test.cpp
2 Copyright 2012-2015 Glen Joseph Fernandes
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
8 #include <boost/detail/lightweight_test.hpp>
9 #include <boost/smart_ptr/make_shared.hpp>
13 static unsigned instances
;
28 type
& operator=(const type
&);
31 unsigned type::instances
= 0;
36 boost::make_shared
<type
[]>(6);
37 BOOST_ERROR("make_shared did not throw");
39 BOOST_TEST(type::instances
== 0);
42 boost::make_shared
<type
[][2]>(3);
43 BOOST_ERROR("make_shared did not throw");
45 BOOST_TEST(type::instances
== 0);
48 boost::make_shared
<type
[6]>();
49 BOOST_ERROR("make_shared did not throw");
51 BOOST_TEST(type::instances
== 0);
54 boost::make_shared
<type
[3][2]>();
55 BOOST_ERROR("make_shared did not throw");
57 BOOST_TEST(type::instances
== 0);
60 boost::make_shared_noinit
<type
[]>(6);
61 BOOST_ERROR("make_shared_noinit did not throw");
63 BOOST_TEST(type::instances
== 0);
66 boost::make_shared_noinit
<type
[][2]>(3);
67 BOOST_ERROR("make_shared_noinit did not throw");
69 BOOST_TEST(type::instances
== 0);
72 boost::make_shared_noinit
<type
[6]>();
73 BOOST_ERROR("make_shared_noinit did not throw");
75 BOOST_TEST(type::instances
== 0);
78 boost::make_shared_noinit
<type
[3][2]>();
79 BOOST_ERROR("make_shared_noinit did not throw");
81 BOOST_TEST(type::instances
== 0);
83 return boost::report_errors();