X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fsubtitle_font_id_test.cc;h=bc09a9cf1e95ad1254890f67aa70649f6077e11d;hb=HEAD;hp=56207bfcbc28e1818570fe38f2fa0e1580db7965;hpb=db22f81ccce9e1a5f205e6d8b3c0631fc039a173;p=dcpomatic.git diff --git a/test/subtitle_font_id_test.cc b/test/subtitle_font_id_test.cc index 56207bfcb..bc09a9cf1 100644 --- a/test/subtitle_font_id_test.cc +++ b/test/subtitle_font_id_test.cc @@ -23,6 +23,7 @@ #include "lib/dcp_content.h" #include "lib/film.h" #include "lib/font.h" +#include "lib/player.h" #include "lib/text_content.h" #include "lib/util.h" #include @@ -106,7 +107,7 @@ BOOST_AUTO_TEST_CASE(make_dcp_with_subs_from_mkv) auto subs = content_factory(TestPaths::private_data() / "clapperboard_with_subs.mkv"); auto film = new_test_film2("make_dcp_with_subs_from_mkv", subs); subs[0]->text.front()->set_use(true); - subs[0]->text.front()->set_language(dcp::LanguageTag("en-US")); + subs[0]->text.front()->set_language(dcp::LanguageTag("en")); make_and_verify_dcp(film, { dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K }); } @@ -116,6 +117,7 @@ BOOST_AUTO_TEST_CASE(make_dcp_with_subs_without_font_tag) auto subs = content_factory("test/data/no_font.xml"); auto film = new_test_film2("make_dcp_with_subs_without_font_tag", { subs }); subs[0]->text.front()->set_use(true); + subs[0]->text.front()->set_language(dcp::LanguageTag("de")); make_and_verify_dcp( film, { @@ -139,6 +141,7 @@ BOOST_AUTO_TEST_CASE(make_dcp_with_subs_in_dcp_without_font_tag) auto source_subs = content_factory("test/data/short.srt"); auto source = new_test_film2("make_dcp_with_subs_in_dcp_without_font_tag_source", { source_subs }); source->set_interop(true); + source_subs[0]->only_text()->set_language(dcp::LanguageTag("de")); make_and_verify_dcp( source, { @@ -289,3 +292,13 @@ BOOST_AUTO_TEST_CASE(use_first_loadfont_as_default) BOOST_REQUIRE_EQUAL(subtitle->font_data().size(), 1U); BOOST_CHECK(subtitle->font_data().begin()->second == dcp::ArrayData("test/data/Inconsolata-VF.ttf")); } + + +BOOST_AUTO_TEST_CASE(no_error_with_ccap_that_mentions_no_font) +{ + auto dcp = make_shared("test/data/ccap_only"); + auto film = new_test_film2("no_error_with_ccap_that_mentions_no_font", { dcp }); + auto player = Player(film, film->playlist()); + while (!player.pass()) {} +} +