summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-21 01:14:06 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-21 01:14:06 +0100
commit5a5324ed3a381a86dfe0a6e3932c1d58fdcd596f (patch)
tree769dca1358e35017ce5a5b3ab2dfafe2b24d61ed /test
parent4e83acad0c2a5c528709a175a80261b8147d3b49 (diff)
Use make_shared<>.
Diffstat (limited to 'test')
-rw-r--r--test/4k_test.cc6
-rw-r--r--test/audio_analysis_test.cc18
-rw-r--r--test/audio_decoder_test.cc4
-rw-r--r--test/audio_delay_test.cc18
-rw-r--r--test/audio_filter_test.cc8
-rw-r--r--test/audio_processor_delay_test.cc8
-rw-r--r--test/audio_processor_test.cc6
-rw-r--r--test/black_fill_test.cc8
-rw-r--r--test/burnt_subtitle_test.cc4
-rw-r--r--test/client_server_test.cc27
-rw-r--r--test/colour_conversion_test.cc4
-rw-r--r--test/dcp_subtitle_test.cc10
-rw-r--r--test/ffmpeg_audio_only_test.cc6
-rw-r--r--test/ffmpeg_audio_test.cc4
-rw-r--r--test/ffmpeg_dcp_test.cc12
-rw-r--r--test/ffmpeg_decoder_seek_test.cc8
-rw-r--r--test/ffmpeg_decoder_sequential_test.cc8
-rw-r--r--test/ffmpeg_examiner_test.cc8
-rw-r--r--test/ffmpeg_pts_offset_test.cc7
-rw-r--r--test/film_metadata_test.cc10
-rw-r--r--test/frame_rate_test.cc14
-rw-r--r--test/image_test.cc14
-rw-r--r--test/import_dcp_test.cc8
-rw-r--r--test/interrupt_encoder_test.cc4
-rw-r--r--test/isdcf_name_test.cc6
-rw-r--r--test/job_test.cc6
-rw-r--r--test/make_black_test.cc6
-rw-r--r--test/play_test.cc6
-rw-r--r--test/player_test.cc18
-rw-r--r--test/recover_test.cc14
-rw-r--r--test/reels_test.cc20
-rw-r--r--test/repeat_frame_test.cc6
-rw-r--r--test/resampler_test.cc6
-rw-r--r--test/scaling_test.cc6
-rw-r--r--test/seek_zero_test.cc6
-rw-r--r--test/silence_padding_test.cc4
-rw-r--r--test/skip_frame_test.cc6
-rw-r--r--test/srt_subtitle_test.cc12
-rw-r--r--test/ssa_subtitle_test.cc4
-rw-r--r--test/test.cc4
-rw-r--r--test/threed_test.cc4
-rw-r--r--test/time_calculation_test.cc24
-rw-r--r--test/upmixer_a_test.cc10
-rw-r--r--test/vf_test.cc6
-rw-r--r--test/video_content_scale_test.cc8
-rw-r--r--test/video_decoder_fill_test.cc8
-rw-r--r--test/video_mxf_content_test.cc6
-rw-r--r--test/xml_subtitle_test.cc8
48 files changed, 261 insertions, 167 deletions
diff --git a/test/4k_test.cc b/test/4k_test.cc
index 033796ab2..c5418e9dd 100644
--- a/test/4k_test.cc
+++ b/test/4k_test.cc
@@ -24,21 +24,23 @@
* The output is checked against test/data/4k_test.
*/
-#include <boost/test/unit_test.hpp>
#include "lib/film.h"
#include "lib/ffmpeg_content.h"
#include "lib/dcp_content_type.h"
#include "lib/video_content.h"
#include "lib/ratio.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (fourk_test)
{
shared_ptr<Film> film = new_test_film ("4k_test");
film->set_name ("4k_test");
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->set_resolution (RESOLUTION_4K);
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
film->set_container (Ratio::from_id ("185"));
diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc
index 5923e0698..9fd928281 100644
--- a/test/audio_analysis_test.cc
+++ b/test/audio_analysis_test.cc
@@ -22,7 +22,6 @@
* @brief Check audio analysis code.
*/
-#include <boost/test/unit_test.hpp>
#include "lib/audio_analysis.h"
#include "lib/analyse_audio_job.h"
#include "lib/film.h"
@@ -33,8 +32,11 @@
#include "lib/job_manager.h"
#include "lib/audio_content.h"
#include "test.h"
+#include <boost/make_shared.hpp>
+#include <boost/test/unit_test.hpp>
using boost::shared_ptr;
+using boost::make_shared;
static float
random_float ()
@@ -97,11 +99,11 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test)
film->set_name ("audio_analysis_test");
boost::filesystem::path p = private_data / "betty_L.wav";
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, p));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, p);
film->examine_and_add_content (c);
wait_for_jobs ();
- shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, film->playlist ()));
+ shared_ptr<AnalyseAudioJob> job = make_shared<AnalyseAudioJob> (film, film->playlist ());
job->Finished.connect (boost::bind (&finished));
JobManager::instance()->add (job);
wait_for_jobs ();
@@ -112,13 +114,13 @@ BOOST_AUTO_TEST_CASE (audio_analysis_negative_delay_test)
{
shared_ptr<Film> film = new_test_film ("audio_analysis_negative_delay_test");
film->set_name ("audio_analysis_negative_delay_test");
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, private_data / "boon_telly.mkv"));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, private_data / "boon_telly.mkv");
film->examine_and_add_content (c);
wait_for_jobs ();
c->audio->set_delay (-250);
- shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, film->playlist ()));
+ shared_ptr<AnalyseAudioJob> job = make_shared<AnalyseAudioJob> (film, film->playlist ());
job->Finished.connect (boost::bind (&finished));
JobManager::instance()->add (job);
wait_for_jobs ();
@@ -129,11 +131,11 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test2)
{
shared_ptr<Film> film = new_test_film ("audio_analysis_test2");
film->set_name ("audio_analysis_test2");
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, private_data / "3d_thx_broadway_2010_lossless.m2ts"));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, private_data / "3d_thx_broadway_2010_lossless.m2ts");
film->examine_and_add_content (c);
wait_for_jobs ();
- shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, film->playlist ()));
+ shared_ptr<AnalyseAudioJob> job = make_shared<AnalyseAudioJob> (film, film->playlist ());
job->Finished.connect (boost::bind (&finished));
JobManager::instance()->add (job);
wait_for_jobs ();
@@ -158,7 +160,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test3)
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/white.wav"));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, "test/data/white.wav");
film->examine_and_add_content (content);
wait_for_jobs ();
diff --git a/test/audio_decoder_test.cc b/test/audio_decoder_test.cc
index 945773d12..92c99a378 100644
--- a/test/audio_decoder_test.cc
+++ b/test/audio_decoder_test.cc
@@ -28,6 +28,7 @@
#include "lib/audio_content.h"
#include "lib/film.h"
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
#include <cassert>
#include <iostream>
@@ -35,6 +36,7 @@ using std::string;
using std::cout;
using std::min;
using boost::shared_ptr;
+using boost::make_shared;
class TestAudioContent : public Content
{
@@ -76,7 +78,7 @@ public:
_test_audio_content->audio_length() - _position
);
- shared_ptr<AudioBuffers> buffers (new AudioBuffers (_test_audio_content->audio->stream()->channels(), N));
+ shared_ptr<AudioBuffers> buffers = make_shared<AudioBuffers> (_test_audio_content->audio->stream()->channels(), N);
for (int i = 0; i < _test_audio_content->audio->stream()->channels(); ++i) {
for (int j = 0; j < N; ++j) {
buffers->data(i)[j] = j + _position;
diff --git a/test/audio_delay_test.cc b/test/audio_delay_test.cc
index 1d2d171db..a87c3016e 100644
--- a/test/audio_delay_test.cc
+++ b/test/audio_delay_test.cc
@@ -24,25 +24,27 @@
* The output is checked algorithmically using knowledge of the input.
*/
-#include <boost/test/unit_test.hpp>
-#include <dcp/sound_frame.h>
-#include <dcp/cpl.h>
-#include <dcp/reel.h>
-#include <dcp/sound_asset.h>
-#include <dcp/sound_asset_reader.h>
-#include <dcp/reel_sound_asset.h>
#include "lib/ffmpeg_content.h"
#include "lib/dcp_content_type.h"
#include "lib/ratio.h"
#include "lib/film.h"
#include "lib/audio_content.h"
#include "test.h"
+#include <dcp/sound_frame.h>
+#include <dcp/cpl.h>
+#include <dcp/reel.h>
+#include <dcp/sound_asset.h>
+#include <dcp/sound_asset_reader.h>
+#include <dcp/reel_sound_asset.h>
+#include <boost/make_shared.hpp>
+#include <boost/test/unit_test.hpp>
#include <iostream>
using std::string;
using std::cout;
using boost::lexical_cast;
using boost::shared_ptr;
+using boost::make_shared;
static
void test_audio_delay (int delay_in_ms)
@@ -55,7 +57,7 @@ void test_audio_delay (int delay_in_ms)
film->set_container (Ratio::from_id ("185"));
film->set_name (film_name);
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/staircase.wav"));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, "test/data/staircase.wav");
film->examine_and_add_content (content);
wait_for_jobs ();
content->audio->set_delay (delay_in_ms);
diff --git a/test/audio_filter_test.cc b/test/audio_filter_test.cc
index b92d005a5..0ad91ddde 100644
--- a/test/audio_filter_test.cc
+++ b/test/audio_filter_test.cc
@@ -22,11 +22,13 @@
* @brief Basic tests of audio filters.
*/
-#include <boost/test/unit_test.hpp>
#include "lib/audio_filter.h"
#include "lib/audio_buffers.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
static void
audio_filter_impulse_test_one (AudioFilter& f, int block_size, int num_blocks)
@@ -35,7 +37,7 @@ audio_filter_impulse_test_one (AudioFilter& f, int block_size, int num_blocks)
for (int i = 0; i < num_blocks; ++i) {
- shared_ptr<AudioBuffers> in (new AudioBuffers (1, block_size));
+ shared_ptr<AudioBuffers> in = make_shared<AudioBuffers> (1, block_size);
for (int j = 0; j < block_size; ++j) {
in->data()[0][j] = c + j;
}
@@ -76,7 +78,7 @@ BOOST_AUTO_TEST_CASE (audio_filter_impulse_input_test)
{
LowPassAudioFilter lpf (0.02, 0.3);
- shared_ptr<AudioBuffers> in (new AudioBuffers (1, 1751));
+ shared_ptr<AudioBuffers> in = make_shared<AudioBuffers> (1, 1751);
in->make_silent ();
in->data(0)[0] = 1;
diff --git a/test/audio_processor_delay_test.cc b/test/audio_processor_delay_test.cc
index 78f8e6895..9fc2d7242 100644
--- a/test/audio_processor_delay_test.cc
+++ b/test/audio_processor_delay_test.cc
@@ -21,12 +21,14 @@
#include "lib/audio_delay.h"
#include "lib/audio_buffers.h"
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
#include <cmath>
#include <iostream>
using std::cerr;
using std::cout;
using boost::shared_ptr;
+using boost::make_shared;
#define CHECK_SAMPLE(c,f,r) \
if (fabs(out->data(c)[f] - (r)) > 0.1) { \
@@ -41,7 +43,7 @@ BOOST_AUTO_TEST_CASE (audio_processor_delay_test1)
int const C = 2;
- shared_ptr<AudioBuffers> in (new AudioBuffers (C, 256));
+ shared_ptr<AudioBuffers> in = make_shared<AudioBuffers> (C, 256);
for (int i = 0; i < C; ++i) {
for (int j = 0; j < 256; ++j) {
in->data(i)[j] = j;
@@ -91,7 +93,7 @@ BOOST_AUTO_TEST_CASE (audio_processor_delay_test2)
/* Feeding 4 blocks of 64 should give silence each time */
for (int i = 0; i < 4; ++i) {
- shared_ptr<AudioBuffers> in (new AudioBuffers (C, 64));
+ shared_ptr<AudioBuffers> in = make_shared<AudioBuffers> (C, 64);
for (int j = 0; j < C; ++j) {
for (int k = 0; k < 64; ++k) {
in->data(j)[k] = k + i * 64;
@@ -112,7 +114,7 @@ BOOST_AUTO_TEST_CASE (audio_processor_delay_test2)
/* Now feed 4 blocks of silence and we should see the data */
for (int i = 0; i < 4; ++i) {
/* Feed some silence */
- shared_ptr<AudioBuffers> in (new AudioBuffers (C, 64));
+ shared_ptr<AudioBuffers> in = make_shared<AudioBuffers> (C, 64);
in->make_silent ();
shared_ptr<AudioBuffers> out = delay.run (in);
diff --git a/test/audio_processor_test.cc b/test/audio_processor_test.cc
index 8357cff78..97d2cd759 100644
--- a/test/audio_processor_test.cc
+++ b/test/audio_processor_test.cc
@@ -26,15 +26,17 @@
#include "lib/film.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
/** Test the mid-side decoder for analysis and DCP-making */
BOOST_AUTO_TEST_CASE (audio_processor_test)
{
shared_ptr<Film> film = new_test_film ("audio_processor_test");
film->set_name ("audio_processor_test");
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/white.wav"));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, "test/data/white.wav");
film->examine_and_add_content (c);
wait_for_jobs ();
@@ -43,7 +45,7 @@ BOOST_AUTO_TEST_CASE (audio_processor_test)
film->set_audio_processor (AudioProcessor::from_id ("mid-side-decoder"));
/* Analyse the audio and check it doesn't crash */
- shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, film->playlist ()));
+ shared_ptr<AnalyseAudioJob> job = make_shared<AnalyseAudioJob> (film, film->playlist ());
JobManager::instance()->add (job);
wait_for_jobs ();
diff --git a/test/black_fill_test.cc b/test/black_fill_test.cc
index 79b97ad77..77ee90848 100644
--- a/test/black_fill_test.cc
+++ b/test/black_fill_test.cc
@@ -18,19 +18,21 @@
*/
-#include <boost/test/unit_test.hpp>
#include "lib/image_content.h"
#include "lib/dcp_content_type.h"
#include "lib/film.h"
#include "lib/ratio.h"
#include "lib/video_content.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
/** @file test/black_fill_test.cc
* @brief Test insertion of black frames between separate bits of video content.
*/
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (black_fill_test)
{
@@ -39,8 +41,8 @@ BOOST_AUTO_TEST_CASE (black_fill_test)
film->set_name ("black_fill_test");
film->set_container (Ratio::from_id ("185"));
film->set_sequence (false);
- shared_ptr<ImageContent> contentA (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
- shared_ptr<ImageContent> contentB (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
+ shared_ptr<ImageContent> contentA = make_shared<ImageContent> (film, "test/data/simple_testcard_640x480.png");
+ shared_ptr<ImageContent> contentB = make_shared<ImageContent> (film, "test/data/simple_testcard_640x480.png");
film->examine_and_add_content (contentA);
film->examine_and_add_content (contentB);
diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc
index d7ccbc659..71758e012 100644
--- a/test/burnt_subtitle_test.cc
+++ b/test/burnt_subtitle_test.cc
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip)
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
- shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
+ shared_ptr<TextSubtitleContent> content = make_shared<TextSubtitleContent> (film, "test/data/subrip2.srt");
content->set_use_subtitles (true);
content->set_burn_subtitles (true);
film->examine_and_add_content (content, true);
@@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_dcp)
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
film->set_burn_subtitles (true);
- shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml"));
+ shared_ptr<DCPSubtitleContent> content = make_shared<DCPSubtitleContent> (film, "test/data/dcp_sub.xml");
content->set_use_subtitles (true);
film->examine_and_add_content (content, true);
wait_for_jobs ();
diff --git a/test/client_server_test.cc b/test/client_server_test.cc
index 1f77f7f90..68ef336a1 100644
--- a/test/client_server_test.cc
+++ b/test/client_server_test.cc
@@ -37,9 +37,11 @@
#include "lib/file_log.h"
#include <boost/test/unit_test.hpp>
#include <boost/thread.hpp>
+#include <boost/make_shared.hpp>
using std::list;
using boost::shared_ptr;
+using boost::make_shared;
using boost::thread;
using boost::optional;
using dcp::Data;
@@ -56,7 +58,7 @@ do_remote_encode (shared_ptr<DCPVideo> frame, EncodeServerDescription descriptio
BOOST_AUTO_TEST_CASE (client_server_test_rgb)
{
- shared_ptr<Image> image (new Image (AV_PIX_FMT_RGB24, dcp::Size (1998, 1080), true));
+ shared_ptr<Image> image = make_shared<Image> (AV_PIX_FMT_RGB24, dcp::Size (1998, 1080), true);
uint8_t* p = image->data()[0];
for (int y = 0; y < 1080; ++y) {
@@ -69,7 +71,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
p += image->stride()[0];
}
- shared_ptr<Image> sub_image (new Image (AV_PIX_FMT_RGBA, dcp::Size (100, 200), true));
+ shared_ptr<Image> sub_image = make_shared<Image> (AV_PIX_FMT_RGBA, dcp::Size (100, 200), true);
p = sub_image->data()[0];
for (int y = 0; y < 200; ++y) {
uint8_t* q = p;
@@ -82,11 +84,11 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
p += sub_image->stride()[0];
}
- shared_ptr<FileLog> log (new FileLog ("build/test/client_server_test_rgb.log"));
+ shared_ptr<FileLog> log = make_shared<FileLog> ("build/test/client_server_test_rgb.log");
shared_ptr<PlayerVideo> pvf (
new PlayerVideo (
- shared_ptr<ImageProxy> (new RawImageProxy (image)),
+ make_shared<RawImageProxy> (image),
DCPTime (),
Crop (),
optional<double> (),
@@ -140,7 +142,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
BOOST_AUTO_TEST_CASE (client_server_test_yuv)
{
- shared_ptr<Image> image (new Image (AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true));
+ shared_ptr<Image> image = make_shared<Image> (AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true);
for (int i = 0; i < image->planes(); ++i) {
uint8_t* p = image->data()[i];
@@ -149,7 +151,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
}
}
- shared_ptr<Image> sub_image (new Image (AV_PIX_FMT_RGBA, dcp::Size (100, 200), true));
+ shared_ptr<Image> sub_image = make_shared<Image> (AV_PIX_FMT_RGBA, dcp::Size (100, 200), true);
uint8_t* p = sub_image->data()[0];
for (int y = 0; y < 200; ++y) {
uint8_t* q = p;
@@ -162,11 +164,11 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
p += sub_image->stride()[0];
}
- shared_ptr<FileLog> log (new FileLog ("build/test/client_server_test_yuv.log"));
+ shared_ptr<FileLog> log = make_shared<FileLog> ("build/test/client_server_test_yuv.log");
shared_ptr<PlayerVideo> pvf (
new PlayerVideo (
- shared_ptr<ImageProxy> (new RawImageProxy (image)),
+ make_shared<RawImageProxy> (image),
DCPTime (),
Crop (),
optional<double> (),
@@ -220,7 +222,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
BOOST_AUTO_TEST_CASE (client_server_test_j2k)
{
- shared_ptr<Image> image (new Image (AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true));
+ shared_ptr<Image> image = make_shared<Image> (AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true);
for (int i = 0; i < image->planes(); ++i) {
uint8_t* p = image->data()[i];
@@ -229,11 +231,11 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
}
}
- shared_ptr<FileLog> log (new FileLog ("build/test/client_server_test_j2k.log"));
+ shared_ptr<FileLog> log = make_shared<FileLog> ("build/test/client_server_test_j2k.log");
shared_ptr<PlayerVideo> raw_pvf (
new PlayerVideo (
- shared_ptr<ImageProxy> (new RawImageProxy (image)),
+ make_shared<RawImageProxy> (image),
DCPTime (),
Crop (),
optional<double> (),
@@ -260,7 +262,8 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
shared_ptr<PlayerVideo> j2k_pvf (
new PlayerVideo (
- shared_ptr<ImageProxy> (new J2KImageProxy (raw_locally_encoded, dcp::Size (1998, 1080))),
+ /* This J2KImageProxy constructor is private, so no make_shared */
+ shared_ptr<J2KImageProxy> (new J2KImageProxy (raw_locally_encoded, dcp::Size (1998, 1080))),
DCPTime (),
Crop (),
optional<double> (),
diff --git a/test/colour_conversion_test.cc b/test/colour_conversion_test.cc
index 6c25e8ae3..00e830dad 100644
--- a/test/colour_conversion_test.cc
+++ b/test/colour_conversion_test.cc
@@ -29,10 +29,12 @@
#include <libxml++/libxml++.h>
#include <boost/test/unit_test.hpp>
#include <boost/foreach.hpp>
+#include <boost/make_shared.hpp>
#include <iostream>
using std::cout;
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (colour_conversion_test1)
{
@@ -109,7 +111,7 @@ BOOST_AUTO_TEST_CASE (colour_conversion_test4)
xmlpp::Document out;
xmlpp::Element* out_root = out.create_root_node ("Test");
i.conversion.as_xml (out_root);
- shared_ptr<cxml::Document> in (new cxml::Document ("Test"));
+ shared_ptr<cxml::Document> in = make_shared<cxml::Document> ("Test");
in->read_string (out.write_to_string ("UTF-8"));
BOOST_CHECK (ColourConversion::from_xml (in, Film::current_state_version).get () == i.conversion);
}
diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc
index ef733d370..85dea391f 100644
--- a/test/dcp_subtitle_test.cc
+++ b/test/dcp_subtitle_test.cc
@@ -22,7 +22,6 @@
* @brief Test DCP subtitle content in various ways.
*/
-#include <boost/test/unit_test.hpp>
#include "lib/film.h"
#include "lib/dcp_subtitle_content.h"
#include "lib/dcp_content.h"
@@ -33,11 +32,14 @@
#include "lib/content_subtitle.h"
#include "lib/subtitle_decoder.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
#include <iostream>
using std::cout;
using std::list;
using boost::shared_ptr;
+using boost::make_shared;
/** Test pass-through of a very simple DCP subtitle file */
BOOST_AUTO_TEST_CASE (dcp_subtitle_test)
@@ -46,7 +48,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test)
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
- shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml"));
+ shared_ptr<DCPSubtitleContent> content = make_shared<DCPSubtitleContent> (film, "test/data/dcp_sub.xml");
film->examine_and_add_content (content);
wait_for_jobs ();
@@ -67,11 +69,11 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test)
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
- shared_ptr<DCPContent> content (new DCPContent (film, private_data / "JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV"));
+ shared_ptr<DCPContent> content = make_shared<DCPContent> (film, private_data / "JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV");
film->examine_and_add_content (content);
wait_for_jobs ();
- shared_ptr<DCPDecoder> decoder (new DCPDecoder (content, film->log(), false));
+ shared_ptr<DCPDecoder> decoder = make_shared<DCPDecoder> (content, film->log(), false);
list<ContentTimePeriod> ctp = decoder->text_subtitles_during (
ContentTimePeriod (
diff --git a/test/ffmpeg_audio_only_test.cc b/test/ffmpeg_audio_only_test.cc
index bad800e57..2101e9774 100644
--- a/test/ffmpeg_audio_only_test.cc
+++ b/test/ffmpeg_audio_only_test.cc
@@ -27,8 +27,10 @@
#include "test.h"
#include <sndfile.h>
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
/** Test the FFmpeg code with audio-only content */
static void
@@ -37,7 +39,7 @@ test (boost::filesystem::path file)
shared_ptr<Film> film = new_test_film ("ffmpeg_audio_only_test");
film->set_name ("test_film");
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, file));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, file);
film->examine_and_add_content (c);
wait_for_jobs ();
film->write_metadata ();
@@ -56,7 +58,7 @@ test (boost::filesystem::path file)
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
float* ref_buffer = new float[info.samplerate * info.channels];
- shared_ptr<Player> player (new Player (film, film->playlist ()));
+ shared_ptr<Player> player = make_shared<Player> (film, film->playlist ());
for (DCPTime t; t < film->length(); t += DCPTime::from_seconds (1)) {
int const N = sf_readf_float (ref, ref_buffer, info.samplerate);
diff --git a/test/ffmpeg_audio_test.cc b/test/ffmpeg_audio_test.cc
index cfbaf46c3..07e6e0310 100644
--- a/test/ffmpeg_audio_test.cc
+++ b/test/ffmpeg_audio_test.cc
@@ -37,15 +37,17 @@
#include <dcp/sound_asset_reader.h>
#include <dcp/reel.h>
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using std::string;
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (ffmpeg_audio_test)
{
shared_ptr<Film> film = new_test_film ("ffmpeg_audio_test");
film->set_name ("ffmpeg_audio_test");
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/staircase.mov"));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, "test/data/staircase.mov");
film->examine_and_add_content (c);
wait_for_jobs ();
diff --git a/test/ffmpeg_dcp_test.cc b/test/ffmpeg_dcp_test.cc
index 18decee95..c69516b9f 100644
--- a/test/ffmpeg_dcp_test.cc
+++ b/test/ffmpeg_dcp_test.cc
@@ -24,23 +24,25 @@
* Also a quick test of Film::have_dcp ().
*/
-#include <boost/test/unit_test.hpp>
-#include <boost/filesystem.hpp>
-#include <boost/algorithm/string.hpp>
#include "lib/film.h"
#include "lib/ffmpeg_content.h"
#include "lib/ratio.h"
#include "lib/dcp_content_type.h"
#include "lib/video_content.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/algorithm/string.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (ffmpeg_dcp_test)
{
shared_ptr<Film> film = new_test_film ("ffmpeg_dcp_test");
film->set_name ("test_film2");
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->examine_and_add_content (c);
wait_for_jobs ();
@@ -59,7 +61,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_dcp_test)
BOOST_AUTO_TEST_CASE (ffmpeg_have_dcp_test)
{
boost::filesystem::path p = test_film_dir ("ffmpeg_dcp_test");
- shared_ptr<Film> film (new Film (p.string ()));
+ shared_ptr<Film> film = boost::make_shared<Film> (p.string ());
film->read_metadata ();
BOOST_CHECK (!film->cpls().empty());
diff --git a/test/ffmpeg_decoder_seek_test.cc b/test/ffmpeg_decoder_seek_test.cc
index 8a854b01b..5e310cd3c 100644
--- a/test/ffmpeg_decoder_seek_test.cc
+++ b/test/ffmpeg_decoder_seek_test.cc
@@ -35,12 +35,14 @@
#include "test.h"
#include <boost/test/unit_test.hpp>
#include <boost/filesystem.hpp>
+#include <boost/make_shared.hpp>
#include <vector>
using std::cerr;
using std::vector;
using std::list;
using boost::shared_ptr;
+using boost::make_shared;
using boost::optional;
static void
@@ -62,11 +64,11 @@ test (boost::filesystem::path file, vector<int> frames)
}
shared_ptr<Film> film = new_test_film ("ffmpeg_decoder_seek_test_" + file.string());
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, path));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, path);
film->examine_and_add_content (content);
wait_for_jobs ();
- shared_ptr<Log> log (new NullLog);
- shared_ptr<FFmpegDecoder> decoder (new FFmpegDecoder (content, log, false));
+ shared_ptr<Log> log = make_shared<NullLog> ();
+ shared_ptr<FFmpegDecoder> decoder = make_shared<FFmpegDecoder> (content, log, false);
for (vector<int>::const_iterator i = frames.begin(); i != frames.end(); ++i) {
check (decoder, *i);
diff --git a/test/ffmpeg_decoder_sequential_test.cc b/test/ffmpeg_decoder_sequential_test.cc
index 6a27d698f..9edca0160 100644
--- a/test/ffmpeg_decoder_sequential_test.cc
+++ b/test/ffmpeg_decoder_sequential_test.cc
@@ -31,6 +31,7 @@
#include "lib/film.h"
#include "test.h"
#include <boost/filesystem.hpp>
+#include <boost/make_shared.hpp>
#include <boost/test/unit_test.hpp>
#include <iostream>
@@ -38,6 +39,7 @@ using std::cout;
using std::cerr;
using std::list;
using boost::shared_ptr;
+using boost::make_shared;
using boost::optional;
void
@@ -50,11 +52,11 @@ ffmpeg_decoder_sequential_test_one (boost::filesystem::path file, float fps, int
}
shared_ptr<Film> film = new_test_film ("ffmpeg_decoder_seek_test_" + file.string());
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, path));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, path);
film->examine_and_add_content (content);
wait_for_jobs ();
- shared_ptr<Log> log (new NullLog);
- shared_ptr<FFmpegDecoder> decoder (new FFmpegDecoder (content, log, false));
+ shared_ptr<Log> log = make_shared<NullLog> ();
+ shared_ptr<FFmpegDecoder> decoder = make_shared<FFmpegDecoder> (content, log, false);
BOOST_REQUIRE (decoder->video->_content->video_frame_rate());
BOOST_CHECK_CLOSE (decoder->video->_content->video_frame_rate().get(), fps, 0.01);
diff --git a/test/ffmpeg_examiner_test.cc b/test/ffmpeg_examiner_test.cc
index 13846a8a1..2900689e5 100644
--- a/test/ffmpeg_examiner_test.cc
+++ b/test/ffmpeg_examiner_test.cc
@@ -23,19 +23,21 @@
* correctly from data/count300bd24.m2ts.
*/
-#include <boost/test/unit_test.hpp>
#include "lib/ffmpeg_examiner.h"
#include "lib/ffmpeg_content.h"
#include "lib/ffmpeg_audio_stream.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (ffmpeg_examiner_test)
{
shared_ptr<Film> film = new_test_film ("ffmpeg_examiner_test");
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/count300bd24.m2ts"));
- shared_ptr<FFmpegExaminer> examiner (new FFmpegExaminer (content));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, "test/data/count300bd24.m2ts");
+ shared_ptr<FFmpegExaminer> examiner = make_shared<FFmpegExaminer> (content);
BOOST_CHECK_EQUAL (examiner->first_video().get(), ContentTime::from_seconds (600));
BOOST_CHECK_EQUAL (examiner->audio_streams().size(), 1U);
diff --git a/test/ffmpeg_pts_offset_test.cc b/test/ffmpeg_pts_offset_test.cc
index 02ea0233d..ccc2a10f2 100644
--- a/test/ffmpeg_pts_offset_test.cc
+++ b/test/ffmpeg_pts_offset_test.cc
@@ -22,24 +22,27 @@
* @brief Check the computation of _pts_offset in FFmpegDecoder.
*/
-#include <boost/test/unit_test.hpp>
#include "lib/film.h"
#include "lib/ffmpeg_decoder.h"
#include "lib/ffmpeg_content.h"
#include "lib/ffmpeg_audio_stream.h"
#include "lib/audio_content.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test)
{
shared_ptr<Film> film = new_test_film ("ffmpeg_pts_offset_test");
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->examine_and_add_content (content);
wait_for_jobs ();
content->audio.reset (new AudioContent (content.get()));
+ /* Can't use make_shared here */
content->audio->add_stream (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream));
content->_video_frame_rate = 24;
diff --git a/test/film_metadata_test.cc b/test/film_metadata_test.cc
index 970c6526d..d61f5f0d1 100644
--- a/test/film_metadata_test.cc
+++ b/test/film_metadata_test.cc
@@ -22,17 +22,19 @@
* @brief Test some basic reading/writing of film metadata.
*/
-#include <boost/test/unit_test.hpp>
-#include <boost/filesystem.hpp>
-#include <boost/date_time.hpp>
#include "lib/film.h"
#include "lib/dcp_content_type.h"
#include "lib/ratio.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/date_time.hpp>
+#include <boost/make_shared.hpp>
using std::string;
using std::list;
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (film_metadata_test)
{
@@ -53,7 +55,7 @@ BOOST_AUTO_TEST_CASE (film_metadata_test)
ignore.push_back ("Key");
check_xml ("test/data/metadata.xml.ref", dir.string() + "/metadata.xml", ignore);
- shared_ptr<Film> g (new Film (dir));
+ shared_ptr<Film> g = make_shared<Film> (dir);
g->read_metadata ();
BOOST_CHECK_EQUAL (g->name(), "fred");
diff --git a/test/frame_rate_test.cc b/test/frame_rate_test.cc
index 592b7af8b..490836a46 100644
--- a/test/frame_rate_test.cc
+++ b/test/frame_rate_test.cc
@@ -23,7 +23,6 @@
* frame rate for the DCP.
*/
-#include <boost/test/unit_test.hpp>
#include "lib/film.h"
#include "lib/config.h"
#include "lib/ffmpeg_content.h"
@@ -33,8 +32,11 @@
#include "lib/video_content.h"
#include "lib/audio_content.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
/* Test Playlist::best_dcp_frame_rate and FrameRateChange
with a single piece of content.
@@ -43,7 +45,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
{
shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_single");
/* Get any piece of content, it doesn't matter what */
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->examine_and_add_content (content);
wait_for_jobs ();
@@ -221,9 +223,9 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_double)
{
shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_double");
/* Get any old content, it doesn't matter what */
- shared_ptr<FFmpegContent> A (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> A = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->examine_and_add_content (A);
- shared_ptr<FFmpegContent> B (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> B = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->examine_and_add_content (B);
wait_for_jobs ();
@@ -252,7 +254,7 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
{
shared_ptr<Film> film = new_test_film ("audio_sampling_rate_test");
/* Get any piece of content, it doesn't matter what */
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->examine_and_add_content (content);
wait_for_jobs ();
@@ -262,7 +264,7 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
afr.push_back (30);
Config::instance()->set_allowed_dcp_frame_rates (afr);
- shared_ptr<FFmpegAudioStream> stream (new FFmpegAudioStream ("foo", 0, 0, 0, 0));
+ shared_ptr<FFmpegAudioStream> stream = make_shared<FFmpegAudioStream> ("foo", 0, 0, 0, 0);
content->audio.reset (new AudioContent (content.get()));
content->audio->add_stream (stream);
content->_video_frame_rate = 24;
diff --git a/test/image_test.cc b/test/image_test.cc
index d00263035..59b35a96b 100644
--- a/test/image_test.cc
+++ b/test/image_test.cc
@@ -24,15 +24,17 @@
* @see test/make_black_test.cc, test/pixel_formats_test.cc
*/
-#include <boost/test/unit_test.hpp>
#include <Magick++.h>
#include "lib/image.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
#include <iostream>
using std::string;
using std::list;
using std::cout;
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (aligned_image_test)
{
@@ -138,7 +140,7 @@ BOOST_AUTO_TEST_CASE (alpha_blend_test)
{
int const stride = 48 * 4;
- shared_ptr<Image> A (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false));
+ shared_ptr<Image> A = make_shared<Image> (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false);
A->make_black ();
uint8_t* a = A->data()[0];
@@ -151,7 +153,7 @@ BOOST_AUTO_TEST_CASE (alpha_blend_test)
}
}
- shared_ptr<Image> B (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 48), true));
+ shared_ptr<Image> B = make_shared<Image> (AV_PIX_FMT_RGBA, dcp::Size (48, 48), true);
B->make_transparent ();
uint8_t* b = B->data()[0];
@@ -192,7 +194,7 @@ BOOST_AUTO_TEST_CASE (merge_test1)
{
int const stride = 48 * 4;
- shared_ptr<Image> A (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false));
+ shared_ptr<Image> A = make_shared<Image> (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false);
A->make_transparent ();
uint8_t* a = A->data()[0];
@@ -217,7 +219,7 @@ BOOST_AUTO_TEST_CASE (merge_test1)
/** Test merge (list<PositionImage>) with two images */
BOOST_AUTO_TEST_CASE (merge_test2)
{
- shared_ptr<Image> A (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false));
+ shared_ptr<Image> A = make_shared<Image> (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) {
@@ -227,7 +229,7 @@ BOOST_AUTO_TEST_CASE (merge_test2)
a[x * 4 + 3] = 255;
}
- shared_ptr<Image> B (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false));
+ shared_ptr<Image> B = make_shared<Image> (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) {
diff --git a/test/import_dcp_test.cc b/test/import_dcp_test.cc
index 69ffa9cc4..3dc9333da 100644
--- a/test/import_dcp_test.cc
+++ b/test/import_dcp_test.cc
@@ -29,9 +29,11 @@
#include "lib/cross.h"
#include <dcp/cpl.h>
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using std::vector;
using boost::shared_ptr;
+using boost::make_shared;
/** Make an encrypted DCP, import it and make a new unencrypted DCP */
BOOST_AUTO_TEST_CASE (import_dcp_test)
@@ -41,7 +43,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test)
A->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
A->set_name ("frobozz");
- shared_ptr<FFmpegContent> c (new FFmpegContent (A, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (A, "test/data/test.mp4");
A->examine_and_add_content (c);
A->set_encrypted (true);
wait_for_jobs ();
@@ -52,7 +54,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test)
dcp::DCP A_dcp ("build/test/import_dcp_test/" + A->dcp_name());
A_dcp.read ();
- Config::instance()->set_decryption_chain (shared_ptr<dcp::CertificateChain> (new dcp::CertificateChain (openssl_path ())));
+ Config::instance()->set_decryption_chain (make_shared<dcp::CertificateChain> (openssl_path ()));
dcp::EncryptedKDM kdm = A->make_kdm (
Config::instance()->decryption_chain()->leaf (),
@@ -68,7 +70,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test)
B->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
B->set_name ("frobozz");
- shared_ptr<DCPContent> d (new DCPContent (B, "build/test/import_dcp_test/" + A->dcp_name()));
+ shared_ptr<DCPContent> d = boost::make_shared<DCPContent> (B, "build/test/import_dcp_test/" + A->dcp_name());
d->add_kdm (kdm);
B->examine_and_add_content (d);
wait_for_jobs ();
diff --git a/test/interrupt_encoder_test.cc b/test/interrupt_encoder_test.cc
index 8883c2d6f..4d5787997 100644
--- a/test/interrupt_encoder_test.cc
+++ b/test/interrupt_encoder_test.cc
@@ -27,8 +27,10 @@
#include "lib/cross.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
/** Interrupt a DCP encode when it is in progress, as this used to (still does?)
* sometimes give an error related to pthreads.
@@ -40,7 +42,7 @@ BOOST_AUTO_TEST_CASE (interrupt_encoder_test)
film->set_container (Ratio::from_id ("185"));
film->set_name ("interrupt_encoder_test");
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, private_data / "prophet_clip.mkv"));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, private_data / "prophet_clip.mkv");
film->examine_and_add_content (content);
wait_for_jobs ();
diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc
index bb47fa9c0..e3023f9f5 100644
--- a/test/isdcf_name_test.cc
+++ b/test/isdcf_name_test.cc
@@ -28,10 +28,12 @@
#include "lib/ffmpeg_content.h"
#include "lib/audio_content.h"
#include "test.h"
+#include <boost/make_shared.hpp>
#include <iostream>
using std::cout;
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (isdcf_name_test)
{
@@ -76,7 +78,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
/* Test interior aspect ratio: shouldn't be shown with trailers */
- shared_ptr<ImageContent> content (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
+ shared_ptr<ImageContent> content = make_shared<ImageContent> (film, "test/data/simple_testcard_640x480.png");
film->examine_and_add_content (content);
wait_for_jobs ();
content->video->set_scale (VideoContentScale (Ratio::from_id ("133")));
@@ -128,7 +130,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
/* Test audio channel markup */
film->set_audio_channels (6);
- shared_ptr<FFmpegContent> sound (new FFmpegContent (film, "test/data/sine_440.wav"));
+ shared_ptr<FFmpegContent> sound = make_shared<FFmpegContent> (film, "test/data/sine_440.wav");
film->examine_and_add_content (sound);
wait_for_jobs ();
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_10_4K_DI_20140704_PP_SMPTE_OV");
diff --git a/test/job_test.cc b/test/job_test.cc
index 8728b7312..5212ec150 100644
--- a/test/job_test.cc
+++ b/test/job_test.cc
@@ -22,13 +22,15 @@
* @brief Basic tests of Job and JobManager.
*/
-#include <boost/test/unit_test.hpp>
#include "lib/job.h"
#include "lib/job_manager.h"
#include "lib/cross.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using std::string;
using boost::shared_ptr;
+using boost::make_shared;
class TestJob : public Job
{
@@ -70,7 +72,7 @@ BOOST_AUTO_TEST_CASE (job_manager_test)
shared_ptr<Film> film;
/* Single job */
- shared_ptr<TestJob> a (new TestJob (film));
+ shared_ptr<TestJob> a = make_shared<TestJob> (film);
JobManager::instance()->add (a);
dcpomatic_sleep (1);
diff --git a/test/make_black_test.cc b/test/make_black_test.cc
index 405cc835f..88bf4bb7a 100644
--- a/test/make_black_test.cc
+++ b/test/make_black_test.cc
@@ -25,14 +25,16 @@
* @see test/image_test.cc
*/
-#include <boost/test/unit_test.hpp>
#include <dcp/util.h>
extern "C" {
#include <libavutil/pixfmt.h>
}
#include "lib/image.h"
+#include <boost/make_shared.hpp>
+#include <boost/test/unit_test.hpp>
using std::list;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (make_black_test)
{
@@ -79,7 +81,7 @@ BOOST_AUTO_TEST_CASE (make_black_test)
int N = 0;
for (list<AVPixelFormat>::const_iterator i = pix_fmts.begin(); i != pix_fmts.end(); ++i) {
- boost::shared_ptr<Image> foo (new Image (*i, in_size, true));
+ boost::shared_ptr<Image> foo = make_shared<Image> (*i, in_size, true);
foo->make_black ();
boost::shared_ptr<Image> bar = foo->scale (out_size, dcp::YUV_TO_RGB_REC601, AV_PIX_FMT_RGB24, true, false);
diff --git a/test/play_test.cc b/test/play_test.cc
index 92c49a134..9b9e2c87b 100644
--- a/test/play_test.cc
+++ b/test/play_test.cc
@@ -88,13 +88,13 @@ BOOST_AUTO_TEST_CASE (play_test)
film->set_container (Ratio::from_id ("185"));
film->set_name ("play_test");
- shared_ptr<FFmpegContent> A (new FFmpegContent (film, "test/data/red_24.mp4"));
+ shared_ptr<FFmpegContent> A = make_shared<FFmpegContent> (film, "test/data/red_24.mp4");
film->examine_and_add_content (A);
wait_for_jobs ();
BOOST_CHECK_EQUAL (A->video_length_after_3d_combine(), 16);
- shared_ptr<FFmpegContent> B (new FFmpegContent (film, "test/data/red_30.mp4"));
+ shared_ptr<FFmpegContent> B = make_shared<FFmpegContent> (film, "test/data/red_30.mp4");
film->examine_and_add_content (B);
wait_for_jobs ();
@@ -107,7 +107,7 @@ BOOST_AUTO_TEST_CASE (play_test)
/* A is 16 frames long at 25 fps */
BOOST_CHECK_EQUAL (B->position(), 16 * TIME_HZ / 25);
- shared_ptr<Player> player (new Player (film));
+ shared_ptr<Player> player = make_shared<Player> (film);
PlayerWrapper wrap (player);
/* Seek and audio don't get on at the moment */
player->disable_audio ();
diff --git a/test/player_test.cc b/test/player_test.cc
index 1b628f72a..6ca0073d8 100644
--- a/test/player_test.cc
+++ b/test/player_test.cc
@@ -22,8 +22,6 @@
* @brief Various tests of Player.
*/
-#include <iostream>
-#include <boost/test/unit_test.hpp>
#include "lib/film.h"
#include "lib/ffmpeg_content.h"
#include "lib/dcp_content_type.h"
@@ -31,10 +29,14 @@
#include "lib/audio_buffers.h"
#include "lib/player.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
+#include <iostream>
using std::cout;
using std::list;
using boost::shared_ptr;
+using boost::make_shared;
static bool
valid (Content const *)
@@ -49,9 +51,9 @@ BOOST_AUTO_TEST_CASE (player_overlaps_test)
film->set_container (Ratio::from_id ("185"));
/* This content is 3s long */
- shared_ptr<FFmpegContent> A (new FFmpegContent (film, "test/data/test.mp4"));
- shared_ptr<FFmpegContent> B (new FFmpegContent (film, "test/data/test.mp4"));
- shared_ptr<FFmpegContent> C (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> A = make_shared<FFmpegContent> (film, "test/data/test.mp4");
+ shared_ptr<FFmpegContent> B = make_shared<FFmpegContent> (film, "test/data/test.mp4");
+ shared_ptr<FFmpegContent> C = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->examine_and_add_content (A);
film->examine_and_add_content (B);
@@ -64,7 +66,7 @@ BOOST_AUTO_TEST_CASE (player_overlaps_test)
B->set_position (DCPTime::from_seconds (10));
C->set_position (DCPTime::from_seconds (20));
- shared_ptr<Player> player (new Player (film, film->playlist ()));
+ shared_ptr<Player> player = make_shared<Player> (film, film->playlist ());
list<shared_ptr<Piece> > o = player->overlaps (DCPTime::from_seconds (0), DCPTime::from_seconds (5), &valid);
BOOST_CHECK_EQUAL (o.size(), 1U);
@@ -92,14 +94,14 @@ BOOST_AUTO_TEST_CASE (player_silence_padding_test)
{
shared_ptr<Film> film = new_test_film ("player_silence_padding_test");
film->set_name ("player_silence_padding_test");
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->set_container (Ratio::from_id ("185"));
film->set_audio_channels (6);
film->examine_and_add_content (c);
wait_for_jobs ();
- shared_ptr<Player> player (new Player (film, film->playlist ()));
+ shared_ptr<Player> player = make_shared<Player> (film, film->playlist ());
shared_ptr<AudioBuffers> test = player->get_audio (DCPTime (0), DCPTime::from_seconds (1), true);
BOOST_CHECK_EQUAL (test->frames(), 48000);
BOOST_CHECK_EQUAL (test->channels(), film->audio_channels ());
diff --git a/test/recover_test.cc b/test/recover_test.cc
index f9ef8793e..83e83d88d 100644
--- a/test/recover_test.cc
+++ b/test/recover_test.cc
@@ -32,11 +32,13 @@
#include <dcp/mono_picture_asset.h>
#include <dcp/stereo_picture_asset.h>
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
#include <iostream>
using std::cout;
using std::string;
using boost::shared_ptr;
+using boost::make_shared;
static void
note (dcp::NoteType t, string n)
@@ -53,7 +55,7 @@ BOOST_AUTO_TEST_CASE (recover_test_2d)
film->set_container (Ratio::from_id ("185"));
film->set_name ("recover_test");
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/count300bd24.m2ts"));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, "test/data/count300bd24.m2ts");
film->examine_and_add_content (content);
wait_for_jobs ();
@@ -71,8 +73,8 @@ BOOST_AUTO_TEST_CASE (recover_test_2d)
film->make_dcp ();
wait_for_jobs ();
- shared_ptr<dcp::MonoPictureAsset> A (new dcp::MonoPictureAsset ("build/test/recover_test_2d/original.mxf"));
- shared_ptr<dcp::MonoPictureAsset> B (new dcp::MonoPictureAsset (video));
+ shared_ptr<dcp::MonoPictureAsset> A = make_shared<dcp::MonoPictureAsset> ("build/test/recover_test_2d/original.mxf");
+ shared_ptr<dcp::MonoPictureAsset> B = make_shared<dcp::MonoPictureAsset> (video);
dcp::EqualityOptions eq;
BOOST_CHECK (A->equals (B, eq, boost::bind (&note, _1, _2)));
@@ -86,7 +88,7 @@ BOOST_AUTO_TEST_CASE (recover_test_3d)
film->set_name ("recover_test");
film->set_three_d (true);
- shared_ptr<ImageContent> content (new ImageContent (film, "test/data/3d_test"));
+ shared_ptr<ImageContent> content = make_shared<ImageContent> (film, "test/data/3d_test");
content->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
film->examine_and_add_content (content);
wait_for_jobs ();
@@ -106,8 +108,8 @@ BOOST_AUTO_TEST_CASE (recover_test_3d)
film->make_dcp ();
wait_for_jobs ();
- shared_ptr<dcp::StereoPictureAsset> A (new dcp::StereoPictureAsset ("build/test/recover_test_3d/original.mxf"));
- shared_ptr<dcp::StereoPictureAsset> B (new dcp::StereoPictureAsset (video));
+ shared_ptr<dcp::StereoPictureAsset> A = make_shared<dcp::StereoPictureAsset> ("build/test/recover_test_3d/original.mxf");
+ shared_ptr<dcp::StereoPictureAsset> B = make_shared<dcp::StereoPictureAsset> (video);
dcp::EqualityOptions eq;
BOOST_CHECK (A->equals (B, eq, boost::bind (&note, _1, _2)));
diff --git a/test/reels_test.cc b/test/reels_test.cc
index 6178c88ac..f516fb262 100644
--- a/test/reels_test.cc
+++ b/test/reels_test.cc
@@ -29,18 +29,20 @@
#include "test.h"
#include <boost/test/unit_test.hpp>
#include <boost/foreach.hpp>
+#include <boost/make_shared.hpp>
using std::list;
using boost::shared_ptr;
+using boost::make_shared;
/** Test Film::reels() */
BOOST_AUTO_TEST_CASE (reels_test1)
{
shared_ptr<Film> film = new_test_film ("reels_test1");
film->set_container (Ratio::from_id ("185"));
- shared_ptr<FFmpegContent> A (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> A = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->examine_and_add_content (A);
- shared_ptr<FFmpegContent> B (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> B = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->examine_and_add_content (B);
wait_for_jobs ();
BOOST_CHECK_EQUAL (A->full_length(), DCPTime (288000));
@@ -87,21 +89,21 @@ BOOST_AUTO_TEST_CASE (reels_test2)
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
{
- shared_ptr<ImageContent> c (new ImageContent (film, "test/data/flat_red.png"));
+ shared_ptr<ImageContent> c = make_shared<ImageContent> (film, "test/data/flat_red.png");
film->examine_and_add_content (c);
wait_for_jobs ();
c->video->set_length (24);
}
{
- shared_ptr<ImageContent> c (new ImageContent (film, "test/data/flat_green.png"));
+ shared_ptr<ImageContent> c = make_shared<ImageContent> (film, "test/data/flat_green.png");
film->examine_and_add_content (c);
wait_for_jobs ();
c->video->set_length (24);
}
{
- shared_ptr<ImageContent> c (new ImageContent (film, "test/data/flat_blue.png"));
+ shared_ptr<ImageContent> c = make_shared<ImageContent> (film, "test/data/flat_blue.png");
film->examine_and_add_content (c);
wait_for_jobs ();
c->video->set_length (24);
@@ -121,7 +123,7 @@ BOOST_AUTO_TEST_CASE (reels_test2)
film2->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
film2->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
- shared_ptr<DCPContent> c (new DCPContent (film2, film->dir (film->dcp_name ())));
+ shared_ptr<DCPContent> c = make_shared<DCPContent> (film2, film->dir (film->dcp_name ()));
film2->examine_and_add_content (c);
wait_for_jobs ();
@@ -155,9 +157,9 @@ BOOST_AUTO_TEST_CASE (reels_test3)
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
- shared_ptr<Content> dcp (new DCPContent (film, "test/data/reels_test2"));
+ shared_ptr<Content> dcp = make_shared<DCPContent> (film, "test/data/reels_test2");
film->examine_and_add_content (dcp);
- shared_ptr<Content> sub (new TextSubtitleContent (film, "test/data/subrip.srt"));
+ shared_ptr<Content> sub = make_shared<TextSubtitleContent> (film, "test/data/subrip.srt");
film->examine_and_add_content (sub);
wait_for_jobs ();
@@ -197,7 +199,7 @@ BOOST_AUTO_TEST_CASE (reels_test4)
content[i]->video->set_length (24);
}
- shared_ptr<TextSubtitleContent> subs (new TextSubtitleContent (film, "test/data/subrip3.srt"));
+ shared_ptr<TextSubtitleContent> subs = make_shared<TextSubtitleContent> (film, "test/data/subrip3.srt");
film->examine_and_add_content (subs);
wait_for_jobs ();
diff --git a/test/repeat_frame_test.cc b/test/repeat_frame_test.cc
index d145ccb18..be39242e7 100644
--- a/test/repeat_frame_test.cc
+++ b/test/repeat_frame_test.cc
@@ -25,15 +25,17 @@
* @see test/skip_frame_test.cc
*/
-#include <boost/test/unit_test.hpp>
#include "test.h"
#include "lib/film.h"
#include "lib/ratio.h"
#include "lib/ffmpeg_content.h"
#include "lib/dcp_content_type.h"
#include "lib/video_content.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (repeat_frame_test)
{
@@ -41,7 +43,7 @@ BOOST_AUTO_TEST_CASE (repeat_frame_test)
film->set_name ("repeat_frame_test");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/red_24.mp4"));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, "test/data/red_24.mp4");
film->examine_and_add_content (c);
wait_for_jobs ();
diff --git a/test/resampler_test.cc b/test/resampler_test.cc
index fb4b98861..cb5cddc9e 100644
--- a/test/resampler_test.cc
+++ b/test/resampler_test.cc
@@ -23,14 +23,16 @@
* to the number of samples it generates.
*/
-#include <boost/test/unit_test.hpp>
#include "lib/audio_buffers.h"
#include "lib/resampler.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
#include <iostream>
using std::pair;
using std::cout;
using boost::shared_ptr;
+using boost::make_shared;
static void
resampler_test_one (int from, int to)
@@ -42,7 +44,7 @@ resampler_test_one (int from, int to)
/* XXX: no longer checks anything */
for (int64_t i = 0; i < N; i += 1000) {
- shared_ptr<AudioBuffers> a (new AudioBuffers (1, 1000));
+ shared_ptr<AudioBuffers> a = make_shared<AudioBuffers> (1, 1000);
a->make_silent ();
shared_ptr<const AudioBuffers> r = resamp.run (a);
}
diff --git a/test/scaling_test.cc b/test/scaling_test.cc
index 5ac5c7525..4bb6551d3 100644
--- a/test/scaling_test.cc
+++ b/test/scaling_test.cc
@@ -22,16 +22,18 @@
* @brief Test scaling and black-padding of images from a still-image source.
*/
-#include <boost/test/unit_test.hpp>
#include "lib/image_content.h"
#include "lib/ratio.h"
#include "lib/film.h"
#include "lib/dcp_content_type.h"
#include "lib/video_content.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using std::string;
using boost::shared_ptr;
+using boost::make_shared;
static void scaling_test_for (shared_ptr<Film> film, shared_ptr<Content> content, string image, string container)
{
@@ -60,7 +62,7 @@ BOOST_AUTO_TEST_CASE (scaling_test)
shared_ptr<Film> film = new_test_film ("scaling_test");
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
film->set_name ("scaling_test");
- shared_ptr<ImageContent> imc (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
+ shared_ptr<ImageContent> imc = make_shared<ImageContent> (film, "test/data/simple_testcard_640x480.png");
film->examine_and_add_content (imc);
diff --git a/test/seek_zero_test.cc b/test/seek_zero_test.cc
index 05bf1b5bf..c22cadb96 100644
--- a/test/seek_zero_test.cc
+++ b/test/seek_zero_test.cc
@@ -23,7 +23,6 @@
* confusing things as it might in ffmpeg_seek_test).
*/
-#include <boost/test/unit_test.hpp>
#include "lib/film.h"
#include "lib/ffmpeg_content.h"
#include "lib/ratio.h"
@@ -35,6 +34,8 @@
#include "lib/video_content.h"
#include "lib/video_decoder.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
#include <iostream>
using std::cout;
@@ -42,6 +43,7 @@ using std::list;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (seek_zero_test)
{
@@ -49,7 +51,7 @@ BOOST_AUTO_TEST_CASE (seek_zero_test)
film->set_name ("seek_zero_test");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/count300bd48.m2ts"));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, "test/data/count300bd48.m2ts");
film->examine_and_add_content (content);
wait_for_jobs ();
content->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
diff --git a/test/silence_padding_test.cc b/test/silence_padding_test.cc
index 9791b7172..5ece7d9cd 100644
--- a/test/silence_padding_test.cc
+++ b/test/silence_padding_test.cc
@@ -35,10 +35,12 @@
#include <dcp/reel_sound_asset.h>
#include <dcp/sound_asset_reader.h>
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using std::string;
using boost::lexical_cast;
using boost::shared_ptr;
+using boost::make_shared;
static void
test_silence_padding (int channels)
@@ -49,7 +51,7 @@ test_silence_padding (int channels)
film->set_container (Ratio::from_id ("185"));
film->set_name (film_name);
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/staircase.wav"));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, "test/data/staircase.wav");
film->examine_and_add_content (content);
wait_for_jobs ();
diff --git a/test/skip_frame_test.cc b/test/skip_frame_test.cc
index 8ff43a4ca..b98b80334 100644
--- a/test/skip_frame_test.cc
+++ b/test/skip_frame_test.cc
@@ -25,15 +25,17 @@
* @see test/repeat_frame_test.cc
*/
-#include <boost/test/unit_test.hpp>
#include "test.h"
#include "lib/film.h"
#include "lib/ratio.h"
#include "lib/ffmpeg_content.h"
#include "lib/dcp_content_type.h"
#include "lib/video_content.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (skip_frame_test)
{
@@ -41,7 +43,7 @@ BOOST_AUTO_TEST_CASE (skip_frame_test)
film->set_name ("skip_frame_test");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/count300bd48.m2ts"));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, "test/data/count300bd48.m2ts");
film->examine_and_add_content (c);
wait_for_jobs ();
diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc
index 123d04d95..2899d5064 100644
--- a/test/srt_subtitle_test.cc
+++ b/test/srt_subtitle_test.cc
@@ -31,11 +31,13 @@
#include "test.h"
#include <boost/test/unit_test.hpp>
#include <boost/algorithm/string.hpp>
+#include <boost/make_shared.hpp>
#include <list>
using std::string;
using std::list;
using boost::shared_ptr;
+using boost::make_shared;
/** Make a very short DCP with a single subtitle from .srt with no specified fonts */
BOOST_AUTO_TEST_CASE (srt_subtitle_test)
@@ -44,7 +46,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test)
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
- shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
+ shared_ptr<TextSubtitleContent> content = make_shared<TextSubtitleContent> (film, "test/data/subrip2.srt");
film->examine_and_add_content (content);
wait_for_jobs ();
@@ -64,7 +66,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2)
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
- shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
+ shared_ptr<TextSubtitleContent> content = make_shared<TextSubtitleContent> (film, "test/data/subrip2.srt");
film->examine_and_add_content (content);
wait_for_jobs ();
@@ -89,7 +91,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test3)
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
film->set_interop (true);
- shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, private_data / "Ankoemmling.srt"));
+ shared_ptr<TextSubtitleContent> content = make_shared<TextSubtitleContent> (film, private_data / "Ankoemmling.srt");
film->examine_and_add_content (content);
wait_for_jobs ();
@@ -130,11 +132,11 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test3)
BOOST_AUTO_TEST_CASE (srt_subtitle_test4)
{
shared_ptr<Film> film = new_test_film ("subrip_render_test");
- shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip.srt"));
+ shared_ptr<TextSubtitleContent> content = make_shared<TextSubtitleContent> (film, "test/data/subrip.srt");
content->examine (shared_ptr<Job> (), true);
BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds ((3 * 60) + 56.471));
- shared_ptr<SubRipDecoder> decoder (new SubRipDecoder (content));
+ shared_ptr<SubRipDecoder> decoder = make_shared<SubRipDecoder> (content);
list<ContentTextSubtitle> cts = decoder->get_text_subtitles (
ContentTimePeriod (
ContentTime::from_seconds (109), ContentTime::from_seconds (110)
diff --git a/test/ssa_subtitle_test.cc b/test/ssa_subtitle_test.cc
index f6c65b1af..0bfa39e74 100644
--- a/test/ssa_subtitle_test.cc
+++ b/test/ssa_subtitle_test.cc
@@ -27,11 +27,13 @@
#include "test.h"
#include <boost/test/unit_test.hpp>
#include <boost/algorithm/string.hpp>
+#include <boost/make_shared.hpp>
#include <list>
using std::string;
using std::list;
using boost::shared_ptr;
+using boost::make_shared;
/** Make a DCP with subs from a .ssa file */
BOOST_AUTO_TEST_CASE (ssa_subtitle_test1)
@@ -42,7 +44,7 @@ BOOST_AUTO_TEST_CASE (ssa_subtitle_test1)
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
film->set_interop (true);
- shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, private_data / "DKH_UT_EN20160601def.ssa"));
+ shared_ptr<TextSubtitleContent> content = make_shared<TextSubtitleContent> (film, private_data / "DKH_UT_EN20160601def.ssa");
film->examine_and_add_content (content);
wait_for_jobs ();
diff --git a/test/test.cc b/test/test.cc
index c7a9e95bf..d3180434d 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -40,6 +40,7 @@
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE dcpomatic_test
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
#include <list>
#include <vector>
#include <iostream>
@@ -53,6 +54,7 @@ using std::list;
using std::abs;
using boost::shared_ptr;
using boost::scoped_array;
+using boost::make_shared;
boost::filesystem::path private_data = boost::filesystem::path ("..") / boost::filesystem::path ("dcpomatic-test-private");
@@ -112,7 +114,7 @@ new_test_film (string name)
boost::filesystem::remove_all (p);
}
- shared_ptr<Film> film = shared_ptr<Film> (new Film (p.string()));
+ shared_ptr<Film> film = boost::make_shared<Film> (p.string());
film->write_metadata ();
return film;
}
diff --git a/test/threed_test.cc b/test/threed_test.cc
index ab94cf8e5..23236fb31 100644
--- a/test/threed_test.cc
+++ b/test/threed_test.cc
@@ -29,16 +29,18 @@
#include "lib/dcp_content_type.h"
#include "lib/ffmpeg_content.h"
#include "lib/video_content.h"
+#include <boost/make_shared.hpp>
#include <iostream>
using std::cout;
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (threed_test)
{
shared_ptr<Film> film = new_test_film ("threed_test");
film->set_name ("test_film2");
- shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> c = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->examine_and_add_content (c);
wait_for_jobs ();
diff --git a/test/time_calculation_test.cc b/test/time_calculation_test.cc
index ddd685d0c..bf21e5476 100644
--- a/test/time_calculation_test.cc
+++ b/test/time_calculation_test.cc
@@ -25,10 +25,12 @@
#include "lib/audio_content.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using std::string;
using std::list;
using boost::shared_ptr;
+using boost::make_shared;
static string const xml = "<Content>"
"<Type>FFmpeg</Type>"
@@ -123,11 +125,11 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
{
shared_ptr<Film> film = new_test_film ("ffmpeg_time_calculation_test");
- shared_ptr<cxml::Document> doc (new cxml::Document);
+ shared_ptr<cxml::Document> doc = make_shared<cxml::Document> ();
doc->read_string (xml);
list<string> notes;
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
+ shared_ptr<FFmpegContent> content = boost::make_shared<FFmpegContent> (film, doc, film->state_version(), notes);
/* 25fps content, 25fps DCP */
film->set_video_frame_rate (25);
@@ -176,15 +178,15 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
{
shared_ptr<Film> film = new_test_film ("player_time_calculation_test1");
- shared_ptr<cxml::Document> doc (new cxml::Document);
+ shared_ptr<cxml::Document> doc = make_shared<cxml::Document> ();
doc->read_string (xml);
list<string> notes;
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
+ shared_ptr<FFmpegContent> content = boost::make_shared<FFmpegContent> (film, doc, film->state_version(), notes);
film->set_sequence (false);
film->add_content (content);
- shared_ptr<Player> player (new Player (film, film->playlist ()));
+ shared_ptr<Player> player = make_shared<Player> (film, film->playlist ());
/* Position 0, no trim, content rate = DCP rate */
content->set_position (DCPTime ());
@@ -381,15 +383,15 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
{
shared_ptr<Film> film = new_test_film ("player_time_calculation_test2");
- shared_ptr<cxml::Document> doc (new cxml::Document);
+ shared_ptr<cxml::Document> doc = make_shared<cxml::Document> ();
doc->read_string (xml);
list<string> notes;
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
+ shared_ptr<FFmpegContent> content = boost::make_shared<FFmpegContent> (film, doc, film->state_version(), notes);
film->set_sequence (false);
film->add_content (content);
- shared_ptr<Player> player (new Player (film, film->playlist ()));
+ shared_ptr<Player> player = make_shared<Player> (film, film->playlist ());
/* Position 0, no trim, content rate = DCP rate */
content->set_position (DCPTime ());
@@ -557,16 +559,16 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
{
shared_ptr<Film> film = new_test_film ("player_time_calculation_test3");
- shared_ptr<cxml::Document> doc (new cxml::Document);
+ shared_ptr<cxml::Document> doc = make_shared<cxml::Document> ();
doc->read_string (xml);
list<string> notes;
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, doc, film->state_version(), notes));
+ shared_ptr<FFmpegContent> content = boost::make_shared<FFmpegContent> (film, doc, film->state_version(), notes);
AudioStreamPtr stream = content->audio->streams().front();
film->set_sequence (false);
film->add_content (content);
- shared_ptr<Player> player (new Player (film, film->playlist ()));
+ shared_ptr<Player> player = make_shared<Player> (film, film->playlist ());
/* Position 0, no trim, video/audio content rate = video/audio DCP rate */
content->set_position (DCPTime ());
diff --git a/test/upmixer_a_test.cc b/test/upmixer_a_test.cc
index e0117c734..4c611c37e 100644
--- a/test/upmixer_a_test.cc
+++ b/test/upmixer_a_test.cc
@@ -18,8 +18,6 @@
*/
-#include <boost/test/unit_test.hpp>
-#include <sndfile.h>
#include "lib/film.h"
#include "lib/ratio.h"
#include "lib/dcp_content_type.h"
@@ -28,8 +26,12 @@
#include "lib/audio_buffers.h"
#include "lib/upmixer_a.h"
#include "test.h"
+#include <sndfile.h>
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (upmixer_a_test)
{
@@ -38,7 +40,7 @@ BOOST_AUTO_TEST_CASE (upmixer_a_test)
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
film->set_audio_processor (AudioProcessor::from_id ("stereo-5.1-upmix-a"));
- shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/white.wav"));
+ shared_ptr<FFmpegContent> content = make_shared<FFmpegContent> (film, "test/data/white.wav");
film->examine_and_add_content (content);
wait_for_jobs ();
@@ -54,7 +56,7 @@ BOOST_AUTO_TEST_CASE (upmixer_a_test)
SNDFILE* Ls = sf_open ("build/test/upmixer_a_test/Ls.wav", SFM_WRITE, &info);
SNDFILE* Rs = sf_open ("build/test/upmixer_a_test/Rs.wav", SFM_WRITE, &info);
- shared_ptr<Player> player (new Player (film, film->playlist ()));
+ shared_ptr<Player> player = make_shared<Player> (film, film->playlist ());
for (DCPTime t; t < film->length(); t += DCPTime::from_seconds (1)) {
shared_ptr<AudioBuffers> b = player->get_audio (t, DCPTime::from_seconds (1), true);
sf_write_float (L, b->data(0), b->frames());
diff --git a/test/vf_test.cc b/test/vf_test.cc
index ae7c30be3..480df0bd7 100644
--- a/test/vf_test.cc
+++ b/test/vf_test.cc
@@ -24,16 +24,18 @@
#include "test.h"
#include <boost/test/unit_test.hpp>
#include <boost/foreach.hpp>
+#include <boost/make_shared.hpp>
using std::list;
using std::string;
using boost::shared_ptr;
+using boost::make_shared;
/** Test the logic which decides whether a DCP can be referenced or not */
BOOST_AUTO_TEST_CASE (vf_test1)
{
shared_ptr<Film> film = new_test_film ("vf_test1");
- shared_ptr<DCPContent> dcp (new DCPContent (film, "test/data/reels_test2"));
+ shared_ptr<DCPContent> dcp = make_shared<DCPContent> (film, "test/data/reels_test2");
film->examine_and_add_content (dcp);
wait_for_jobs ();
@@ -51,7 +53,7 @@ BOOST_AUTO_TEST_CASE (vf_test1)
/* (but reels_test2 has no subtitles to reference) */
BOOST_CHECK (!dcp->can_reference_subtitle(why_not));
- shared_ptr<FFmpegContent> other (new FFmpegContent (film, "test/data/test.mp4"));
+ shared_ptr<FFmpegContent> other = make_shared<FFmpegContent> (film, "test/data/test.mp4");
film->examine_and_add_content (other);
wait_for_jobs ();
diff --git a/test/video_content_scale_test.cc b/test/video_content_scale_test.cc
index 6f5d85a11..f1edce041 100644
--- a/test/video_content_scale_test.cc
+++ b/test/video_content_scale_test.cc
@@ -18,15 +18,17 @@
*/
-#include <boost/test/unit_test.hpp>
#include "lib/ffmpeg_content.h"
#include "lib/ratio.h"
#include "lib/video_content.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using std::list;
using std::string;
using std::cerr;
using boost::shared_ptr;
+using boost::make_shared;
using boost::optional;
static
@@ -86,11 +88,11 @@ test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop
"<SubtitleYScale>0</SubtitleYScale>"
"</Content>";
- shared_ptr<cxml::Document> doc (new cxml::Document ());
+ shared_ptr<cxml::Document> doc = make_shared<cxml::Document> ();
doc->read_string(s.str ());
list<string> notes;
- shared_ptr<FFmpegContent> vc (new FFmpegContent (film, doc, 10, notes));
+ shared_ptr<FFmpegContent> vc = boost::make_shared<FFmpegContent> (film, doc, 10, notes);
optional<VideoContentScale> sc;
if (ratio) {
diff --git a/test/video_decoder_fill_test.cc b/test/video_decoder_fill_test.cc
index 2d783f52d..8aa5e830f 100644
--- a/test/video_decoder_fill_test.cc
+++ b/test/video_decoder_fill_test.cc
@@ -18,23 +18,25 @@
*/
-#include <boost/test/unit_test.hpp>
#include "lib/image_decoder.h"
#include "lib/image_content.h"
#include "lib/content_video.h"
#include "lib/video_decoder.h"
#include "lib/film.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
#include <iostream>
using std::list;
using std::cout;
using boost::shared_ptr;
+using boost::make_shared;
BOOST_AUTO_TEST_CASE (video_decoder_fill_test1)
{
shared_ptr<Film> film = new_test_film ("video_decoder_fill_test");
- shared_ptr<ImageContent> c (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
+ shared_ptr<ImageContent> c = make_shared<ImageContent> (film, "test/data/simple_testcard_640x480.png");
ImageDecoder decoder (c, film->log());
decoder.video->fill_one_eye (0, 4, EYES_BOTH);
@@ -59,7 +61,7 @@ BOOST_AUTO_TEST_CASE (video_decoder_fill_test1)
BOOST_AUTO_TEST_CASE (video_decoder_fill_test2)
{
shared_ptr<Film> film = new_test_film ("video_decoder_fill_test");
- shared_ptr<ImageContent> c (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
+ shared_ptr<ImageContent> c = make_shared<ImageContent> (film, "test/data/simple_testcard_640x480.png");
ImageDecoder decoder (c, film->log());
decoder.video->fill_both_eyes (VideoFrame (0, EYES_LEFT), VideoFrame (4, EYES_LEFT));
diff --git a/test/video_mxf_content_test.cc b/test/video_mxf_content_test.cc
index 953e9b7b7..4759cb69c 100644
--- a/test/video_mxf_content_test.cc
+++ b/test/video_mxf_content_test.cc
@@ -26,8 +26,10 @@
#include "test.h"
#include <dcp/mono_picture_asset.h>
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
using boost::shared_ptr;
+using boost::make_shared;
using boost::dynamic_pointer_cast;
static boost::filesystem::path ref_mxf = "test/data/scaling_test_185_185/j2c_a41afbff-e1ad-41c4-9a84-de315b95dd0f.mxf";
@@ -53,9 +55,9 @@ BOOST_AUTO_TEST_CASE (video_mxf_content_test)
film->make_dcp ();
wait_for_jobs ();
- shared_ptr<dcp::MonoPictureAsset> ref (new dcp::MonoPictureAsset (ref_mxf));
+ shared_ptr<dcp::MonoPictureAsset> ref = make_shared<dcp::MonoPictureAsset> (ref_mxf);
boost::filesystem::directory_iterator i ("build/test/video_mxf_content_test/video");
- shared_ptr<dcp::MonoPictureAsset> comp (new dcp::MonoPictureAsset (*i));
+ shared_ptr<dcp::MonoPictureAsset> comp = make_shared<dcp::MonoPictureAsset> (*i);
dcp::EqualityOptions op;
BOOST_CHECK (ref->equals (comp, op, note));
}
diff --git a/test/xml_subtitle_test.cc b/test/xml_subtitle_test.cc
index 678f2b8d0..408d46b62 100644
--- a/test/xml_subtitle_test.cc
+++ b/test/xml_subtitle_test.cc
@@ -22,17 +22,19 @@
* @brief Test creation of XML DCP subtitles.
*/
-#include <boost/test/unit_test.hpp>
#include "lib/text_subtitle_content.h"
#include "lib/film.h"
#include "lib/ratio.h"
#include "lib/dcp_content_type.h"
#include "lib/subtitle_content.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
#include <iostream>
using std::cout;
using boost::shared_ptr;
+using boost::make_shared;
/** Build a small DCP with no picture and a single subtitle overlaid onto it */
BOOST_AUTO_TEST_CASE (xml_subtitle_test)
@@ -41,7 +43,7 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test)
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
- shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
+ shared_ptr<TextSubtitleContent> content = make_shared<TextSubtitleContent> (film, "test/data/subrip2.srt");
content->subtitle->set_use (true);
content->subtitle->set_burn (false);
film->examine_and_add_content (content);
@@ -62,7 +64,7 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test2)
film->set_name ("frobozz");
film->set_interop (true);
film->set_sequence (false);
- shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
+ shared_ptr<TextSubtitleContent> content = make_shared<TextSubtitleContent> (film, "test/data/subrip2.srt");
content->subtitle->set_use (true);
content->subtitle->set_burn (false);
film->examine_and_add_content (content);