summaryrefslogtreecommitdiff
path: root/test/burnt_subtitle_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-07-10 16:15:13 +0100
committerCarl Hetherington <cth@carlh.net>2014-07-10 16:15:13 +0100
commit8c6e4c8e4f37450f44cb4ca9918406a6f2cc6055 (patch)
tree3b77e87348a5048713520b65e306b25f040494c0 /test/burnt_subtitle_test.cc
parent38164bf6e8095f8a8f852bd21877cfb90d204868 (diff)
Various fixes for DCP subtitles, and a test or two.
Diffstat (limited to 'test/burnt_subtitle_test.cc')
-rw-r--r--test/burnt_subtitle_test.cc28
1 files changed, 24 insertions, 4 deletions
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 <boost/test/unit_test.hpp>
#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> film = new_test_film ("burnt_subtitle_test");
+ shared_ptr<Film> 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<SubRipContent> 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> 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<DCPSubtitleContent> 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 ()));
}