X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fimport_dcp_test.cc;h=7387c7be7379f533687fbd58aaa1769985eca8d2;hb=HEAD;hp=3620a55c59552e9c7de6ff886b5b31e245ce78de;hpb=ea63ad9560757e56505551db3bf2e1c31be5c76c;p=dcpomatic.git diff --git a/test/import_dcp_test.cc b/test/import_dcp_test.cc index 3620a55c5..7387c7be7 100644 --- a/test/import_dcp_test.cc +++ b/test/import_dcp_test.cc @@ -25,35 +25,37 @@ */ -#include "test.h" -#include "lib/film.h" -#include "lib/screen.h" -#include "lib/dcp_subtitle_content.h" -#include "lib/ratio.h" -#include "lib/dcp_content_type.h" +#include "lib/config.h" +#include "lib/constants.h" +#include "lib/content_factory.h" +#include "lib/cross.h" #include "lib/dcp_content.h" -#include "lib/ffmpeg_content.h" +#include "lib/dcp_content_type.h" +#include "lib/dcp_subtitle_content.h" #include "lib/examine_content_job.h" +#include "lib/ffmpeg_content.h" +#include "lib/film.h" #include "lib/job_manager.h" -#include "lib/config.h" -#include "lib/cross.h" +#include "lib/ratio.h" +#include "lib/screen.h" #include "lib/video_content.h" -#include "lib/content_factory.h" +#include "test.h" #include #include -using std::vector; -using std::string; -using std::map; -using std::shared_ptr; using std::dynamic_pointer_cast; using std::make_shared; +using std::map; +using std::string; +using std::vector; /** Make an encrypted DCP, import it and make a new unencrypted DCP */ BOOST_AUTO_TEST_CASE (import_dcp_test) { + ConfigRestorer cr; + auto A = new_test_film ("import_dcp_test"); A->set_container (Ratio::from_id ("185")); A->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); @@ -70,24 +72,20 @@ BOOST_AUTO_TEST_CASE (import_dcp_test) dcp::DCP A_dcp ("build/test/import_dcp_test/" + A->dcp_name()); A_dcp.read (); - Config::instance()->set_decryption_chain (make_shared(openssl_path())); + Config::instance()->set_decryption_chain (make_shared(openssl_path(), CERTIFICATE_VALIDITY_PERIOD)); + + auto signer = Config::instance()->signer_chain(); + BOOST_REQUIRE(signer->valid()); - /* Dear future-carl: I suck! I thought you wouldn't still be running these tests in 2030! Sorry! */ - auto kdm = A->make_kdm ( - Config::instance()->decryption_chain()->leaf (), - vector(), - A_dcp.cpls().front()->file().get(), - dcp::LocalTime ("2030-07-21T00:00:00+00:00"), - dcp::LocalTime ("2031-07-21T00:00:00+00:00"), - dcp::Formulation::MODIFIED_TRANSITIONAL_1, - true, 0 - ); + auto const decrypted_kdm = A->make_kdm(A_dcp.cpls().front()->file().get(), dcp::LocalTime ("2030-07-21T00:00:00+00:00"), dcp::LocalTime ("2031-07-21T00:00:00+00:00")); + auto const kdm = decrypted_kdm.encrypt(signer, Config::instance()->decryption_chain()->leaf(), {}, dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0); auto B = new_test_film ("import_dcp_test2"); B->set_container (Ratio::from_id ("185")); B->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); B->set_name ("frobozz"); B->set_interop (false); + B->set_audio_channels(16); auto d = make_shared("build/test/import_dcp_test/" + A->dcp_name()); B->examine_and_add_content (d); @@ -109,10 +107,10 @@ BOOST_AUTO_TEST_CASE (import_dcp_markers_test) Cleanup cl; /* Make a DCP with some markers */ - auto content = content_factory("test/data/flat_red.png").front(); - auto film = new_test_film2 ("import_dcp_markers_test", {content}, &cl); + auto content = content_factory("test/data/flat_red.png"); + auto film = new_test_film2 ("import_dcp_markers_test", content, &cl); - content->video->set_length (24 * 60 * 10); + content[0]->video->set_length (24 * 60 * 10); film->set_marker(dcp::Marker::FFOC, dcpomatic::DCPTime::from_frames(1, 24)); film->set_marker(dcp::Marker::FFMC, dcpomatic::DCPTime::from_seconds(9.4)); @@ -160,7 +158,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_metadata_test) { /* Make a DCP with some ratings and a content version */ auto film = new_test_film2 ("import_dcp_metadata_test"); - auto content = content_factory("test/data/flat_red.png").front(); + auto content = content_factory("test/data/flat_red.png")[0]; film->examine_and_add_content (content); BOOST_REQUIRE (!wait_for_jobs());