BOOST_AUTO_TEST_CASE (film_metadata_test)
{
- auto film = new_test_film ("film_metadata_test");
+ auto film = new_test_film("film_metadata_test");
auto dir = test_film_dir ("film_metadata_test");
film->_isdcf_date = boost::gregorian::from_undelimited_string ("20130211");
BOOST_CHECK (film->container() == Ratio::from_id ("185"));
- BOOST_CHECK (film->dcp_content_type() == nullptr);
+ BOOST_CHECK (film->dcp_content_type() == DCPContentType::from_isdcf_name("TST"));
film->set_name ("fred");
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("SHR"));
film->set_container (Ratio::from_id ("185"));
- film->set_j2k_bandwidth (200000000);
+ film->set_video_bit_rate(VideoEncoding::JPEG2000, 200000000);
film->set_interop (false);
film->set_chain (string(""));
film->set_distributor (string(""));
film->set_facility (string(""));
film->set_release_territory (dcp::LanguageTag::RegionSubtag("US"));
+ film->set_audio_channels(6);
film->write_metadata ();
- list<string> ignore = { "Key", "ContextID", "LastWrittenBy" };
+ list<Glib::ustring> ignore = { "Key", "ContextID", "LastWrittenBy" };
check_xml ("test/data/metadata.xml.ref", dir.string() + "/metadata.xml", ignore);
auto g = make_shared<Film>(dir);
/** Check a bug where <Content> tags with multiple <Text>s would fail to load */
BOOST_AUTO_TEST_CASE (multiple_text_nodes_are_allowed)
{
+ Cleanup cl;
+
auto subs = content_factory("test/data/15s.srt")[0];
auto caps = content_factory("test/data/15s.srt")[0];
- auto film = new_test_film2("multiple_text_nodes_are_allowed1", { subs, caps });
+ auto film = new_test_film("multiple_text_nodes_are_allowed1", { subs, caps }, &cl);
caps->only_text()->set_type(TextType::CLOSED_CAPTION);
make_and_verify_dcp (
film,
});
auto reload = make_shared<DCPContent>(film->dir(film->dcp_name()));
- auto film2 = new_test_film2("multiple_text_nodes_are_allowed2", { reload });
+ auto film2 = new_test_film("multiple_text_nodes_are_allowed2", { reload });
film2->write_metadata ();
auto test = make_shared<Film>(boost::filesystem::path("build/test/multiple_text_nodes_are_allowed2"));
test->read_metadata();
+
+ cl.run();
}
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_film("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"));
+}
+