]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/make_shared_array_value_test.cpp
185605d065610effb93f3e649559d4468ced5f8e
[ceph.git] / ceph / src / boost / libs / smart_ptr / test / make_shared_array_value_test.cpp
1 /*
2 (c) 2012-2015 Glen Joseph Fernandes
3 <glenjofe -at- gmail.com>
4
5 Distributed under the Boost Software
6 License, Version 1.0.
7 http://boost.org/LICENSE_1_0.txt
8 */
9 #include <boost/detail/lightweight_test.hpp>
10 #include <boost/smart_ptr/make_shared.hpp>
11
12 int main()
13 {
14 {
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);
20 }
21 {
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);
27 }
28 {
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);
34 }
35 {
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);
41 }
42 return boost::report_errors();
43 }