Supporters update.
[dcpomatic.git] / test / dcp_subtitle_test.cc
index 6798cf67868be4c6dd26c5da68dc7823835633e5..837362e84127e6e6abd2009aa89506620edecfb9 100644 (file)
@@ -96,7 +96,11 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test)
                        dcp::VerificationNote::Code::MISSING_CPL_METADATA
                });
 
-       check_dcp ("test/data/dcp_subtitle_test", film->dir(film->dcp_name()));
+       /* This test is concerned with the subtitles, so we'll ignore any
+        * differences in sound between the DCP and the reference to avoid test
+        * failures for unrelated reasons.
+        */
+       check_dcp("test/data/dcp_subtitle_test", film->dir(film->dcp_name()), true);
 }
 
 
@@ -157,6 +161,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test3)
        film->set_interop (true);
        auto content = make_shared<DCPSubtitleContent>("test/data/dcp_sub3.xml");
        film->examine_and_add_content (content);
+       content->only_text()->set_language(dcp::LanguageTag("de"));
        BOOST_REQUIRE (!wait_for_jobs ());
 
        make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
@@ -192,6 +197,8 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test4)
 
        content->only_text()->add_font(make_shared<Font>("font1"));
        content2->only_text()->add_font(make_shared<Font>("font2"));
+       content->only_text()->set_language(dcp::LanguageTag("de"));
+       content2->only_text()->set_language(dcp::LanguageTag("de"));
 
        make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
 
@@ -222,6 +229,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test5)
        auto content = make_shared<DCPSubtitleContent>("test/data/dcp_sub6.xml");
        auto film = new_test_film2 ("dcp_subtitle_test5", {content});
        film->set_interop (true);
+       content->only_text()->set_language(dcp::LanguageTag("de"));
 
        make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
 
@@ -240,9 +248,12 @@ BOOST_AUTO_TEST_CASE (test_font_override)
        auto content = make_shared<DCPSubtitleContent>("test/data/dcp_sub4.xml");
        auto film = new_test_film2("test_font_override", {content});
        film->set_interop(true);
+       content->only_text()->set_language(dcp::LanguageTag("de"));
 
        BOOST_REQUIRE_EQUAL(content->text.size(), 1U);
-       content->text.front()->get_font("theFontId")->set_file("test/data/Inconsolata-VF.ttf");
+       auto font = content->text.front()->get_font("0_theFontId");
+       BOOST_REQUIRE(font);
+       font->set_file("test/data/Inconsolata-VF.ttf");
 
        make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
        check_file (subtitle_file(film).parent_path() / "font_0.ttf", "test/data/Inconsolata-VF.ttf");