]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/make_local_shared_array_value_test.cpp
2 Copyright 2017 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/config.hpp>
9 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
10 !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
11 #include <boost/core/lightweight_test.hpp>
12 #include <boost/smart_ptr/make_local_shared.hpp>
17 boost::local_shared_ptr
<int[]> result
=
18 boost::make_local_shared
<int[]>(4, 1);
19 BOOST_TEST(result
[0] == 1);
20 BOOST_TEST(result
[1] == 1);
21 BOOST_TEST(result
[2] == 1);
22 BOOST_TEST(result
[3] == 1);
25 boost::local_shared_ptr
<int[4]> result
=
26 boost::make_local_shared
<int[4]>(1);
27 BOOST_TEST(result
[0] == 1);
28 BOOST_TEST(result
[1] == 1);
29 BOOST_TEST(result
[2] == 1);
30 BOOST_TEST(result
[3] == 1);
33 boost::local_shared_ptr
<const int[]> result
=
34 boost::make_local_shared
<const int[]>(4, 1);
35 BOOST_TEST(result
[0] == 1);
36 BOOST_TEST(result
[1] == 1);
37 BOOST_TEST(result
[2] == 1);
38 BOOST_TEST(result
[3] == 1);
41 boost::local_shared_ptr
<const int[4]> result
=
42 boost::make_local_shared
<const int[4]>(1);
43 BOOST_TEST(result
[0] == 1);
44 BOOST_TEST(result
[1] == 1);
45 BOOST_TEST(result
[2] == 1);
46 BOOST_TEST(result
[3] == 1);
48 return boost::report_errors();