X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=test%2Fatmos_test.cc;h=a364aa0eba3c7f5cadbdf9d357ab07f9053bb22c;hp=e5846f20e5f3927dd723914c01f710ea0de1d124;hb=8f955150ff2b642109552dd234089f9a038bb3d6;hpb=742fe66c1331fe80752e8577d914085aae8945c2 diff --git a/test/atmos_test.cc b/test/atmos_test.cc index e5846f20e..a364aa0eb 100644 --- a/test/atmos_test.cc +++ b/test/atmos_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2020 Carl Hetherington + Copyright (C) 2020-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -31,60 +31,77 @@ using std::string; using std::vector; +using std::make_shared; using boost::optional; -using boost::shared_ptr; +using std::shared_ptr; BOOST_AUTO_TEST_CASE (atmos_passthrough_test) { - shared_ptr film = new_test_film2 ("atmos_passthrough_test"); - boost::filesystem::path ref = TestPaths::private_data / "atmos_asset.mxf"; - shared_ptr content = content_factory (TestPaths::private_data / "atmos_asset.mxf").front(); - film->examine_and_add_content (content); - BOOST_REQUIRE (!wait_for_jobs()); + Cleanup cl; - film->make_dcp (); - BOOST_REQUIRE (!wait_for_jobs()); + auto film = new_test_film2 ( + "atmos_passthrough_test", + { content_factory(TestPaths::private_data() / "atmos_asset.mxf").front() }, + &cl + ); + + make_and_verify_dcp (film, {dcp::VerificationNote::Code::MISSING_CPL_METADATA}); + auto ref = TestPaths::private_data() / "atmos_asset.mxf"; BOOST_REQUIRE (mxf_atmos_files_same(ref, dcp_file(film, "atmos"), true)); + + cl.run (); } BOOST_AUTO_TEST_CASE (atmos_encrypted_passthrough_test) { - shared_ptr film = new_test_film2 ("atmos_encrypted_passthrough_test"); - boost::filesystem::path ref = TestPaths::private_data / "atmos_asset.mxf"; - shared_ptr content = content_factory (TestPaths::private_data / "atmos_asset.mxf").front(); - film->examine_and_add_content (content); - BOOST_REQUIRE (!wait_for_jobs()); + Cleanup cl; + + auto ref = TestPaths::private_data() / "atmos_asset.mxf"; + auto content = content_factory (TestPaths::private_data() / "atmos_asset.mxf").front(); + auto film = new_test_film2 ("atmos_encrypted_passthrough_test", {content}, &cl); film->set_encrypted (true); film->_key = dcp::Key ("4fac12927eb122af1c2781aa91f3a4cc"); - film->make_dcp (); - BOOST_REQUIRE (!wait_for_jobs()); + make_and_verify_dcp (film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA }); BOOST_REQUIRE (!mxf_atmos_files_same(ref, dcp_file(film, "atmos"))); - dcp::EncryptedKDM kdm = film->make_kdm ( + auto kdm = film->make_kdm ( Config::instance()->decryption_chain()->leaf(), vector(), dcp_file(film, "cpl"), dcp::LocalTime(), dcp::LocalTime(), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, false, optional() ); - shared_ptr film2 = new_test_film2 ("atmos_encrypted_passthrough_test2"); - shared_ptr content2 (new DCPContent(film->dir(film->dcp_name()))); + auto content2 = make_shared(film->dir(film->dcp_name())); content2->add_kdm (kdm); - film2->examine_and_add_content (content2); - BOOST_REQUIRE (!wait_for_jobs()); - - film2->make_dcp (); - BOOST_REQUIRE (!wait_for_jobs()); + auto film2 = new_test_film2 ("atmos_encrypted_passthrough_test2", {content2}, &cl); + make_and_verify_dcp (film2, { dcp::VerificationNote::Code::MISSING_CPL_METADATA }); BOOST_CHECK (mxf_atmos_files_same(ref, dcp_file(film2, "atmos"), true)); + + cl.run (); +} + + +BOOST_AUTO_TEST_CASE (atmos_trim_test) +{ + Cleanup cl; + + auto ref = TestPaths::private_data() / "atmos_asset.mxf"; + auto content = content_factory (TestPaths::private_data() / "atmos_asset.mxf").front(); + auto film = new_test_film2 ("atmos_trim_test", {content}, &cl); + + content->set_trim_start (dcpomatic::ContentTime::from_seconds(1)); + + /* Just check that the encode runs; I'm not sure how to test the MXF */ + make_and_verify_dcp (film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA }); }