diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-03-23 00:50:11 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-03-31 22:48:53 +0200 |
| commit | e0a70cd5cfb11fc2de167f3146acdd437a6faa82 (patch) | |
| tree | 022ceef78d7daa12bccf519ebab0db5e23a3feb6 /test/subtitle_metadata_test.cc | |
| parent | 8640da877450479a85c73b2a921897d83b478c84 (diff) | |
Put subtitle language back into content from the film (#1930).
This also adds the main/additional language flag.
Of all the considerations about how to specify subtitle language,
the most important seems to be that the language specification happens
for the content where the language is; i.e. in the content text tab.
Diffstat (limited to 'test/subtitle_metadata_test.cc')
| -rw-r--r-- | test/subtitle_metadata_test.cc | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/test/subtitle_metadata_test.cc b/test/subtitle_metadata_test.cc index 6eaa77100..91372d2a5 100644 --- a/test/subtitle_metadata_test.cc +++ b/test/subtitle_metadata_test.cc @@ -30,46 +30,27 @@ #include <boost/test/unit_test.hpp> -using std::vector; +using std::make_shared; using std::shared_ptr; +using std::vector; BOOST_AUTO_TEST_CASE (subtitle_metadata_test1) { using namespace boost::filesystem; - path p = test_film_dir ("subtitle_metadata_test1"); + auto p = test_film_dir ("subtitle_metadata_test1"); if (exists (p)) { remove_all (p); } create_directory (p); copy_file ("test/data/subtitle_metadata1.xml", p / "metadata.xml"); - shared_ptr<Film> film(new Film(p)); - film->read_metadata(); - - vector<dcp::LanguageTag> langs = film->subtitle_languages (); - BOOST_REQUIRE (!langs.empty()); - BOOST_CHECK_EQUAL (langs.front().to_string(), "de-DE"); -} - - -BOOST_AUTO_TEST_CASE (subtitle_metadata_test2) -{ - using namespace boost::filesystem; - - path p = test_film_dir ("subtitle_metadata_test2"); - if (exists (p)) { - remove_all (p); - } - create_directory (p); - - copy_file ("test/data/subtitle_metadata2.xml", p / "metadata.xml"); - shared_ptr<Film> film(new Film(p)); + auto film = make_shared<Film>(p); film->read_metadata(); - vector<dcp::LanguageTag> langs = film->subtitle_languages (); - BOOST_REQUIRE (!langs.empty()); - BOOST_CHECK_EQUAL (langs.front().to_string(), "FR"); + auto langs = film->subtitle_languages (); + BOOST_REQUIRE (langs.first); + BOOST_CHECK_EQUAL (langs.first->to_string(), "de-DE"); } |
