diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-21 01:14:06 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-21 01:14:06 +0100 |
| commit | 5a5324ed3a381a86dfe0a6e3932c1d58fdcd596f (patch) | |
| tree | 769dca1358e35017ce5a5b3ab2dfafe2b24d61ed /test/player_test.cc | |
| parent | 4e83acad0c2a5c528709a175a80261b8147d3b49 (diff) | |
Use make_shared<>.
Diffstat (limited to 'test/player_test.cc')
| -rw-r--r-- | test/player_test.cc | 18 |
1 files changed, 10 insertions, 8 deletions
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 ()); |
