@@ -31,13 +31,25 @@ struct type
3131 int right;
3232};
3333
34+ // make_shared
35+
36+ using test_array_shared_ptr = std::shared_ptr<data_array<3 >>;
37+
38+ BOOST_AUTO_TEST_CASE (memory__make_shared__array_move__expected_values)
39+ {
40+ const test_array_shared_ptr ptr = make_shared<data_array<3 >>(data_array<3 >{ 1 , 2 , 3 });
41+ BOOST_REQUIRE_EQUAL (ptr->at (0 ), 1 );
42+ BOOST_REQUIRE_EQUAL (ptr->at (1 ), 2 );
43+ BOOST_REQUIRE_EQUAL (ptr->at (2 ), 3 );
44+ }
45+
3446// to_shared
3547
36- using test_array_shared_ptr = std::shared_ptr<const data_array<3 >>;
48+ using test_const_array_shared_ptr = std::shared_ptr<const data_array<3 >>;
3749
3850BOOST_AUTO_TEST_CASE (memory__to_shared1__array_default__default_values)
3951{
40- const test_array_shared_ptr ptr = to_shared<data_array<3 >>();
52+ const test_const_array_shared_ptr ptr = to_shared<data_array<3 >>();
4153 BOOST_REQUIRE_EQUAL (ptr->at (0 ), 0 );
4254 BOOST_REQUIRE_EQUAL (ptr->at (1 ), 0 );
4355 BOOST_REQUIRE_EQUAL (ptr->at (2 ), 0 );
@@ -46,15 +58,15 @@ BOOST_AUTO_TEST_CASE(memory__to_shared1__array_default__default_values)
4658BOOST_AUTO_TEST_CASE (memory__to_shared5__array_copy__expected_values)
4759{
4860 const data_array<3 > copy{ 1 , 2 , 3 };
49- const test_array_shared_ptr ptr = to_shared<data_array<3 >>(copy);
61+ const test_const_array_shared_ptr ptr = to_shared<data_array<3 >>(copy);
5062 BOOST_REQUIRE_EQUAL (ptr->at (0 ), 1 );
5163 BOOST_REQUIRE_EQUAL (ptr->at (1 ), 2 );
5264 BOOST_REQUIRE_EQUAL (ptr->at (2 ), 3 );
5365}
5466
5567BOOST_AUTO_TEST_CASE (memory__to_shared5__array_move__expected_values)
5668{
57- const test_array_shared_ptr ptr = to_shared<data_array<3 >>(data_array<3 >{ 1 , 2 , 3 });
69+ const test_const_array_shared_ptr ptr = to_shared<data_array<3 >>(data_array<3 >{ 1 , 2 , 3 });
5870 BOOST_REQUIRE_EQUAL (ptr->at (0 ), 1 );
5971 BOOST_REQUIRE_EQUAL (ptr->at (1 ), 2 );
6072 BOOST_REQUIRE_EQUAL (ptr->at (2 ), 3 );
0 commit comments