]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/allocate_shared_array_throws_test.cpp
2 (c) 2012-2015 Glen Joseph Fernandes
3 <glenjofe -at- gmail.com>
5 Distributed under the Boost Software
7 http://boost.org/LICENSE_1_0.txt
9 #include <boost/core/lightweight_test.hpp>
10 #include <boost/smart_ptr/make_shared.hpp>
14 static unsigned int instances
;
26 type
& operator=(const type
&);
29 unsigned int type::instances
= 0;
34 boost::allocate_shared
<type
[]>(std::allocator
<type
>(), 6);
35 BOOST_ERROR("allocate_shared did not throw");
37 BOOST_TEST(type::instances
== 0);
40 boost::allocate_shared
<type
[][2]>(std::allocator
<type
>(), 3);
41 BOOST_ERROR("allocate_shared did not throw");
43 BOOST_TEST(type::instances
== 0);
46 boost::allocate_shared
<type
[6]>(std::allocator
<type
>());
47 BOOST_ERROR("allocate_shared did not throw");
49 BOOST_TEST(type::instances
== 0);
52 boost::allocate_shared
<type
[3][2]>(std::allocator
<type
>());
53 BOOST_ERROR("allocate_shared did not throw");
55 BOOST_TEST(type::instances
== 0);
58 boost::allocate_shared_noinit
<type
[]>(std::allocator
<type
>(), 6);
59 BOOST_ERROR("allocate_shared_noinit did not throw");
61 BOOST_TEST(type::instances
== 0);
64 boost::allocate_shared_noinit
<type
[][2]>(std::allocator
<type
>(), 3);
65 BOOST_ERROR("allocate_shared_noinit did not throw");
67 BOOST_TEST(type::instances
== 0);
70 boost::allocate_shared_noinit
<type
[6]>(std::allocator
<type
>());
71 BOOST_ERROR("allocate_shared_noinit did not throw");
73 BOOST_TEST(type::instances
== 0);
76 boost::allocate_shared_noinit
<type
[3][2]>(std::allocator
<type
>());
77 BOOST_ERROR("allocate_shared_noinit did not throw");
79 BOOST_TEST(type::instances
== 0);
81 return boost::report_errors();