X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=test%2Fsubtitle_reel_number_test.cc;h=98974f1b3c7db98a39852ecc9367998425c784df;hp=0726ee2e418bcb76310669b52a0eba07c2e50b09;hb=fb0e2ead59a442700c671270c7d57b5bffeaeab3;hpb=254b3044d72de6b033d7c584f5abd2b9aa70aad5 diff --git a/test/subtitle_reel_number_test.cc b/test/subtitle_reel_number_test.cc index 0726ee2e4..98974f1b3 100644 --- a/test/subtitle_reel_number_test.cc +++ b/test/subtitle_reel_number_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2017 Carl Hetherington + Copyright (C) 2017-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,6 +18,7 @@ */ + #include "lib/string_text_file_content.h" #include "lib/film.h" #include "lib/ratio.h" @@ -32,38 +33,40 @@ #include #include + +using std::dynamic_pointer_cast; +using std::make_shared; +using std::shared_ptr; using std::string; -using boost::shared_ptr; -using boost::dynamic_pointer_cast; + /* Check that ReelNumber is setup correctly when making multi-reel subtitled DCPs */ BOOST_AUTO_TEST_CASE (subtitle_reel_number_test) { - shared_ptr film = new_test_film ("subtitle_reel_number_test"); + auto film = new_test_film ("subtitle_reel_number_test"); film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content (new StringTextFileContent("test/data/subrip5.srt")); + auto content = make_shared("test/data/subrip5.srt"); film->examine_and_add_content (content); BOOST_REQUIRE (!wait_for_jobs ()); content->only_text()->set_use (true); content->only_text()->set_burn (false); - film->set_reel_type (REELTYPE_BY_LENGTH); + film->set_reel_type (ReelType::BY_LENGTH); film->set_interop (true); film->set_reel_length (1024 * 1024 * 512); - film->make_dcp (); - BOOST_REQUIRE (!wait_for_jobs ()); + make_and_verify_dcp (film, {dcp::VerificationNote::Code::INVALID_STANDARD}); dcp::DCP dcp ("build/test/subtitle_reel_number_test/" + film->dcp_name()); dcp.read (); - BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1); - shared_ptr cpl = dcp.cpls().front(); - BOOST_REQUIRE_EQUAL (cpl->reels().size(), 6); + BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U); + auto cpl = dcp.cpls()[0]; + BOOST_REQUIRE_EQUAL (cpl->reels().size(), 6U); int n = 1; - BOOST_FOREACH (shared_ptr i, cpl->reels()) { + for (auto i: cpl->reels()) { if (i->main_subtitle()) { - shared_ptr ass = dynamic_pointer_cast(i->main_subtitle()->asset()); + auto ass = dynamic_pointer_cast(i->main_subtitle()->asset()); BOOST_REQUIRE (ass); BOOST_CHECK_EQUAL (ass->reel_number(), dcp::raw_convert(n)); ++n;