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:
Glen Fernandes
2015-11-09 22:35:34 -05:00
committed by Glen Fernandes
parent 821925c536
commit 8298952a12
13 changed files with 163 additions and 356 deletions

View File

@@ -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();
}