diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-01-31 03:14:24 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-01-31 03:14:24 +0100 |
| commit | 8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8 (patch) | |
| tree | f8b25b13ac3732838be259e469d045438d999e7b /test/subtitle_reel_test.cc | |
| parent | 4985d87750c87019dfe5dc7ef44e12c45326dd0e (diff) | |
More enum class additions.
Diffstat (limited to 'test/subtitle_reel_test.cc')
| -rw-r--r-- | test/subtitle_reel_test.cc | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/test/subtitle_reel_test.cc b/test/subtitle_reel_test.cc index 906477963..c910d4aec 100644 --- a/test/subtitle_reel_test.cc +++ b/test/subtitle_reel_test.cc @@ -36,19 +36,20 @@ using std::list; using std::string; -using boost::optional; using std::shared_ptr; +using std::make_shared; +using boost::optional; /* Check that timings are done correctly for multi-reel DCPs with PNG subs */ BOOST_AUTO_TEST_CASE (subtitle_reel_test) { - shared_ptr<Film> film = new_test_film2 ("subtitle_reel_test"); + auto film = new_test_film2 ("subtitle_reel_test"); film->set_interop (true); - shared_ptr<ImageContent> red_a (new ImageContent("test/data/flat_red.png")); - shared_ptr<ImageContent> red_b (new ImageContent("test/data/flat_red.png")); - shared_ptr<DCPSubtitleContent> sub_a (new DCPSubtitleContent("test/data/png_subs/subs.xml")); - shared_ptr<DCPSubtitleContent> sub_b (new DCPSubtitleContent("test/data/png_subs/subs.xml")); + auto red_a = make_shared<ImageContent>("test/data/flat_red.png"); + auto red_b = make_shared<ImageContent>("test/data/flat_red.png"); + auto sub_a = make_shared<DCPSubtitleContent>("test/data/png_subs/subs.xml"); + auto sub_b = make_shared<DCPSubtitleContent>("test/data/png_subs/subs.xml"); film->examine_and_add_content (red_a); film->examine_and_add_content (red_b); @@ -64,7 +65,7 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_test) red_b->video->set_length (240); sub_b->set_position (film, dcpomatic::DCPTime::from_seconds(10)); - film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT); + film->set_reel_type (ReelType::BY_VIDEO_CONTENT); film->make_dcp (); BOOST_REQUIRE (!wait_for_jobs()); @@ -101,18 +102,18 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_test) */ BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test) { - shared_ptr<Film> film = new_test_film2 ("subtitle_in_all_reels_test"); + auto film = new_test_film2 ("subtitle_in_all_reels_test"); film->set_interop (false); film->set_sequence (false); - film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT); + film->set_reel_type (ReelType::BY_VIDEO_CONTENT); for (int i = 0; i < 3; ++i) { - shared_ptr<Content> video = content_factory("test/data/flat_red.png").front(); + auto video = content_factory("test/data/flat_red.png").front(); film->examine_and_add_content (video); BOOST_REQUIRE (!wait_for_jobs()); video->video->set_length (15 * 24); video->set_position (film, dcpomatic::DCPTime::from_seconds(15 * i)); } - shared_ptr<Content> subs = content_factory("test/data/15s.srt").front(); + auto subs = content_factory("test/data/15s.srt").front(); film->examine_and_add_content (subs); BOOST_REQUIRE (!wait_for_jobs()); film->make_dcp (); @@ -121,7 +122,7 @@ BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test) dcp::DCP dcp ("build/test/subtitle_in_all_reels_test/" + film->dcp_name()); dcp.read (); BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U); - shared_ptr<dcp::CPL> cpl = dcp.cpls().front(); + auto cpl = dcp.cpls()[0]; BOOST_REQUIRE_EQUAL (cpl->reels().size(), 3U); for (auto i: cpl->reels()) { @@ -135,29 +136,29 @@ BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test) */ BOOST_AUTO_TEST_CASE (closed_captions_in_all_reels_test) { - shared_ptr<Film> film = new_test_film2 ("closed_captions_in_all_reels_test"); + auto film = new_test_film2 ("closed_captions_in_all_reels_test"); film->set_interop (false); film->set_sequence (false); - film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT); + film->set_reel_type (ReelType::BY_VIDEO_CONTENT); for (int i = 0; i < 3; ++i) { - shared_ptr<Content> video = content_factory("test/data/flat_red.png").front(); + auto video = content_factory("test/data/flat_red.png").front(); film->examine_and_add_content (video); BOOST_REQUIRE (!wait_for_jobs()); video->video->set_length (15 * 24); video->set_position (film, dcpomatic::DCPTime::from_seconds(15 * i)); } - shared_ptr<Content> ccap1 = content_factory("test/data/15s.srt").front(); + auto ccap1 = content_factory("test/data/15s.srt").front(); film->examine_and_add_content (ccap1); BOOST_REQUIRE (!wait_for_jobs()); - ccap1->text.front()->set_type (TEXT_CLOSED_CAPTION); + ccap1->text.front()->set_type (TextType::CLOSED_CAPTION); ccap1->text.front()->set_dcp_track (DCPTextTrack("Test", "de-DE")); - shared_ptr<Content> ccap2 = content_factory("test/data/15s.srt").front(); + auto ccap2 = content_factory("test/data/15s.srt").front(); film->examine_and_add_content (ccap2); BOOST_REQUIRE (!wait_for_jobs()); - ccap2->text.front()->set_type (TEXT_CLOSED_CAPTION); + ccap2->text.front()->set_type (TextType::CLOSED_CAPTION); ccap2->text.front()->set_dcp_track (DCPTextTrack("Other", "en-GB")); film->make_dcp (); @@ -166,13 +167,13 @@ BOOST_AUTO_TEST_CASE (closed_captions_in_all_reels_test) dcp::DCP dcp ("build/test/closed_captions_in_all_reels_test/" + film->dcp_name()); dcp.read (); BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U); - shared_ptr<dcp::CPL> cpl = dcp.cpls().front(); + auto cpl = dcp.cpls().front(); BOOST_REQUIRE_EQUAL (cpl->reels().size(), 3U); for (auto i: cpl->reels()) { BOOST_REQUIRE_EQUAL (i->closed_captions().size(), 2U); - optional<string> first = i->closed_captions().front()->language(); - optional<string> second = i->closed_captions().back()->language(); + auto first = i->closed_captions().front()->language(); + auto second = i->closed_captions().back()->language(); BOOST_REQUIRE (first); BOOST_REQUIRE (second); BOOST_CHECK ( |
