X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fsubtitle_trim_test.cc;h=f0fea4765c5b5a46705ff85ac45555b16f7d72a1;hb=fa85cc6352a2f25bdd1d4421c9490f9fca266e04;hp=966fc66b6f12910fd6cf9f47274ad4752a6b589c;hpb=c4403784febdbdd42e9c32e67fadb147f11fe566;p=dcpomatic.git diff --git a/test/subtitle_trim_test.cc b/test/subtitle_trim_test.cc index 966fc66b6..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 boost::shared_ptr; -using namespace dcpomatic; + +using std::make_shared; +using std::shared_ptr; + /** 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 + }); }