summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-02-01 21:59:32 +0100
committerCarl Hetherington <cth@carlh.net>2026-02-02 00:36:54 +0100
commit56b5f7e06e89f136a9f2ef91f4e7a34d6c451730 (patch)
tree7115179ebf80da4fd988ad1891813d9d06125818 /test
parentf4582b67f10e5cdbe13ef3f3112c709e950d2190 (diff)
Reproduce MCA subdescriptors when writing XML without the assets being present.
This assumes that we don't read a CPL, modify the sound assets, then write it out again. Maybe we should make that possible (e.g. by invalidating the CPL's MCA subdescriptors list when changing sound).
Diffstat (limited to 'test')
-rw-r--r--test/cpl_metadata_test.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/cpl_metadata_test.cc b/test/cpl_metadata_test.cc
index 2dc6da7d..cc86a37e 100644
--- a/test/cpl_metadata_test.cc
+++ b/test/cpl_metadata_test.cc
@@ -507,3 +507,33 @@ BOOST_AUTO_TEST_CASE(check_dolby_edr_metadata)
BOOST_CHECK_EQUAL(check.dolby_edr_image_transfer_function().get_value_or(""), "PQ10K");
}
+
+BOOST_AUTO_TEST_CASE(cpl_metadata_passthrough)
+{
+ boost::filesystem::path tmp = "build/test/ak";
+ dcp::filesystem::remove_all(tmp);
+
+ /* Plain dcp::filesystem::copy does not seem work on Ubuntu 16.04 */
+ dcp::filesystem::create_directory(tmp);
+ for (auto file: boost::filesystem::directory_iterator(private_test / "ak")) {
+ dcp::filesystem::copy_file(file, tmp / file.path().filename());
+ }
+
+ dcp::DCP dcp("build/test/ak");
+ dcp.read();
+
+ auto signer = make_shared<dcp::CertificateChain>();
+ signer->add(dcp::Certificate(dcp::file_to_string("test/ref/crypt/ca.self-signed.pem")));
+ signer->add(dcp::Certificate(dcp::file_to_string("test/ref/crypt/intermediate.signed.pem")));
+ signer->add(dcp::Certificate(dcp::file_to_string("test/ref/crypt/leaf.signed.pem")));
+ signer->set_key(dcp::file_to_string("test/ref/crypt/leaf.key"));
+
+ dcp.write_xml(signer);
+
+ check_xml(
+ dcp::file_to_string(private_test / "ak" / "cpl_48b6b1d3-37fd-4782-8ad1-f883e5020d47.xml"),
+ dcp::file_to_string(boost::filesystem::path("build/test/ak") / "cpl_48b6b1d3-37fd-4782-8ad1-f883e5020d47.xml"),
+ {"Signer", "Signature"}
+ );
+}
+