summaryrefslogtreecommitdiff
path: root/test/film_metadata_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-07-02 22:03:28 +0200
committerCarl Hetherington <cth@carlh.net>2023-07-02 22:04:10 +0200
commitfc10e39ac88ee16a711d1d643f863e84dcd8157d (patch)
tree070a6bd820888113e3c5f9f24089cb0e56e7c545 /test/film_metadata_test.cc
parent5f3ba49300f3e3d5ac36a2ce33dadc6d1ffc049c (diff)
Don't insert incorrect <Effect> nodes into metadata (#2581).
Previously we would add assume Effect=none (i.e. force all subtitles to have no effect) if neither of the legacy tags Border or Shadow were present in the metadata. In this case we should just leave Effect as unset.
Diffstat (limited to 'test/film_metadata_test.cc')
-rw-r--r--test/film_metadata_test.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/film_metadata_test.cc b/test/film_metadata_test.cc
index 9b855de5b..ada943c80 100644
--- a/test/film_metadata_test.cc
+++ b/test/film_metadata_test.cc
@@ -210,3 +210,24 @@ BOOST_AUTO_TEST_CASE (metadata_video_range_guessed_for_png)
BOOST_REQUIRE(film->content()[0]->video);
BOOST_CHECK(film->content()[0]->video->range() == VideoRange::FULL);
}
+
+
+/* Bug #2581 */
+BOOST_AUTO_TEST_CASE(effect_node_not_inserted_incorrectly)
+{
+ auto sub = content_factory("test/data/15s.srt");
+ auto film = new_test_film2("effect_node_not_inserted_incorrectly", sub);
+ film->write_metadata();
+
+ namespace fs = boost::filesystem;
+ auto film2 = make_shared<Film>(fs::path("build/test/effect_node_not_inserted_incorrectly"));
+ film2->read_metadata();
+ film2->write_metadata();
+
+ cxml::Document doc("Metadata");
+ doc.read_file("build/test/effect_node_not_inserted_incorrectly/metadata.xml");
+
+ /* There should be no <Effect> node in the text, since we don't want to force the effect to "none" */
+ BOOST_CHECK(!doc.node_child("Playlist")->node_child("Content")->node_child("Text")->optional_node_child("Effect"));
+}
+