X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=test%2Freels_test.cc;h=9a915ab2b11cdee1062d50f89b038730426f6ed6;hp=ef134811672b95c4b8b58bd9fba364e676c4283d;hb=507a389e9c5f84ec1d51e7566e38fbf42f658537;hpb=295c425291c9449188106452386b103d970291db diff --git a/test/reels_test.cc b/test/reels_test.cc index ef1348116..9a915ab2b 100644 --- a/test/reels_test.cc +++ b/test/reels_test.cc @@ -30,7 +30,7 @@ #include "lib/dcp_content_type.h" #include "lib/dcp_content.h" #include "lib/video_content.h" -#include "lib/text_subtitle_content.h" +#include "lib/plain_text_file_content.h" #include "lib/content_factory.h" #include "test.h" #include @@ -91,6 +91,7 @@ BOOST_AUTO_TEST_CASE (reels_test2) shared_ptr film = new_test_film ("reels_test2"); film->set_name ("reels_test2"); film->set_container (Ratio::from_id ("185")); + film->set_interop (false); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST")); { @@ -164,7 +165,7 @@ BOOST_AUTO_TEST_CASE (reels_test3) shared_ptr dcp (new DCPContent (film, "test/data/reels_test2")); film->examine_and_add_content (dcp); - shared_ptr sub (new TextSubtitleContent (film, "test/data/subrip.srt")); + shared_ptr sub (new PlainTextFileContent (film, "test/data/subrip.srt")); film->examine_and_add_content (sub); wait_for_jobs (); @@ -194,6 +195,7 @@ BOOST_AUTO_TEST_CASE (reels_test4) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST")); film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT); + film->set_interop (false); /* 4 piece of 1s-long content */ shared_ptr content[4]; @@ -204,7 +206,7 @@ BOOST_AUTO_TEST_CASE (reels_test4) content[i]->video->set_length (24); } - shared_ptr subs (new TextSubtitleContent (film, "test/data/subrip3.srt")); + shared_ptr subs (new PlainTextFileContent (film, "test/data/subrip3.srt")); film->examine_and_add_content (subs); wait_for_jobs (); @@ -231,13 +233,14 @@ BOOST_AUTO_TEST_CASE (reels_test4) BOOST_AUTO_TEST_CASE (reels_test5) { - shared_ptr film = new_test_film ("reels_test4"); + shared_ptr film = new_test_film ("reels_test5"); + film->set_sequence (false); shared_ptr dcp (new DCPContent (film, "test/data/reels_test4")); film->examine_and_add_content (dcp); - wait_for_jobs (); + BOOST_REQUIRE (!wait_for_jobs ()); - /* Set to 123 but it will be rounded up to the next frame (4000) */ - dcp->set_position(DCPTime(123)); + /* Set to 2123 but it will be rounded up to the next frame (4000) */ + dcp->set_position(DCPTime(2123)); { list p = dcp->reels (); @@ -340,7 +343,31 @@ BOOST_AUTO_TEST_CASE (reels_test8) BOOST_REQUIRE (!wait_for_jobs ()); A->set_trim_end (ContentTime::from_seconds (1)); - cout << to_string(A->length_after_trim()) << "\n"; film->make_dcp (); BOOST_REQUIRE (!wait_for_jobs ()); } + +/** Check another reels-related error; make_dcp() would raise a ProgrammingError */ +BOOST_AUTO_TEST_CASE (reels_test9) +{ + shared_ptr film = new_test_film2("reels_test9a"); + shared_ptr A(new FFmpegContent(film, "test/data/flat_red.png")); + film->examine_and_add_content(A); + BOOST_REQUIRE(!wait_for_jobs()); + A->video->set_length(5 * 24); + film->set_video_frame_rate(24); + film->make_dcp(); + BOOST_REQUIRE(!wait_for_jobs()); + + shared_ptr film2 = new_test_film2("reels_test9b"); + shared_ptr B(new DCPContent(film2, film->dir(film->dcp_name()))); + film2->examine_and_add_content(B); + film2->examine_and_add_content(content_factory(film, "test/data/dcp_sub4.xml").front()); + B->set_reference_video(true); + B->set_reference_audio(true); + BOOST_REQUIRE(!wait_for_jobs()); + film2->set_reel_type(REELTYPE_BY_VIDEO_CONTENT); + film2->write_metadata(); + film2->make_dcp(); + BOOST_REQUIRE(!wait_for_jobs()); +}