X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fxml_subtitle_test.cc;h=dc464429fe57abe61a1392f18aa5ad3a8a7d07a1;hb=91c62a41e2643d5c5c4bd18c064f1c080dfec4aa;hp=6c3cc9c036b65ef802d703c69f82192966988d5d;hpb=73f52e94953848c696725defd3d7f5c4c30707e2;p=dcpomatic.git diff --git a/test/xml_subtitle_test.cc b/test/xml_subtitle_test.cc index 6c3cc9c03..dc464429f 100644 --- a/test/xml_subtitle_test.cc +++ b/test/xml_subtitle_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,11 +22,13 @@ */ #include -#include "lib/subrip_content.h" +#include "lib/text_subtitle_content.h" #include "lib/film.h" #include "lib/ratio.h" #include "lib/dcp_content_type.h" +#include "lib/subtitle_content.h" #include "test.h" +#include using std::cout; using boost::shared_ptr; @@ -38,13 +40,37 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test) 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 (false); - shared_ptr content (new SubRipContent (film, "test/data/subrip2.srt")); - content->set_subtitle_use (true); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); + content->subtitle->set_use (true); + content->subtitle->set_burn (false); film->examine_and_add_content (content); wait_for_jobs (); film->make_dcp (); wait_for_jobs (); + /* Should be blank video with MXF subtitles */ check_dcp ("test/data/xml_subtitle_test", film->dir (film->dcp_name ())); } + +/** Check the subtitle XML when there are two subtitle files in the project */ +BOOST_AUTO_TEST_CASE (xml_subtitle_test2) +{ + shared_ptr film = new_test_film ("xml_subtitle_test2"); + film->set_container (Ratio::from_id ("185")); + film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); + film->set_name ("frobozz"); + film->set_interop (true); + film->set_sequence (false); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); + content->subtitle->set_use (true); + content->subtitle->set_burn (false); + film->examine_and_add_content (content); + film->examine_and_add_content (content); + wait_for_jobs (); + content->set_position (DCPTime (0)); + film->make_dcp (); + wait_for_jobs (); + film->write_metadata (); + + check_dcp ("test/data/xml_subtitle_test2", film->dir (film->dcp_name ())); +}