Run premultiply filter on still images that have alpha channels (more of #2681).
[dcpomatic.git] / test / map_cli_test.cc
index 1267e9b4ccb3064b66cb5666d3efb889656d8017..5505a197bbd1e50aec5c312ca3493f8ef587caba 100644 (file)
@@ -504,3 +504,76 @@ BOOST_AUTO_TEST_CASE(map_multireel_interop_ov_and_vf_adding_ccaps)
 }
 
 
+BOOST_AUTO_TEST_CASE(map_uses_config_for_issuer_and_creator)
+{
+       ConfigRestorer cr;
+
+       Config::instance()->set_dcp_issuer("ostrabagalous");
+       Config::instance()->set_dcp_creator("Fred");
+
+       string const name = "map_uses_config_for_issuer_and_creator";
+       string const out = String::compose("build/test/%1_out", name);
+
+       auto content = content_factory("test/data/flat_red.png");
+       auto film = new_test_film2(name + "_in", content);
+       make_and_verify_dcp(film);
+
+       vector<string> const args = {
+               "map_cli",
+               "-o", out,
+               "-d", film->dir(film->dcp_name()).string(),
+               find_cpl(film->dir(film->dcp_name())).string()
+       };
+
+       boost::filesystem::remove_all(out);
+
+       vector<string> output_messages;
+       auto error = run(args, output_messages);
+       BOOST_CHECK(!error);
+
+       cxml::Document assetmap("AssetMap");
+       assetmap.read_file(film->dir(film->dcp_name()) / "ASSETMAP.xml");
+       BOOST_CHECK(assetmap.string_child("Issuer") == "ostrabagalous");
+       BOOST_CHECK(assetmap.string_child("Creator") == "Fred");
+
+       cxml::Document pkl("PackingList");
+       pkl.read_file(find_prefix(out, "pkl_"));
+       BOOST_CHECK(pkl.string_child("Issuer") == "ostrabagalous");
+       BOOST_CHECK(pkl.string_child("Creator") == "Fred");
+}
+
+
+BOOST_AUTO_TEST_CASE(map_handles_interop_png_subs)
+{
+       string const name = "map_handles_interop_png_subs";
+       auto arrietty = content_factory(TestPaths::private_data() / "arrietty_JP-EN.mkv")[0];
+       auto film = new_test_film2(name + "_input", { arrietty });
+       film->set_interop(true);
+       arrietty->set_trim_end(dcpomatic::ContentTime::from_seconds(110));
+       arrietty->text[0]->set_use(true);
+       make_and_verify_dcp(
+               film,
+               {
+                       dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME,
+                       dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE,
+                       dcp::VerificationNote::Code::INVALID_STANDARD
+               });
+
+       auto const out = boost::filesystem::path("build") / "test" / (name + "_output");
+
+       vector<string> const args = {
+               "map_cli",
+               "-o", out.string(),
+               "-d", film->dir(film->dcp_name()).string(),
+               find_cpl(film->dir(film->dcp_name())).string()
+       };
+
+       boost::filesystem::remove_all(out);
+
+       vector<string> output_messages;
+       auto error = run(args, output_messages);
+       BOOST_CHECK(!error);
+
+       verify_dcp(out, { dcp::VerificationNote::Code::INVALID_STANDARD });
+}
+