X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fdigest_test.cc;h=2911a43b3c201dbf37f6dbad4ec47c1319feea7b;hb=20c70c93a38551842721ddee2e08c7b33a7bb924;hp=f7480132e58660e543c161e609305dbd97496152;hpb=2ae3d1c397dd3ca75c707e46592198b3a83f4444;p=dcpomatic.git diff --git a/test/digest_test.cc b/test/digest_test.cc index f7480132e..2911a43b3 100644 --- a/test/digest_test.cc +++ b/test/digest_test.cc @@ -18,10 +18,16 @@ */ +/** @file test/digest_test.cc + * @brief Check computed DCP digests against references calculated by the `openssl` binary. + * @ingroup specific + */ + #include "lib/film.h" #include "lib/image_content.h" #include "lib/dcp_content_type.h" #include "lib/compose.hpp" +#include "lib/config.h" #include "test.h" #include #include @@ -57,17 +63,18 @@ BOOST_AUTO_TEST_CASE (digest_test) shared_ptr film = new_test_film ("digest_test"); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST")); film->set_name ("digest_test"); - shared_ptr r (new ImageContent (film, "test/data/flat_red.png")); - shared_ptr g (new ImageContent (film, "test/data/flat_green.png")); - shared_ptr b (new ImageContent (film, "test/data/flat_blue.png")); + shared_ptr r (new ImageContent("test/data/flat_red.png")); + shared_ptr g (new ImageContent("test/data/flat_green.png")); + shared_ptr b (new ImageContent("test/data/flat_blue.png")); film->examine_and_add_content (r); film->examine_and_add_content (g); film->examine_and_add_content (b); film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT); - wait_for_jobs (); + BOOST_REQUIRE (!wait_for_jobs()); + BOOST_CHECK (Config::instance()->master_encoding_threads() > 1); film->make_dcp (); - wait_for_jobs (); + BOOST_REQUIRE (!wait_for_jobs()); dcp::DCP dcp (film->dir (film->dcp_name ())); dcp.read (); @@ -76,13 +83,19 @@ BOOST_AUTO_TEST_CASE (digest_test) list >::const_iterator i = reels.begin (); BOOST_REQUIRE (i != reels.end ()); - BOOST_CHECK_EQUAL ((*i)->main_picture()->hash().get(), openssl_hash ((*i)->main_picture()->asset()->file ())); + BOOST_REQUIRE ((*i)->main_picture()->hash()); + BOOST_REQUIRE ((*i)->main_picture()->asset()->file()); + BOOST_CHECK_EQUAL ((*i)->main_picture()->hash().get(), openssl_hash ((*i)->main_picture()->asset()->file().get())); ++i; BOOST_REQUIRE (i != reels.end ()); - BOOST_CHECK_EQUAL ((*i)->main_picture()->hash().get(), openssl_hash ((*i)->main_picture()->asset()->file ())); + BOOST_REQUIRE ((*i)->main_picture()->hash()); + BOOST_REQUIRE ((*i)->main_picture()->asset()->file()); + BOOST_CHECK_EQUAL ((*i)->main_picture()->hash().get(), openssl_hash ((*i)->main_picture()->asset()->file().get())); ++i; BOOST_REQUIRE (i != reels.end ()); - BOOST_CHECK_EQUAL ((*i)->main_picture()->hash().get(), openssl_hash ((*i)->main_picture()->asset()->file ())); + BOOST_REQUIRE ((*i)->main_picture()->hash()); + BOOST_REQUIRE ((*i)->main_picture()->asset()->file()); + BOOST_CHECK_EQUAL ((*i)->main_picture()->hash().get(), openssl_hash ((*i)->main_picture()->asset()->file().get())); ++i; BOOST_REQUIRE (i == reels.end ()); }