X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fburnt_subtitle_test.cc;h=dc2c622704007b586ec73f94f4e0524304b3597f;hb=8c6e4c8e4f37450f44cb4ca9918406a6f2cc6055;hp=acd30d030c492405227647251bb9f7e3a5a5e091;hpb=38164bf6e8095f8a8f852bd21877cfb90d204868;p=dcpomatic.git diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc index acd30d030..dc2c62270 100644 --- a/test/burnt_subtitle_test.cc +++ b/test/burnt_subtitle_test.cc @@ -23,6 +23,7 @@ #include #include "lib/subrip_content.h" +#include "lib/dcp_subtitle_content.h" #include "lib/film.h" #include "lib/ratio.h" #include "lib/dcp_content_type.h" @@ -31,13 +32,14 @@ using std::cout; using boost::shared_ptr; -/** Build a small DCP with no picture and a single subtitle overlaid onto it */ -BOOST_AUTO_TEST_CASE (burnt_subtitle_test) +/** Build a small DCP with no picture and a single subtitle overlaid onto it from a SubRip file */ +BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip) { - shared_ptr film = new_test_film ("burnt_subtitle_test"); + shared_ptr film = new_test_film ("burnt_subtitle_test_subrip"); film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); + film->set_burn_subtitles (true); shared_ptr content (new SubRipContent (film, "test/data/subrip2.srt")); content->set_subtitle_use (true); film->examine_and_add_content (content); @@ -45,5 +47,23 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test) film->make_dcp (); wait_for_jobs (); - check_dcp ("test/data/burnt_subtitle_test", film->dir (film->dcp_name ())); + check_dcp ("test/data/burnt_subtitle_test_subrip", film->dir (film->dcp_name ())); +} + +/** Build a small DCP with no picture and a single subtitle overlaid onto it from a DCP XML file */ +BOOST_AUTO_TEST_CASE (burnt_subtitle_test_dcp) +{ + shared_ptr film = new_test_film ("burnt_subtitle_test_dcp"); + film->set_container (Ratio::from_id ("185")); + film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); + film->set_name ("frobozz"); + film->set_burn_subtitles (true); + shared_ptr content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml")); + content->set_subtitle_use (true); + film->examine_and_add_content (content); + wait_for_jobs (); + film->make_dcp (); + wait_for_jobs (); + + check_dcp ("test/data/burnt_subtitle_test_dcp", film->dir (film->dcp_name ())); }