X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fno_use_video_test.cc;h=d6a011ff233d494ec28e7a248158f75be7135738;hb=25eb7aa723af004162fc7f95995df250c4e4571b;hp=d2589d123944dffc1f02445df70102f4c37e4ea9;hpb=b29eb5107c5e77fe01e43010e1582e733f6ceea1;p=dcpomatic.git diff --git a/test/no_use_video_test.cc b/test/no_use_video_test.cc index d2589d123..d6a011ff2 100644 --- a/test/no_use_video_test.cc +++ b/test/no_use_video_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2020 Carl Hetherington + Copyright (C) 2020-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -41,8 +41,9 @@ #include -using boost::dynamic_pointer_cast; -using boost::shared_ptr; +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 @@ -50,9 +51,9 @@ using boost::shared_ptr; */ BOOST_AUTO_TEST_CASE (no_use_video_test1) { - shared_ptr film = new_test_film2 ("no_use_video_test1"); - shared_ptr A = content_factory ("test/data/flat_red.png").front(); - shared_ptr B = content_factory ("test/data/flat_green.png").front(); + auto film = new_test_film2 ("no_use_video_test1"); + auto A = content_factory("test/data/flat_red.png")[0]; + auto B = content_factory("test/data/flat_green.png")[0]; film->examine_and_add_content (A); film->examine_and_add_content (B); BOOST_REQUIRE (!wait_for_jobs()); @@ -61,8 +62,7 @@ BOOST_AUTO_TEST_CASE (no_use_video_test1) B->set_position (film, dcpomatic::DCPTime()); A->video->set_use (false); - film->make_dcp (); - BOOST_REQUIRE (!wait_for_jobs()); + make_and_verify_dcp (film); check_dcp ("test/data/no_use_video_test1", film); } @@ -71,9 +71,9 @@ BOOST_AUTO_TEST_CASE (no_use_video_test1) /** Overlay two muxed sources and disable the video on one */ BOOST_AUTO_TEST_CASE (no_use_video_test2) { - shared_ptr film = new_test_film2 ("no_use_video_test2"); - shared_ptr A = content_factory (TestPaths::private_data / "dolby_aurora.vob").front(); - shared_ptr B = content_factory (TestPaths::private_data / "big_buck_bunny_trailer_480p.mov").front(); + auto film = new_test_film2 ("no_use_video_test2"); + auto A = content_factory(TestPaths::private_data() / "dolby_aurora.vob")[0]; + auto B = content_factory(TestPaths::private_data() / "big_buck_bunny_trailer_480p.mov")[0]; film->examine_and_add_content (A); film->examine_and_add_content (B); BOOST_REQUIRE (!wait_for_jobs()); @@ -82,41 +82,38 @@ BOOST_AUTO_TEST_CASE (no_use_video_test2) B->set_position (film, dcpomatic::DCPTime()); A->video->set_use (false); - film->make_dcp (); - BOOST_REQUIRE (!wait_for_jobs()); + make_and_verify_dcp (film); - check_dcp ("test/data/no_use_video_test2", film); + check_dcp (TestPaths::private_data() / "no_use_video_test2", film); } /** Make two DCPs and make a VF with the audio from one and the video from another */ BOOST_AUTO_TEST_CASE (no_use_video_test3) { - shared_ptr ov_a = new_test_film2 ("no_use_video_test3_ov_a"); - shared_ptr ov_a_pic = content_factory ("test/data/flat_red.png").front(); + auto ov_a = new_test_film2 ("no_use_video_test3_ov_a"); + auto ov_a_pic = content_factory("test/data/flat_red.png")[0]; BOOST_REQUIRE (ov_a_pic); - shared_ptr ov_a_snd = content_factory ("test/data/sine_16_48_220_10.wav").front(); + auto ov_a_snd = content_factory("test/data/sine_16_48_220_10.wav")[0]; BOOST_REQUIRE (ov_a_snd); ov_a->examine_and_add_content (ov_a_pic); ov_a->examine_and_add_content (ov_a_snd); BOOST_REQUIRE (!wait_for_jobs()); - ov_a->make_dcp (); - BOOST_REQUIRE (!wait_for_jobs()); + make_and_verify_dcp (ov_a); - shared_ptr ov_b = new_test_film2 ("no_use_video_test3_ov_b"); - shared_ptr ov_b_pic = content_factory ("test/data/flat_green.png").front(); + auto ov_b = new_test_film2("no_use_video_test3_ov_b"); + auto ov_b_pic = content_factory("test/data/flat_green.png")[0]; BOOST_REQUIRE (ov_b_pic); - shared_ptr ov_b_snd = content_factory ("test/data/sine_16_48_880_10.wav").front(); + auto ov_b_snd = content_factory("test/data/sine_16_48_880_10.wav")[0]; BOOST_REQUIRE (ov_b_snd); ov_b->examine_and_add_content (ov_b_pic); ov_b->examine_and_add_content (ov_b_snd); BOOST_REQUIRE (!wait_for_jobs()); - ov_b->make_dcp (); - BOOST_REQUIRE (!wait_for_jobs()); + make_and_verify_dcp (ov_b); - shared_ptr vf = new_test_film2 ("no_use_video_test3_vf"); - shared_ptr A (new DCPContent(ov_a->dir(ov_a->dcp_name()))); - shared_ptr B (new DCPContent(ov_b->dir(ov_b->dcp_name()))); + auto vf = new_test_film2 ("no_use_video_test3_vf"); + auto A = make_shared(ov_a->dir(ov_a->dcp_name())); + auto B = make_shared(ov_b->dir(ov_b->dcp_name())); vf->examine_and_add_content (A); vf->examine_and_add_content (B); BOOST_REQUIRE (!wait_for_jobs()); @@ -131,26 +128,25 @@ BOOST_AUTO_TEST_CASE (no_use_video_test3) A->set_reference_audio (true); B->set_reference_video (true); - vf->make_dcp (); - BOOST_REQUIRE (!wait_for_jobs()); + make_and_verify_dcp (vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET}); dcp::DCP ov_a_check (ov_a->dir(ov_a->dcp_name())); ov_a_check.read (); BOOST_REQUIRE_EQUAL (ov_a_check.cpls().size(), 1U); BOOST_REQUIRE_EQUAL (ov_a_check.cpls().front()->reels().size(), 1U); - shared_ptr ov_a_reel (ov_a_check.cpls().front()->reels().front()); + auto ov_a_reel (ov_a_check.cpls().front()->reels().front()); dcp::DCP ov_b_check (ov_b->dir(ov_b->dcp_name())); ov_b_check.read (); BOOST_REQUIRE_EQUAL (ov_b_check.cpls().size(), 1U); BOOST_REQUIRE_EQUAL (ov_b_check.cpls().front()->reels().size(), 1U); - shared_ptr ov_b_reel (ov_b_check.cpls().front()->reels().front()); + auto ov_b_reel (ov_b_check.cpls().front()->reels().front()); dcp::DCP vf_check (vf->dir(vf->dcp_name())); vf_check.read (); BOOST_REQUIRE_EQUAL (vf_check.cpls().size(), 1U); BOOST_REQUIRE_EQUAL (vf_check.cpls().front()->reels().size(), 1U); - shared_ptr vf_reel (vf_check.cpls().front()->reels().front()); + auto vf_reel (vf_check.cpls().front()->reels().front()); BOOST_CHECK_EQUAL (vf_reel->main_picture()->asset_ref().id(), ov_b_reel->main_picture()->asset_ref().id()); BOOST_CHECK_EQUAL (vf_reel->main_sound()->asset_ref().id(), ov_a_reel->main_sound()->asset_ref().id());