X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fremake_id_test.cc;h=349884f919e4a03012592b59c2330b8e7feed276;hb=HEAD;hp=c4953f98044ca1f1174994dbfa1e0a675e28e844;hpb=ea63ad9560757e56505551db3bf2e1c31be5c76c;p=dcpomatic.git diff --git a/test/remake_id_test.cc b/test/remake_id_test.cc index c4953f980..816a43feb 100644 --- a/test/remake_id_test.cc +++ b/test/remake_id_test.cc @@ -19,24 +19,23 @@ */ -#include "lib/ffmpeg_content.h" +#include "lib/config.h" #include "lib/content_factory.h" -#include "lib/text_content.h" -#include "lib/job_manager.h" -#include "lib/film.h" #include "lib/dcp_content.h" #include "lib/examine_content_job.h" -#include "lib/config.h" +#include "lib/ffmpeg_content.h" +#include "lib/film.h" +#include "lib/job_manager.h" +#include "lib/text_content.h" #include "test.h" #include #include -using std::string; -using std::vector; -using std::shared_ptr; using std::dynamic_pointer_cast; using std::make_shared; +using std::string; +using std::vector; using boost::optional; @@ -46,8 +45,8 @@ using boost::optional; BOOST_AUTO_TEST_CASE (remake_id_test1) { /* Make a DCP */ - auto content = content_factory("test/data/flat_red.png").front(); - auto film = new_test_film2 ("remake_id_test1_1", {content}); + auto content = content_factory("test/data/flat_red.png"); + auto film = new_test_film2 ("remake_id_test1_1", content); make_and_verify_dcp (film); /* Copy the video file */ @@ -67,8 +66,8 @@ BOOST_AUTO_TEST_CASE (remake_id_test1) BOOST_AUTO_TEST_CASE (remake_id_test2) { /* Make a DCP */ - auto content = content_factory("test/data/flat_red.png").front(); - auto film = new_test_film2 ("remake_id_test2_1", {content}); + auto content = content_factory("test/data/flat_red.png"); + auto film = new_test_film2 ("remake_id_test2_1", content); film->set_encrypted (true); make_and_verify_dcp (film); @@ -85,21 +84,16 @@ BOOST_AUTO_TEST_CASE (remake_id_test2) } BOOST_REQUIRE(cpl); + auto signer = Config::instance()->signer_chain(); + BOOST_REQUIRE(signer->valid()); + /* Make a DKDM */ - auto kdm = film->make_kdm ( - Config::instance()->decryption_chain()->leaf(), - vector(), - *cpl, - dcp::LocalTime ("2030-01-01T01:00:00+00:00"), - dcp::LocalTime ("2031-01-01T01:00:00+00:00"), - dcp::Formulation::MODIFIED_TRANSITIONAL_1, - true, - 0 - ); + auto const decrypted_kdm = film->make_kdm(*cpl, dcp::LocalTime ("2030-01-01T01:00:00+00:00"), dcp::LocalTime ("2031-01-01T01:00:00+00:00")); + auto const kdm = decrypted_kdm.encrypt(signer, Config::instance()->decryption_chain()->leaf(), {}, dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0); /* Import the DCP into a new film */ auto dcp_content = make_shared(film->dir(film->dcp_name())); - auto film2 = new_test_film2("remake_id_test2_2", {dcp_content}); + auto film2 = new_test_film2("remake_id_test2_2", { dcp_content }); dcp_content->add_kdm(kdm); JobManager::instance()->add(make_shared(film2, dcp_content)); BOOST_REQUIRE(!wait_for_jobs());