diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-09-19 21:45:22 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-09-19 21:45:22 +0200 |
| commit | c7916079e06d985121842962b9736a6673e22dfe (patch) | |
| tree | 05720c8df69b8a8a27f69cef7152ff24d242cfff /test | |
| parent | c269ebfdae53a2f5c5e9acc6f6588ebb47eeac9d (diff) | |
Fix failure to open v2.14.x documents with invalid or empty subtitle languages (#2085).
Diffstat (limited to 'test')
| m--------- | test/data | 0 | ||||
| -rw-r--r-- | test/film_metadata_test.cc | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/data b/test/data -Subproject 9164d0cb488c83d6cb4ab379ede53aaa5769e8e +Subproject ea55876b67767a6a4a9474a4af860c51dc9ee9e diff --git a/test/film_metadata_test.cc b/test/film_metadata_test.cc index 92c06210a..6d4c606e2 100644 --- a/test/film_metadata_test.cc +++ b/test/film_metadata_test.cc @@ -101,3 +101,28 @@ BOOST_AUTO_TEST_CASE (multiple_text_nodes_are_allowed) auto test = make_shared<Film>(boost::filesystem::path("build/test/multiple_text_nodes_are_allowed2")); test->read_metadata(); } + + +/** Read some metadata from v2.14.x that fails to open on 2.15.x */ +BOOST_AUTO_TEST_CASE (metadata_loads_from_2_14_x_1) +{ + namespace fs = boost::filesystem; + auto film = make_shared<Film>(fs::path("build/test/metadata_loads_from_2_14_x_1")); + auto notes = film->read_metadata(fs::path("test/data/2.14.x.metadata.1.xml")); + BOOST_REQUIRE_EQUAL (notes.size(), 0U); +} + + +/** Read some more metadata from v2.14.x that fails to open on 2.15.x */ +BOOST_AUTO_TEST_CASE (metadata_loads_from_2_14_x_2) +{ + namespace fs = boost::filesystem; + auto film = make_shared<Film>(fs::path("build/test/metadata_loads_from_2_14_x_2")); + auto notes = film->read_metadata(fs::path("test/data/2.14.x.metadata.2.xml")); + BOOST_REQUIRE_EQUAL (notes.size(), 1U); + BOOST_REQUIRE_EQUAL (notes.front(), + "A subtitle or closed caption file in this project is marked with the language 'eng', " + "which DCP-o-matic does not recognise. The file's language has been cleared." + ); +} + |
