X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fsubtitle_trim_test.cc;h=f0fea4765c5b5a46705ff85ac45555b16f7d72a1;hb=6a3c03c5eed3cab8fdfdb04fcbaf6cabe8c715e9;hp=3a615c8d83d4a3976cc636779c04b216fd8d3916;hpb=dd9be86db6cde0afa5da0d1d1ac43b42e05dca26;p=dcpomatic.git diff --git a/test/subtitle_trim_test.cc b/test/subtitle_trim_test.cc index 3a615c8d8..f0fea4765 100644 --- a/test/subtitle_trim_test.cc +++ b/test/subtitle_trim_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington + Copyright (C) 2018-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,25 +18,31 @@ */ + #include "lib/film.h" #include "lib/dcp_subtitle_content.h" #include "test.h" #include + +using std::make_shared; using std::shared_ptr; -using namespace dcpomatic; + /** Check for no crash when trimming DCP subtitles (#1275) */ BOOST_AUTO_TEST_CASE (subtitle_trim_test1) { - shared_ptr film = new_test_film2 ("subtitle_trim_test1"); - shared_ptr content (new DCPSubtitleContent ("test/data/dcp_sub5.xml")); - film->examine_and_add_content (content); - BOOST_REQUIRE (!wait_for_jobs ()); + auto content = make_shared("test/data/dcp_sub5.xml"); + auto film = new_test_film2 ("subtitle_trim_test1", {content}); - content->set_trim_end (ContentTime::from_seconds (2)); + content->set_trim_end (dcpomatic::ContentTime::from_seconds(2)); film->write_metadata (); - film->make_dcp (); - BOOST_REQUIRE (!wait_for_jobs ()); + make_and_verify_dcp ( + film, + { + dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE, + dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME, + dcp::VerificationNote::Code::MISSING_CPL_METADATA + }); }