X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Ftest.cc;h=7497a0ea12f47727838d2ef895da42301c1eec53;hb=c0264efd6f273fa2d4ed8126b2ea673f31d7d539;hp=4dab0cff1b5895c0e197e19c0db140092662757e;hpb=62f9b78a2eb5f0fc6b9028264bac6ad501d83309;p=dcpomatic.git diff --git a/test/test.cc b/test/test.cc index 4dab0cff1..7497a0ea1 100644 --- a/test/test.cc +++ b/test/test.cc @@ -38,6 +38,7 @@ #include "lib/job.h" #include "lib/job_manager.h" #include "lib/log_entry.h" +#include "lib/make_dcp.h" #include "lib/ratio.h" #include "lib/signal_manager.h" #include "lib/util.h" @@ -99,10 +100,10 @@ boost::filesystem::path TestPaths::xsd () } -void +static void setup_test_config () { - Config::instance()->set_master_encoding_threads (boost::thread::hardware_concurrency()); + Config::instance()->set_master_encoding_threads (boost::thread::hardware_concurrency() / 2); Config::instance()->set_server_encoding_threads (1); Config::instance()->set_server_port_base (61921); Config::instance()->set_default_container (Ratio::from_id ("185")); @@ -129,7 +130,7 @@ class TestSignalManager : public SignalManager { public: /* No wakes in tests: we call ui_idle ourselves */ - void wake_ui () + void wake_ui () override { } @@ -364,12 +365,12 @@ double rms_error (boost::filesystem::path ref, boost::filesystem::path check) { FFmpegImageProxy ref_proxy (ref); - auto ref_image = ref_proxy.image().image; + auto ref_image = ref_proxy.image(Image::Alignment::COMPACT).image; FFmpegImageProxy check_proxy (check); - auto check_image = check_proxy.image().image; + auto check_image = check_proxy.image(Image::Alignment::COMPACT).image; BOOST_REQUIRE_EQUAL (ref_image->pixel_format(), check_image->pixel_format()); - AVPixelFormat const format = ref_image->pixel_format(); + auto const format = ref_image->pixel_format(); BOOST_REQUIRE (ref_image->size() == check_image->size()); int const width = ref_image->size().width; @@ -893,7 +894,7 @@ void make_and_verify_dcp (shared_ptr film, vector ignore) { film->write_metadata (); - film->make_dcp (); + make_dcp (film, TranscodeJob::ChangedBehaviour::IGNORE); BOOST_REQUIRE (!wait_for_jobs()); auto notes = dcp::verify ({film->dir(film->dcp_name())}, &stage, &progress, TestPaths::xsd()); bool ok = true; @@ -920,3 +921,10 @@ check_int_close (std::pair a, std::pair b, int d) check_int_close (a.first, b.first, d); check_int_close (a.second, b.second, d); } + + +ConfigRestorer::~ConfigRestorer() +{ + setup_test_config(); +} +