Supporters update.
[dcpomatic.git] / test / dcp_subtitle_test.cc
index fe95cbbfc13da7c4b079f6ef27619851c3953d4b..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);
 }
 
 
@@ -111,7 +115,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test)
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       shared_ptr<DCPDecoder> decoder (new DCPDecoder (film, content, false, false, shared_ptr<DCPDecoder>()));
+       auto decoder = make_shared<DCPDecoder>(film, content, false, false, shared_ptr<DCPDecoder>());
        decoder->only_text()->PlainStart.connect (bind (store, _1));
 
        stored = optional<ContentStringText> ();
@@ -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");
@@ -305,6 +316,7 @@ BOOST_AUTO_TEST_CASE(entity_from_dcp_source)
 
        /* Remake with burn */
        content->only_text()->set_burn(true);
+       boost::filesystem::remove_all(film->dir(film->dcp_name()));
        make_and_verify_dcp (
                film,
                {