From ce73eaf7875a9a3326afcd839ad85eb95879c160 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 29 Dec 2022 01:47:32 +0100 Subject: [PATCH] Cleanup: test tidying. --- test/4k_test.cc | 11 +++++------ test/atmos_test.cc | 3 +-- test/audio_analysis_test.cc | 1 - test/audio_delay_test.cc | 1 - test/audio_filter_test.cc | 1 - test/audio_processor_delay_test.cc | 1 - test/audio_processor_test.cc | 1 - test/audio_ring_buffers_test.cc | 7 ++++--- test/burnt_subtitle_test.cc | 21 +++++++++++---------- test/butler_test.cc | 1 - test/closed_caption_test.cc | 8 +++++--- test/colour_conversion_test.cc | 1 - test/content_test.cc | 1 - test/cpl_hash_test.cc | 3 +-- test/dcp_decoder_test.cc | 3 +-- test/dcp_subtitle_test.cc | 2 +- test/digest_test.cc | 9 ++++----- test/ffmpeg_audio_test.cc | 1 - test/ffmpeg_dcp_test.cc | 11 +++++------ test/ffmpeg_encoder_test.cc | 7 +++---- test/ffmpeg_examiner_test.cc | 1 - test/ffmpeg_pts_offset_test.cc | 10 +++++----- test/file_naming_test.cc | 1 - test/frame_rate_test.cc | 14 ++++++++------ test/image_content_fade_test.cc | 1 - test/image_proxy_test.cc | 1 - test/import_dcp_test.cc | 1 - test/interrupt_encoder_test.cc | 1 - test/j2k_bandwidth_test.cc | 1 - test/markers_test.cc | 1 - test/no_use_video_test.cc | 1 - test/optimise_stills_test.cc | 1 - test/overlap_video_test.cc | 1 - test/pulldown_detect_test.cc | 16 ++++++---------- test/recover_test.cc | 9 ++++----- test/reels_test.cc | 8 ++++---- test/remake_id_test.cc | 15 +++++++-------- test/remake_with_subtitle_test.cc | 1 - test/repeat_frame_test.cc | 1 - test/required_disk_space_test.cc | 1 - test/resampler_test.cc | 1 - test/shuffler_test.cc | 29 ++++++++++++++++++++++++++--- test/silence_padding_test.cc | 1 - test/skip_frame_test.cc | 1 - test/srt_subtitle_test.cc | 10 +++++----- test/ssa_subtitle_test.cc | 7 +++---- test/stream_test.cc | 23 +++++++++++++---------- test/subtitle_charset_test.cc | 1 - test/subtitle_font_id_test.cc | 1 - test/subtitle_language_test.cc | 1 - test/subtitle_metadata_test.cc | 1 - test/subtitle_reel_number_test.cc | 1 - test/subtitle_reel_test.cc | 7 +++---- test/subtitle_trim_test.cc | 1 - test/threed_test.cc | 6 +++--- test/util_test.cc | 1 - test/vf_kdm_test.cc | 1 - test/video_mxf_content_test.cc | 7 +++---- 58 files changed, 131 insertions(+), 149 deletions(-) diff --git a/test/4k_test.cc b/test/4k_test.cc index 4db576cfc..86cb0275b 100644 --- a/test/4k_test.cc +++ b/test/4k_test.cc @@ -29,17 +29,16 @@ */ -#include -#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 "lib/dcpomatic_log.h" +#include "lib/ffmpeg_content.h" +#include "lib/film.h" +#include "lib/ratio.h" +#include "lib/video_content.h" #include "test.h" +#include -using std::shared_ptr; using std::make_shared; diff --git a/test/atmos_test.cc b/test/atmos_test.cc index ec7e9e85d..5c624a871 100644 --- a/test/atmos_test.cc +++ b/test/atmos_test.cc @@ -28,11 +28,10 @@ #include +using std::make_shared; using std::string; using std::vector; -using std::make_shared; using boost::optional; -using std::shared_ptr; BOOST_AUTO_TEST_CASE (atmos_passthrough_test) diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc index b3c519f29..df809bb15 100644 --- a/test/audio_analysis_test.cc +++ b/test/audio_analysis_test.cc @@ -43,7 +43,6 @@ using std::make_shared; -using std::shared_ptr; using std::vector; using namespace dcpomatic; diff --git a/test/audio_delay_test.cc b/test/audio_delay_test.cc index 688186e00..bafdea4e1 100644 --- a/test/audio_delay_test.cc +++ b/test/audio_delay_test.cc @@ -47,7 +47,6 @@ using std::cout; using std::make_shared; -using std::shared_ptr; using std::string; using boost::lexical_cast; diff --git a/test/audio_filter_test.cc b/test/audio_filter_test.cc index 8f0b9e794..b5ac25af7 100644 --- a/test/audio_filter_test.cc +++ b/test/audio_filter_test.cc @@ -31,7 +31,6 @@ using std::make_shared; -using std::shared_ptr; static void diff --git a/test/audio_processor_delay_test.cc b/test/audio_processor_delay_test.cc index 47a1cc8ad..90c8c1897 100644 --- a/test/audio_processor_delay_test.cc +++ b/test/audio_processor_delay_test.cc @@ -35,7 +35,6 @@ using std::cerr; using std::cout; using std::make_shared; -using std::shared_ptr; #define CHECK_SAMPLE(c,f,r) \ diff --git a/test/audio_processor_test.cc b/test/audio_processor_test.cc index 52dacb646..8d59a3fe9 100644 --- a/test/audio_processor_test.cc +++ b/test/audio_processor_test.cc @@ -35,7 +35,6 @@ #include -using std::shared_ptr; using std::make_shared; diff --git a/test/audio_ring_buffers_test.cc b/test/audio_ring_buffers_test.cc index 6efd8fbf8..ef64f5fba 100644 --- a/test/audio_ring_buffers_test.cc +++ b/test/audio_ring_buffers_test.cc @@ -18,17 +18,18 @@ */ + #include "lib/audio_ring_buffers.h" #include -#include -using std::cout; + using std::make_shared; -using std::shared_ptr; using namespace dcpomatic; + #define CANARY 9999 + /* XXX: these tests don't check the timestamping in AudioRingBuffers */ /** Basic tests fetching the same number of channels as went in */ diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc index 38ce61326..8136253e2 100644 --- a/test/burnt_subtitle_test.cc +++ b/test/burnt_subtitle_test.cc @@ -18,21 +18,23 @@ */ + /** @file test/burnt_subtitle_test.cc * @brief Test the burning of subtitles into the DCP. * @ingroup feature */ -#include "lib/plain_text_content.h" + +#include "lib/config.h" +#include "lib/content_factory.h" +#include "lib/dcp_content.h" +#include "lib/dcp_content_type.h" #include "lib/dcp_text_content.h" #include "lib/film.h" +#include "lib/log_entry.h" +#include "lib/plain_text_content.h" #include "lib/ratio.h" -#include "lib/dcp_content_type.h" #include "lib/text_content.h" -#include "lib/dcp_content.h" -#include "lib/content_factory.h" -#include "lib/config.h" -#include "lib/log_entry.h" #include "test.h" #include #include @@ -45,15 +47,14 @@ #include #include #include -#include -using std::cout; -using std::map; -using std::shared_ptr; + using std::dynamic_pointer_cast; using std::make_shared; +using std::map; using namespace dcpomatic; + /** Build a small DCP with no picture and a single subtitle overlaid onto it from a SubRip file */ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip) { diff --git a/test/butler_test.cc b/test/butler_test.cc index 97e4ccc0e..1c59de798 100644 --- a/test/butler_test.cc +++ b/test/butler_test.cc @@ -32,7 +32,6 @@ using std::make_shared; -using std::shared_ptr; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; #endif diff --git a/test/closed_caption_test.cc b/test/closed_caption_test.cc index d1cb9c3e3..80effc9a0 100644 --- a/test/closed_caption_test.cc +++ b/test/closed_caption_test.cc @@ -18,19 +18,21 @@ */ + #include "lib/film.h" -#include "lib/text_content.h" #include "lib/string_text_file_content.h" +#include "lib/text_content.h" #include "test.h" -#include #include +#include #include #include #include + using std::list; using std::make_shared; -using std::shared_ptr; + /** Basic test that Interop closed captions are written */ BOOST_AUTO_TEST_CASE (closed_caption_test1) diff --git a/test/colour_conversion_test.cc b/test/colour_conversion_test.cc index c48a0b63a..4ac89e290 100644 --- a/test/colour_conversion_test.cc +++ b/test/colour_conversion_test.cc @@ -35,7 +35,6 @@ using std::cout; using std::make_shared; -using std::shared_ptr; BOOST_AUTO_TEST_CASE (colour_conversion_test1) diff --git a/test/content_test.cc b/test/content_test.cc index 12e653875..85862af82 100644 --- a/test/content_test.cc +++ b/test/content_test.cc @@ -35,7 +35,6 @@ #include -using std::shared_ptr; using namespace dcpomatic; diff --git a/test/cpl_hash_test.cc b/test/cpl_hash_test.cc index de9b9b900..39c36561b 100644 --- a/test/cpl_hash_test.cc +++ b/test/cpl_hash_test.cc @@ -35,7 +35,6 @@ using std::make_shared; -using std::shared_ptr; using std::string; @@ -44,7 +43,7 @@ BOOST_AUTO_TEST_CASE (hash_added_to_imported_dcp_test) using namespace boost::filesystem; string const ov_name = "hash_added_to_imported_dcp_test_ov"; - shared_ptr ov = new_test_film2 ( + auto ov = new_test_film2( ov_name, content_factory("test/data/flat_red.png") ); diff --git a/test/dcp_decoder_test.cc b/test/dcp_decoder_test.cc index da4f6dcbb..c9474b998 100644 --- a/test/dcp_decoder_test.cc +++ b/test/dcp_decoder_test.cc @@ -42,10 +42,9 @@ using std::list; +using std::make_shared; using std::string; using std::vector; -using std::make_shared; -using std::shared_ptr; /* Check that DCPDecoder reuses old data when it should */ diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc index a7ec34514..6798cf678 100644 --- a/test/dcp_subtitle_test.cc +++ b/test/dcp_subtitle_test.cc @@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test) film->examine_and_add_content (content); BOOST_REQUIRE (!wait_for_jobs ()); - shared_ptr decoder (new DCPDecoder (film, content, false, false, shared_ptr())); + auto decoder = make_shared(film, content, false, false, shared_ptr()); decoder->only_text()->PlainStart.connect (bind (store, _1)); stored = optional (); diff --git a/test/digest_test.cc b/test/digest_test.cc index 59a8cb7a7..2d49768f7 100644 --- a/test/digest_test.cc +++ b/test/digest_test.cc @@ -25,11 +25,11 @@ */ -#include "lib/film.h" -#include "lib/image_content.h" -#include "lib/dcp_content_type.h" #include "lib/compose.hpp" #include "lib/config.h" +#include "lib/dcp_content_type.h" +#include "lib/film.h" +#include "lib/image_content.h" #include "test.h" #include #include @@ -38,9 +38,8 @@ using std::list; -using std::string; -using std::shared_ptr; using std::make_shared; +using std::string; static string diff --git a/test/ffmpeg_audio_test.cc b/test/ffmpeg_audio_test.cc index ea7293f13..054567d3b 100644 --- a/test/ffmpeg_audio_test.cc +++ b/test/ffmpeg_audio_test.cc @@ -46,7 +46,6 @@ using std::make_shared; using std::string; -using std::shared_ptr; BOOST_AUTO_TEST_CASE (ffmpeg_audio_test) diff --git a/test/ffmpeg_dcp_test.cc b/test/ffmpeg_dcp_test.cc index 0d56f4290..c1c322948 100644 --- a/test/ffmpeg_dcp_test.cc +++ b/test/ffmpeg_dcp_test.cc @@ -27,19 +27,18 @@ */ -#include -#include -#include -#include "lib/film.h" +#include "lib/dcp_content_type.h" #include "lib/ffmpeg_content.h" +#include "lib/film.h" #include "lib/ratio.h" -#include "lib/dcp_content_type.h" #include "lib/video_content.h" #include "test.h" +#include +#include +#include using std::make_shared; -using std::shared_ptr; BOOST_AUTO_TEST_CASE (ffmpeg_dcp_test) diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc index 0881d2e2e..90bac56ef 100644 --- a/test/ffmpeg_encoder_test.cc +++ b/test/ffmpeg_encoder_test.cc @@ -40,9 +40,8 @@ #include -using std::string; -using std::shared_ptr; using std::make_shared; +using std::string; using namespace dcpomatic; @@ -387,9 +386,9 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test8) /** 7.1/HI/VI (i.e. 12-channel) project */ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test9) { - shared_ptr film = new_test_film ("ffmpeg_encoder_prores_test9"); - film->set_name ("ffmpeg_encoder_prores_test9"); auto c = make_shared(TestPaths::private_data() / "bbc405.png"); + auto film = new_test_film2("ffmpeg_encoder_prores_test9", { c }); + film->set_name ("ffmpeg_encoder_prores_test9"); film->set_container (Ratio::from_id ("185")); film->set_audio_channels (12); diff --git a/test/ffmpeg_examiner_test.cc b/test/ffmpeg_examiner_test.cc index 9dfb0f3dc..c745335ae 100644 --- a/test/ffmpeg_examiner_test.cc +++ b/test/ffmpeg_examiner_test.cc @@ -33,7 +33,6 @@ using std::make_shared; -using std::shared_ptr; using namespace dcpomatic; diff --git a/test/ffmpeg_pts_offset_test.cc b/test/ffmpeg_pts_offset_test.cc index 4aa4c1d9a..1f994374d 100644 --- a/test/ffmpeg_pts_offset_test.cc +++ b/test/ffmpeg_pts_offset_test.cc @@ -25,13 +25,13 @@ */ -#include -#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 "lib/ffmpeg_audio_stream.h" +#include "lib/ffmpeg_content.h" +#include "lib/ffmpeg_decoder.h" +#include "lib/film.h" #include "test.h" +#include using std::make_shared; diff --git a/test/file_naming_test.cc b/test/file_naming_test.cc index 7175e209a..4c29f1919 100644 --- a/test/file_naming_test.cc +++ b/test/file_naming_test.cc @@ -40,7 +40,6 @@ using std::make_shared; -using std::shared_ptr; using std::string; diff --git a/test/frame_rate_test.cc b/test/frame_rate_test.cc index 610ac0380..d54868b3f 100644 --- a/test/frame_rate_test.cc +++ b/test/frame_rate_test.cc @@ -18,24 +18,26 @@ */ + /** @file test/frame_rate_test.cc * @brief Tests for FrameRateChange and the computation of the best * frame rate for the DCP. * @ingroup feature */ -#include -#include "lib/film.h" + +#include "lib/audio_content.h" #include "lib/config.h" -#include "lib/ffmpeg_content.h" -#include "lib/playlist.h" #include "lib/ffmpeg_audio_stream.h" +#include "lib/ffmpeg_content.h" +#include "lib/film.h" #include "lib/frame_rate_change.h" +#include "lib/playlist.h" #include "lib/video_content.h" -#include "lib/audio_content.h" #include "test.h" +#include + -using std::shared_ptr; /* Test Playlist::best_dcp_frame_rate and FrameRateChange with a single piece of content. diff --git a/test/image_content_fade_test.cc b/test/image_content_fade_test.cc index 70755f22a..39cdfe602 100644 --- a/test/image_content_fade_test.cc +++ b/test/image_content_fade_test.cc @@ -29,7 +29,6 @@ using std::string; using std::list; -using std::shared_ptr; BOOST_AUTO_TEST_CASE (image_content_fade_test) diff --git a/test/image_proxy_test.cc b/test/image_proxy_test.cc index 210f32d40..572f31c81 100644 --- a/test/image_proxy_test.cc +++ b/test/image_proxy_test.cc @@ -26,7 +26,6 @@ using std::make_shared; -using std::shared_ptr; static const boost::filesystem::path data_file0 = TestPaths::private_data() / "player_seek_test_0.png"; diff --git a/test/import_dcp_test.cc b/test/import_dcp_test.cc index e759289be..e4545b7b0 100644 --- a/test/import_dcp_test.cc +++ b/test/import_dcp_test.cc @@ -47,7 +47,6 @@ using std::dynamic_pointer_cast; using std::make_shared; using std::map; -using std::shared_ptr; using std::string; using std::vector; diff --git a/test/interrupt_encoder_test.cc b/test/interrupt_encoder_test.cc index 2e839336d..f0755d3a0 100644 --- a/test/interrupt_encoder_test.cc +++ b/test/interrupt_encoder_test.cc @@ -38,7 +38,6 @@ using std::make_shared; -using std::shared_ptr; /** Interrupt a DCP encode when it is in progress, as this used to (still does?) diff --git a/test/j2k_bandwidth_test.cc b/test/j2k_bandwidth_test.cc index d7db89992..70182f409 100644 --- a/test/j2k_bandwidth_test.cc +++ b/test/j2k_bandwidth_test.cc @@ -36,7 +36,6 @@ using std::make_shared; using std::string; -using std::shared_ptr; static void diff --git a/test/markers_test.cc b/test/markers_test.cc index c0f73882d..afea00d52 100644 --- a/test/markers_test.cc +++ b/test/markers_test.cc @@ -37,7 +37,6 @@ using std::string; using boost::optional; -using std::shared_ptr; /** Check that FFOC and LFOC are automatically added if not specified */ diff --git a/test/no_use_video_test.cc b/test/no_use_video_test.cc index d6a011ff2..0ad17d7b9 100644 --- a/test/no_use_video_test.cc +++ b/test/no_use_video_test.cc @@ -43,7 +43,6 @@ using std::dynamic_pointer_cast; using std::make_shared; -using std::shared_ptr; /** Overlay two video-only bits of content, don't use the video on one and diff --git a/test/optimise_stills_test.cc b/test/optimise_stills_test.cc index 6374d5474..cad7d7d26 100644 --- a/test/optimise_stills_test.cc +++ b/test/optimise_stills_test.cc @@ -38,7 +38,6 @@ using std::dynamic_pointer_cast; using std::getline; using std::ifstream; -using std::shared_ptr; using std::string; using std::vector; using boost::starts_with; diff --git a/test/overlap_video_test.cc b/test/overlap_video_test.cc index 12a26fe60..92002496a 100644 --- a/test/overlap_video_test.cc +++ b/test/overlap_video_test.cc @@ -35,7 +35,6 @@ #include #include #include -#include #include diff --git a/test/pulldown_detect_test.cc b/test/pulldown_detect_test.cc index 047f84b69..432bdf26f 100644 --- a/test/pulldown_detect_test.cc +++ b/test/pulldown_detect_test.cc @@ -19,23 +19,19 @@ */ -#include "test.h" #include "lib/content.h" #include "lib/content_factory.h" #include "lib/film.h" +#include "test.h" #include -using std::shared_ptr; - - BOOST_AUTO_TEST_CASE (pulldown_detect_test1) { - shared_ptr film = new_test_film2 ("pulldown_detect_test1"); - shared_ptr content = content_factory(TestPaths::private_data() / "greatbrain.mkv")[0]; - film->examine_and_add_content (content); - BOOST_REQUIRE (!wait_for_jobs()); - BOOST_REQUIRE (static_cast(content->video_frame_rate())); - BOOST_CHECK_CLOSE (content->video_frame_rate().get(), 23.976, 0.1); + auto content = content_factory(TestPaths::private_data() / "greatbrain.mkv"); + auto film = new_test_film2("pulldown_detect_test1", content); + + BOOST_REQUIRE(static_cast(content[0]->video_frame_rate())); + BOOST_CHECK_CLOSE(content[0]->video_frame_rate().get(), 23.976, 0.1); } diff --git a/test/recover_test.cc b/test/recover_test.cc index b36dad05a..0288da188 100644 --- a/test/recover_test.cc +++ b/test/recover_test.cc @@ -40,7 +40,6 @@ using std::cout; using std::make_shared; -using std::shared_ptr; using std::string; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; @@ -58,13 +57,13 @@ note (dcp::NoteType t, string n) BOOST_AUTO_TEST_CASE (recover_test_2d) { - shared_ptr film = new_test_film ("recover_test_2d"); + auto film = new_test_film("recover_test_2d"); film->set_interop (false); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR")); film->set_container (Ratio::from_id ("185")); film->set_name ("recover_test"); - shared_ptr content (new FFmpegContent("test/data/count300bd24.m2ts")); + auto content = make_shared("test/data/count300bd24.m2ts"); film->examine_and_add_content (content); BOOST_REQUIRE (!wait_for_jobs()); @@ -85,8 +84,8 @@ BOOST_AUTO_TEST_CASE (recover_test_2d) make_and_verify_dcp (film, { dcp::VerificationNote::Code::MISSING_FFEC_IN_FEATURE, dcp::VerificationNote::Code::MISSING_FFMC_IN_FEATURE }); - shared_ptr A (new dcp::MonoPictureAsset ("build/test/recover_test_2d/original.mxf")); - shared_ptr B (new dcp::MonoPictureAsset (video)); + auto A = make_shared("build/test/recover_test_2d/original.mxf"); + auto B = make_shared(video); dcp::EqualityOptions eq; BOOST_CHECK (A->equals (B, eq, boost::bind (¬e, _1, _2))); diff --git a/test/reels_test.cc b/test/reels_test.cc index 092c206f0..7fbf77f74 100644 --- a/test/reels_test.cc +++ b/test/reels_test.cc @@ -110,21 +110,21 @@ BOOST_AUTO_TEST_CASE (reels_test2) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST")); { - shared_ptr c (new ImageContent("test/data/flat_red.png")); + auto c = make_shared("test/data/flat_red.png"); film->examine_and_add_content (c); BOOST_REQUIRE (!wait_for_jobs()); c->video->set_length (24); } { - shared_ptr c (new ImageContent("test/data/flat_green.png")); + auto c = make_shared("test/data/flat_green.png"); film->examine_and_add_content (c); BOOST_REQUIRE (!wait_for_jobs()); c->video->set_length (24); } { - shared_ptr c (new ImageContent("test/data/flat_blue.png")); + auto c = make_shared("test/data/flat_blue.png"); film->examine_and_add_content (c); BOOST_REQUIRE (!wait_for_jobs()); c->video->set_length (24); @@ -200,7 +200,7 @@ BOOST_AUTO_TEST_CASE (reels_test4) /* 4 piece of 1s-long content */ shared_ptr content[4]; for (int i = 0; i < 4; ++i) { - content[i].reset (new ImageContent("test/data/flat_green.png")); + content[i] = make_shared("test/data/flat_green.png"); film->examine_and_add_content (content[i]); BOOST_REQUIRE (!wait_for_jobs()); content[i]->video->set_length (24); diff --git a/test/remake_id_test.cc b/test/remake_id_test.cc index d2cd54d88..0a29f9461 100644 --- a/test/remake_id_test.cc +++ b/test/remake_id_test.cc @@ -19,24 +19,23 @@ */ -#include "lib/ffmpeg_content.h" +#include "lib/config.h" #include "lib/content_factory.h" -#include "lib/text_content.h" -#include "lib/job_manager.h" -#include "lib/film.h" #include "lib/dcp_content.h" #include "lib/examine_content_job.h" -#include "lib/config.h" +#include "lib/ffmpeg_content.h" +#include "lib/film.h" +#include "lib/job_manager.h" +#include "lib/text_content.h" #include "test.h" #include #include -using std::string; -using std::vector; -using std::shared_ptr; using std::dynamic_pointer_cast; using std::make_shared; +using std::string; +using std::vector; using boost::optional; diff --git a/test/remake_with_subtitle_test.cc b/test/remake_with_subtitle_test.cc index 68f5c4ebb..57322d3ac 100644 --- a/test/remake_with_subtitle_test.cc +++ b/test/remake_with_subtitle_test.cc @@ -27,7 +27,6 @@ #include -using std::shared_ptr; using std::dynamic_pointer_cast; diff --git a/test/repeat_frame_test.cc b/test/repeat_frame_test.cc index b43312e59..afdaf48a6 100644 --- a/test/repeat_frame_test.cc +++ b/test/repeat_frame_test.cc @@ -38,7 +38,6 @@ using std::make_shared; -using std::shared_ptr; BOOST_AUTO_TEST_CASE (repeat_frame_test) diff --git a/test/required_disk_space_test.cc b/test/required_disk_space_test.cc index 8a35ce902..db659c2c9 100644 --- a/test/required_disk_space_test.cc +++ b/test/required_disk_space_test.cc @@ -34,7 +34,6 @@ using std::dynamic_pointer_cast; using std::make_shared; -using std::shared_ptr; void check_within_n (int64_t a, int64_t b, int64_t n) diff --git a/test/resampler_test.cc b/test/resampler_test.cc index 8009cc9f9..3bab146da 100644 --- a/test/resampler_test.cc +++ b/test/resampler_test.cc @@ -35,7 +35,6 @@ using std::cout; using std::make_shared; using std::pair; -using std::shared_ptr; static void diff --git a/test/shuffler_test.cc b/test/shuffler_test.cc index d1c5b8533..2099a0923 100644 --- a/test/shuffler_test.cc +++ b/test/shuffler_test.cc @@ -1,9 +1,32 @@ -#include "lib/shuffler.h" -#include "lib/piece.h" +/* + Copyright (C) 2020-2021 Carl Hetherington + + 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. + + 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 DCP-o-matic. If not, see . + +*/ + + #include "lib/content_video.h" +#include "lib/piece.h" +#include "lib/shuffler.h" #include + using std::list; +using std::make_shared; using std::shared_ptr; using std::weak_ptr; using boost::optional; @@ -15,7 +38,7 @@ using namespace boost::placeholders; static void push (Shuffler& s, int frame, Eyes eyes) { - shared_ptr piece (new Piece (shared_ptr(), shared_ptr(), FrameRateChange(24, 24))); + auto piece = make_shared(shared_ptr(), shared_ptr(), FrameRateChange(24, 24)); ContentVideo cv; cv.frame = frame; cv.eyes = eyes; diff --git a/test/silence_padding_test.cc b/test/silence_padding_test.cc index 28218e22f..dd02d200d 100644 --- a/test/silence_padding_test.cc +++ b/test/silence_padding_test.cc @@ -43,7 +43,6 @@ using std::make_shared; using std::string; -using std::shared_ptr; using boost::lexical_cast; diff --git a/test/skip_frame_test.cc b/test/skip_frame_test.cc index d096e50e5..4c4098c2a 100644 --- a/test/skip_frame_test.cc +++ b/test/skip_frame_test.cc @@ -37,7 +37,6 @@ #include "lib/video_content.h" -using std::shared_ptr; using std::make_shared; diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc index 7caef5245..935462867 100644 --- a/test/srt_subtitle_test.cc +++ b/test/srt_subtitle_test.cc @@ -25,24 +25,24 @@ */ -#include "lib/film.h" -#include "lib/string_text_file_content.h" #include "lib/dcp_content_type.h" +#include "lib/film.h" #include "lib/font.h" #include "lib/ratio.h" +#include "lib/string_text_file_content.h" #include "lib/text_content.h" #include "test.h" #include #include -#include #include +#include #include -using std::string; using std::list; -using std::shared_ptr; using std::make_shared; +using std::shared_ptr; +using std::string; using namespace dcpomatic; diff --git a/test/ssa_subtitle_test.cc b/test/ssa_subtitle_test.cc index 3a1430696..8132ba3a0 100644 --- a/test/ssa_subtitle_test.cc +++ b/test/ssa_subtitle_test.cc @@ -25,11 +25,11 @@ */ -#include "lib/film.h" -#include "lib/string_text_file_content.h" #include "lib/dcp_content_type.h" +#include "lib/film.h" #include "lib/font.h" #include "lib/ratio.h" +#include "lib/string_text_file_content.h" #include "lib/text_content.h" #include "test.h" #include @@ -37,10 +37,9 @@ #include -using std::string; using std::list; -using std::shared_ptr; using std::make_shared; +using std::string; /** Make a DCP with subs from a .ssa file */ diff --git a/test/stream_test.cc b/test/stream_test.cc index fe64e147e..a180739ab 100644 --- a/test/stream_test.cc +++ b/test/stream_test.cc @@ -18,13 +18,15 @@ */ + /** @test test/stream_test.cc * @brief Some simple tests of FFmpegAudioStream. */ -#include "lib/film.h" -#include "lib/ffmpeg_content.h" + #include "lib/ffmpeg_audio_stream.h" +#include "lib/ffmpeg_content.h" +#include "lib/film.h" #include #include LIBDCP_DISABLE_WARNINGS @@ -32,14 +34,15 @@ LIBDCP_DISABLE_WARNINGS LIBDCP_ENABLE_WARNINGS #include -using std::pair; + using std::list; -using std::shared_ptr; +using std::pair; + BOOST_AUTO_TEST_CASE (stream_test) { xmlpp::Document doc; - xmlpp::Element* root = doc.create_root_node ("FFmpegAudioStream"); + auto root = doc.create_root_node("FFmpegAudioStream"); root->add_child("Name")->add_child_text ("hello there world"); root->add_child("Id")->add_child_text ("4"); root->add_child("FrameRate")->add_child_text ("44100"); @@ -47,29 +50,29 @@ BOOST_AUTO_TEST_CASE (stream_test) /* This is the state file version 5 description of the mapping */ - xmlpp::Element* mapping = root->add_child("Mapping"); + auto mapping = root->add_child("Mapping"); mapping->add_child("ContentChannels")->add_child_text ("2"); { /* L -> L */ - xmlpp::Element* map = mapping->add_child ("Map"); + auto map = mapping->add_child("Map"); map->add_child("ContentIndex")->add_child_text ("0"); map->add_child("DCP")->add_child_text ("0"); } { /* L -> C */ - xmlpp::Element* map = mapping->add_child ("Map"); + auto map = mapping->add_child("Map"); map->add_child("ContentIndex")->add_child_text ("0"); map->add_child("DCP")->add_child_text ("2"); } { /* R -> R */ - xmlpp::Element* map = mapping->add_child ("Map"); + auto map = mapping->add_child("Map"); map->add_child("ContentIndex")->add_child_text ("1"); map->add_child("DCP")->add_child_text ("1"); } { /* R -> C */ - xmlpp::Element* map = mapping->add_child ("Map"); + auto map = mapping->add_child("Map"); map->add_child("ContentIndex")->add_child_text ("1"); map->add_child("DCP")->add_child_text ("2"); } diff --git a/test/subtitle_charset_test.cc b/test/subtitle_charset_test.cc index 333a895bf..84f249c65 100644 --- a/test/subtitle_charset_test.cc +++ b/test/subtitle_charset_test.cc @@ -28,7 +28,6 @@ #include -using std::shared_ptr; using std::dynamic_pointer_cast; diff --git a/test/subtitle_font_id_test.cc b/test/subtitle_font_id_test.cc index 95fd9da08..42ed8858f 100644 --- a/test/subtitle_font_id_test.cc +++ b/test/subtitle_font_id_test.cc @@ -35,7 +35,6 @@ using std::make_shared; -using std::shared_ptr; BOOST_AUTO_TEST_CASE(full_dcp_subtitle_font_id_test) diff --git a/test/subtitle_language_test.cc b/test/subtitle_language_test.cc index 7703a4275..442910e90 100644 --- a/test/subtitle_language_test.cc +++ b/test/subtitle_language_test.cc @@ -36,7 +36,6 @@ using std::string; using std::vector; -using std::shared_ptr; BOOST_AUTO_TEST_CASE (subtitle_language_interop_test) diff --git a/test/subtitle_metadata_test.cc b/test/subtitle_metadata_test.cc index 91372d2a5..ce925defb 100644 --- a/test/subtitle_metadata_test.cc +++ b/test/subtitle_metadata_test.cc @@ -31,7 +31,6 @@ using std::make_shared; -using std::shared_ptr; using std::vector; diff --git a/test/subtitle_reel_number_test.cc b/test/subtitle_reel_number_test.cc index 98974f1b3..743d809dd 100644 --- a/test/subtitle_reel_number_test.cc +++ b/test/subtitle_reel_number_test.cc @@ -36,7 +36,6 @@ using std::dynamic_pointer_cast; using std::make_shared; -using std::shared_ptr; using std::string; diff --git a/test/subtitle_reel_test.cc b/test/subtitle_reel_test.cc index f22698d1f..d7eb90d25 100644 --- a/test/subtitle_reel_test.cc +++ b/test/subtitle_reel_test.cc @@ -19,9 +19,9 @@ */ #include "lib/content_factory.h" +#include "lib/dcp_subtitle_content.h" #include "lib/film.h" #include "lib/image_content.h" -#include "lib/dcp_subtitle_content.h" #include "lib/text_content.h" #include "lib/video_content.h" #include "test.h" @@ -35,9 +35,8 @@ using std::list; -using std::string; -using std::shared_ptr; using std::make_shared; +using std::string; using boost::optional; @@ -72,7 +71,7 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_test) dcp::DCP dcp ("build/test/subtitle_reel_test/" + film->dcp_name()); dcp.read (); BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U); - shared_ptr cpl = dcp.cpls().front(); + auto cpl = dcp.cpls().front(); auto reels = cpl->reels (); BOOST_REQUIRE_EQUAL (reels.size(), 2U); diff --git a/test/subtitle_trim_test.cc b/test/subtitle_trim_test.cc index f0fea4765..b9eccbb6f 100644 --- a/test/subtitle_trim_test.cc +++ b/test/subtitle_trim_test.cc @@ -26,7 +26,6 @@ using std::make_shared; -using std::shared_ptr; /** Check for no crash when trimming DCP subtitles (#1275) */ diff --git a/test/threed_test.cc b/test/threed_test.cc index 4b6b727d4..a2e116f9a 100644 --- a/test/threed_test.cc +++ b/test/threed_test.cc @@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE (threed_test2) */ BOOST_AUTO_TEST_CASE (threed_test3) { - shared_ptr film = new_test_film2 ("threed_test3"); + auto film = new_test_film2 ("threed_test3"); auto L = make_shared("test/data/test.mp4"); film->examine_and_add_content (L); auto R = make_shared("test/data/test.mp4"); @@ -227,7 +227,7 @@ BOOST_AUTO_TEST_CASE (threed_test7) */ BOOST_AUTO_TEST_CASE (threed_test_separate_files_slightly_different_lengths) { - shared_ptr film = new_test_film2 ("threed_test3"); + auto film = new_test_film2("threed_test3"); auto L = make_shared("test/data/test.mp4"); film->examine_and_add_content (L); auto R = make_shared("test/data/test.mp4"); @@ -248,7 +248,7 @@ BOOST_AUTO_TEST_CASE (threed_test_separate_files_slightly_different_lengths) */ BOOST_AUTO_TEST_CASE (threed_test_separate_files_very_different_lengths) { - shared_ptr film = new_test_film2 ("threed_test3"); + auto film = new_test_film2("threed_test3"); auto L = make_shared("test/data/test.mp4"); film->examine_and_add_content (L); auto R = make_shared("test/data/test.mp4"); diff --git a/test/util_test.cc b/test/util_test.cc index a45c144b1..872e6f885 100644 --- a/test/util_test.cc +++ b/test/util_test.cc @@ -35,7 +35,6 @@ using std::list; -using std::shared_ptr; using std::string; using std::vector; #if BOOST_VERSION >= 106100 diff --git a/test/vf_kdm_test.cc b/test/vf_kdm_test.cc index e52b11e67..259f54031 100644 --- a/test/vf_kdm_test.cc +++ b/test/vf_kdm_test.cc @@ -41,7 +41,6 @@ using std::make_shared; -using std::shared_ptr; using std::string; using std::vector; diff --git a/test/video_mxf_content_test.cc b/test/video_mxf_content_test.cc index ca3040716..5edb85882 100644 --- a/test/video_mxf_content_test.cc +++ b/test/video_mxf_content_test.cc @@ -26,19 +26,18 @@ -#include "lib/film.h" -#include "lib/video_mxf_content.h" #include "lib/content_factory.h" #include "lib/dcp_content_type.h" +#include "lib/film.h" #include "lib/ratio.h" +#include "lib/video_mxf_content.h" #include "test.h" #include #include -using std::make_shared; -using std::shared_ptr; using std::dynamic_pointer_cast; +using std::make_shared; static boost::filesystem::path ref_mxf = "test/data/scaling_test_185_185/j2c_6a2ffab1-9ea5-4428-9027-9d458363c95f.mxf"; -- 2.30.2