mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-10-17 09:55:24 +02:00
Update unit tests for make_shared/allocate_shared for arrays
Before pending refactor of make_shared and allocate_shared for arrays.
This commit is contained in:
committed by
Glen Fernandes
parent
821925c536
commit
8298952a12
@@ -6,10 +6,11 @@
|
||||
* Version 1.0. (See accompanying file LICENSE_1_0.txt
|
||||
* or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared_array.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
int main() {
|
||||
int main()
|
||||
{
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
|
||||
{
|
||||
boost::shared_ptr<int[][2]> a1 = boost::make_shared<int[][2]>(2, {0, 1});
|
||||
@@ -18,7 +19,6 @@ int main() {
|
||||
BOOST_TEST(a1[1][0] == 0);
|
||||
BOOST_TEST(a1[1][1] == 1);
|
||||
}
|
||||
|
||||
{
|
||||
boost::shared_ptr<int[2][2]> a1 = boost::make_shared<int[2][2]>({ 0, 1 });
|
||||
BOOST_TEST(a1[0][0] == 0);
|
||||
@@ -26,7 +26,6 @@ int main() {
|
||||
BOOST_TEST(a1[1][0] == 0);
|
||||
BOOST_TEST(a1[1][1] == 1);
|
||||
}
|
||||
|
||||
{
|
||||
boost::shared_ptr<const int[][2]> a1 = boost::make_shared<const int[][2]>(2, { 0, 1 });
|
||||
BOOST_TEST(a1[0][0] == 0);
|
||||
@@ -34,7 +33,6 @@ int main() {
|
||||
BOOST_TEST(a1[1][0] == 0);
|
||||
BOOST_TEST(a1[1][1] == 1);
|
||||
}
|
||||
|
||||
{
|
||||
boost::shared_ptr<const int[2][2]> a1 = boost::make_shared<const int[2][2]>({ 0, 1 });
|
||||
BOOST_TEST(a1[0][0] == 0);
|
||||
@@ -43,6 +41,5 @@ int main() {
|
||||
BOOST_TEST(a1[1][1] == 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
Reference in New Issue
Block a user