From 725c1f0ead60e73e9dbc17337c416ac4d2720c55 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 24 Sep 2013 18:54:09 +0100 Subject: Various KDM work. --- test/encryption_test.cc | 9 +++++---- test/kdm_test.cc | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/encryption_test.cc b/test/encryption_test.cc index 6e4a61d6..961d281b 100644 --- a/test/encryption_test.cc +++ b/test/encryption_test.cc @@ -17,6 +17,8 @@ */ +#include "kdm.h" + /* Load a certificate chain from build/test/data/ *.pem and then build an encrypted DCP and a KDM using it. */ @@ -87,17 +89,16 @@ BOOST_AUTO_TEST_CASE (encryption) d.write_xml (false, xml_metadata, signer); - shared_ptr kdm = cpl->make_kdm ( + libdcp::KDM kdm ( + cpl, signer, signer->certificates().leaf(), - key, boost::posix_time::time_from_string ("2013-01-01 00:00:00"), boost::posix_time::time_from_string ("2013-01-08 00:00:00"), - false, mxf_metadata, xml_metadata ); - kdm->write_to_file_formatted ("build/test/bar.kdm.xml", "UTF-8"); + kdm.as_xml ("build/test/bar.kdm.xml"); system ("xmllint --path schema --nonet --noout --schema schema/SMPTE-430-1-2006-Amd-1-2009-KDM.xsd build/test/bar.kdm.xml"); } diff --git a/test/kdm_test.cc b/test/kdm_test.cc index 5d071074..d9ba3745 100644 --- a/test/kdm_test.cc +++ b/test/kdm_test.cc @@ -51,7 +51,8 @@ BOOST_AUTO_TEST_CASE (kdm_passthrough_test) "test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml" ); - kdm.as_xml ("build/kdm.xml"); + shared_ptr doc = kdm.as_xml (); + doc->write_to_file_formatted ("build/kdm.xml", "UTF-8"); int const r = system ( "xmldiff -c test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml build/kdm.xml" ); -- cgit v1.2.3