summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-01-11 23:04:57 +0100
committerCarl Hetherington <cth@carlh.net>2025-01-12 02:06:50 +0100
commit20c749bb5aee7a12d6a4365bc35fee01b9810fe3 (patch)
tree71b6e2894281d0c0e5109b5161bf3441aa46072b /test
parent5d9b8579950a4440b43a649c27fa36082144773d (diff)
Rename subtitle_languages() -> open_text_languages().
Also make it return open captions as well as open subtitles (#2941).
Diffstat (limited to 'test')
-rw-r--r--test/isdcf_name_test.cc8
-rw-r--r--test/subtitle_metadata_test.cc2
2 files changed, 7 insertions, 3 deletions
diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc
index 3897aabbe..40626621f 100644
--- a/test/isdcf_name_test.cc
+++ b/test/isdcf_name_test.cc
@@ -78,8 +78,8 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
film->set_resolution (Resolution::FOUR_K);
auto text = content_factory("test/data/subrip.srt")[0];
BOOST_REQUIRE_EQUAL (text->text.size(), 1U);
- text->text.front()->set_burn (true);
- text->text.front()->set_language (dcp::LanguageTag("fr-FR"));
+ text->text[0]->set_burn(true);
+ text->text[0]->set_language(dcp::LanguageTag("fr-FR"));
film->examine_and_add_content (text);
film->set_version_number(2);
film->set_release_territory(dcp::LanguageTag::RegionSubtag("US"));
@@ -94,6 +94,10 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
film->set_interop (false);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV");
+ /* Should be the same if the subs are marked as open captions */
+ text->text[0]->set_type(TextType::OPEN_CAPTION);
+ BOOST_CHECK_EQUAL(film->isdcf_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV");
+
/* Test to see that RU ratings like 6+ are stripped of their + */
film->set_ratings({dcp::Rating("RARS", "6+")});
BOOST_CHECK_EQUAL (film->dcp_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-6_MOS_4K_DI_20140704_PPF_SMPTE_OV");
diff --git a/test/subtitle_metadata_test.cc b/test/subtitle_metadata_test.cc
index ce925defb..d8b887576 100644
--- a/test/subtitle_metadata_test.cc
+++ b/test/subtitle_metadata_test.cc
@@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE (subtitle_metadata_test1)
auto film = make_shared<Film>(p);
film->read_metadata();
- auto langs = film->subtitle_languages ();
+ auto langs = film->open_text_languages();
BOOST_REQUIRE (langs.first);
BOOST_CHECK_EQUAL (langs.first->to_string(), "de-DE");
}