X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fimage_test.cc;h=59b35a96bb876c54331da85589b9f12fa3a3ac1b;hb=5a5324ed3a381a86dfe0a6e3932c1d58fdcd596f;hp=55fbb990774b8c2009eb1852c5e7fb5157341639;hpb=b67a3505b58ffd204ee1a2560be3026688be8f10;p=dcpomatic.git diff --git a/test/image_test.cc b/test/image_test.cc index 55fbb9907..59b35a96b 100644 --- a/test/image_test.cc +++ b/test/image_test.cc @@ -1,19 +1,20 @@ /* Copyright (C) 2012-2014 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with DCP-o-matic. If not, see . */ @@ -23,15 +24,17 @@ * @see test/make_black_test.cc, test/pixel_formats_test.cc */ -#include #include #include "lib/image.h" +#include +#include #include using std::string; using std::list; using std::cout; using boost::shared_ptr; +using boost::make_shared; BOOST_AUTO_TEST_CASE (aligned_image_test) { @@ -137,7 +140,7 @@ BOOST_AUTO_TEST_CASE (alpha_blend_test) { int const stride = 48 * 4; - shared_ptr A (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false)); + shared_ptr A = make_shared (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false); A->make_black (); uint8_t* a = A->data()[0]; @@ -150,7 +153,7 @@ BOOST_AUTO_TEST_CASE (alpha_blend_test) } } - shared_ptr B (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 48), true)); + shared_ptr B = make_shared (AV_PIX_FMT_RGBA, dcp::Size (48, 48), true); B->make_transparent (); uint8_t* b = B->data()[0]; @@ -191,7 +194,7 @@ BOOST_AUTO_TEST_CASE (merge_test1) { int const stride = 48 * 4; - shared_ptr A (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false)); + shared_ptr A = make_shared (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false); A->make_transparent (); uint8_t* a = A->data()[0]; @@ -216,7 +219,7 @@ BOOST_AUTO_TEST_CASE (merge_test1) /** Test merge (list) with two images */ BOOST_AUTO_TEST_CASE (merge_test2) { - shared_ptr A (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false)); + shared_ptr A = make_shared (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false); A->make_transparent (); uint8_t* a = A->data()[0]; for (int x = 0; x < 16; ++x) { @@ -226,7 +229,7 @@ BOOST_AUTO_TEST_CASE (merge_test2) a[x * 4 + 3] = 255; } - shared_ptr B (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false)); + shared_ptr B = make_shared (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false); B->make_transparent (); uint8_t* b = B->data()[0]; for (int x = 0; x < 16; ++x) {