X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fdcp_decoder_test.cc;h=c1ad90d6f66a015efc0f4b427e26709bcf5241a4;hb=369821c41e62d4cce506cd4206f9db0d91b4f643;hp=32eed9354cfcd09c99e4bec11d61dd161fed3ecc;hpb=d366e853399d3247077aa1a04d8b6d6ef38c7cfc;p=dcpomatic.git diff --git a/test/dcp_decoder_test.cc b/test/dcp_decoder_test.cc index 32eed9354..c1ad90d6f 100644 --- a/test/dcp_decoder_test.cc +++ b/test/dcp_decoder_test.cc @@ -39,21 +39,22 @@ using std::list; using std::string; using std::vector; -using boost::shared_ptr; +using std::make_shared; +using std::shared_ptr; /* Check that DCPDecoder reuses old data when it should */ BOOST_AUTO_TEST_CASE (check_reuse_old_data_test) { /* Make some DCPs */ - shared_ptr ov = new_test_film2 ("check_reuse_old_data_ov"); + auto ov = new_test_film2 ("check_reuse_old_data_ov"); ov->examine_and_add_content (content_factory("test/data/flat_red.png").front()); BOOST_REQUIRE (!wait_for_jobs()); ov->make_dcp (); BOOST_REQUIRE (!wait_for_jobs()); - shared_ptr vf = new_test_film2 ("check_reuse_old_data_vf"); - shared_ptr ov_content(new DCPContent(ov->dir(ov->dcp_name(false)))); + auto vf = new_test_film2 ("check_reuse_old_data_vf"); + auto ov_content = make_shared(ov->dir(ov->dcp_name(false))); vf->examine_and_add_content (ov_content); vf->examine_and_add_content (content_factory("test/data/L.wav").front()); BOOST_REQUIRE (!wait_for_jobs()); @@ -61,7 +62,7 @@ BOOST_AUTO_TEST_CASE (check_reuse_old_data_test) vf->make_dcp (); BOOST_REQUIRE (!wait_for_jobs()); - shared_ptr encrypted = new_test_film2 ("check_reuse_old_data_decrypted"); + auto encrypted = new_test_film2 ("check_reuse_old_data_decrypted"); encrypted->examine_and_add_content (content_factory("test/data/flat_red.png").front()); BOOST_REQUIRE (!wait_for_jobs()); encrypted->set_encrypted (true); @@ -71,13 +72,13 @@ BOOST_AUTO_TEST_CASE (check_reuse_old_data_test) dcp::DCP encrypted_dcp (encrypted->dir(encrypted->dcp_name())); encrypted_dcp.read (); - dcp::EncryptedKDM kdm = encrypted->make_kdm ( + auto kdm = encrypted->make_kdm ( Config::instance()->decryption_chain()->leaf(), vector(), encrypted_dcp.cpls().front()->file().get(), dcp::LocalTime ("2030-07-21T00:00:00+00:00"), dcp::LocalTime ("2031-07-21T00:00:00+00:00"), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, true, 0 ); @@ -85,18 +86,18 @@ BOOST_AUTO_TEST_CASE (check_reuse_old_data_test) /* Add just the OV to a new project, move it around a bit and check that the _reels get reused. */ - shared_ptr test = new_test_film2 ("check_reuse_old_data_test1"); - ov_content.reset (new DCPContent(ov->dir(ov->dcp_name(false)))); + auto test = new_test_film2 ("check_reuse_old_data_test1"); + ov_content = make_shared(ov->dir(ov->dcp_name(false))); test->examine_and_add_content (ov_content); BOOST_REQUIRE (!wait_for_jobs()); - shared_ptr player (new Player(test, test->playlist())); + auto player = make_shared(test); - shared_ptr decoder = boost::dynamic_pointer_cast(player->_pieces.front()->decoder); + auto decoder = std::dynamic_pointer_cast(player->_pieces.front()->decoder); BOOST_REQUIRE (decoder); - list > reels = decoder->reels(); + auto reels = decoder->reels(); ov_content->set_position (test, dcpomatic::DCPTime(96000)); - decoder = boost::dynamic_pointer_cast(player->_pieces.front()->decoder); + decoder = std::dynamic_pointer_cast(player->_pieces.front()->decoder); BOOST_REQUIRE (decoder); BOOST_REQUIRE (reels == decoder->reels()); @@ -104,37 +105,37 @@ BOOST_AUTO_TEST_CASE (check_reuse_old_data_test) _reels did not get reused. */ test = new_test_film2 ("check_reuse_old_data_test2"); - shared_ptr vf_content (new DCPContent(vf->dir(vf->dcp_name(false)))); + auto vf_content = make_shared(vf->dir(vf->dcp_name(false))); test->examine_and_add_content (vf_content); BOOST_REQUIRE (!wait_for_jobs()); - player.reset (new Player(test, test->playlist())); + player.reset (new Player(test)); - decoder = boost::dynamic_pointer_cast(player->_pieces.front()->decoder); + decoder = std::dynamic_pointer_cast(player->_pieces.front()->decoder); BOOST_REQUIRE (decoder); reels = decoder->reels(); vf_content->add_ov (ov->dir(ov->dcp_name(false))); - JobManager::instance()->add (shared_ptr(new ExamineContentJob(test, vf_content))); + JobManager::instance()->add (make_shared(test, vf_content)); BOOST_REQUIRE (!wait_for_jobs()); - decoder = boost::dynamic_pointer_cast(player->_pieces.front()->decoder); + decoder = std::dynamic_pointer_cast(player->_pieces.front()->decoder); BOOST_REQUIRE (decoder); BOOST_REQUIRE (reels != decoder->reels()); /* Add a KDM to an encrypted DCP and check that the _reels did not get reused */ test = new_test_film2 ("check_reuse_old_data_test3"); - shared_ptr encrypted_content (new DCPContent(encrypted->dir(encrypted->dcp_name(false)))); + auto encrypted_content = make_shared(encrypted->dir(encrypted->dcp_name(false))); test->examine_and_add_content (encrypted_content); BOOST_REQUIRE (!wait_for_jobs()); - player.reset (new Player(test, test->playlist())); + player = make_shared(test); - decoder = boost::dynamic_pointer_cast(player->_pieces.front()->decoder); + decoder = std::dynamic_pointer_cast(player->_pieces.front()->decoder); BOOST_REQUIRE (decoder); reels = decoder->reels(); encrypted_content->add_kdm (kdm); - JobManager::instance()->add (shared_ptr(new ExamineContentJob(test, encrypted_content))); + JobManager::instance()->add (make_shared(test, encrypted_content)); BOOST_REQUIRE (!wait_for_jobs()); - decoder = boost::dynamic_pointer_cast(player->_pieces.front()->decoder); + decoder = std::dynamic_pointer_cast(player->_pieces.front()->decoder); BOOST_REQUIRE (decoder); BOOST_REQUIRE (reels != decoder->reels()); }