]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/make_shared_array_value_test.cpp
185605d065610effb93f3e649559d4468ced5f8e
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/detail/lightweight_test.hpp>
10 #include <boost/smart_ptr/make_shared.hpp>
15 boost::shared_ptr
<int[]> a1
= boost::make_shared
<int[]>(4, 1);
16 BOOST_TEST(a1
[0] == 1);
17 BOOST_TEST(a1
[1] == 1);
18 BOOST_TEST(a1
[2] == 1);
19 BOOST_TEST(a1
[3] == 1);
22 boost::shared_ptr
<int[4]> a1
= boost::make_shared
<int[4]>(1);
23 BOOST_TEST(a1
[0] == 1);
24 BOOST_TEST(a1
[1] == 1);
25 BOOST_TEST(a1
[2] == 1);
26 BOOST_TEST(a1
[3] == 1);
29 boost::shared_ptr
<const int[]> a1
= boost::make_shared
<const int[]>(4, 1);
30 BOOST_TEST(a1
[0] == 1);
31 BOOST_TEST(a1
[1] == 1);
32 BOOST_TEST(a1
[2] == 1);
33 BOOST_TEST(a1
[3] == 1);
36 boost::shared_ptr
<const int[4]> a1
= boost::make_shared
<const int[4]>(1);
37 BOOST_TEST(a1
[0] == 1);
38 BOOST_TEST(a1
[1] == 1);
39 BOOST_TEST(a1
[2] == 1);
40 BOOST_TEST(a1
[3] == 1);
42 return boost::report_errors();