X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Finterrupt_encoder_test.cc;h=5b76e67d357d44b347d4b347fdff954eb4e2f0c3;hb=8aec035b6ec6d8a119aef8748d571a65c3de386b;hp=8883c2d6f43e97c781d6e388875502bcfa3daf27;hpb=876369d704d2f536906a7e26ef80927ba97ebd0c;p=dcpomatic.git diff --git a/test/interrupt_encoder_test.cc b/test/interrupt_encoder_test.cc index 8883c2d6f..5b76e67d3 100644 --- a/test/interrupt_encoder_test.cc +++ b/test/interrupt_encoder_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2016 Carl Hetherington + Copyright (C) 2016-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,35 +18,45 @@ */ -#include "lib/film.h" + +/** @file test/interrupt_encoder_test.cc + * @brief Test clean shutdown of threads if a DCP encode is interrupted. + * @ingroup feature + */ + + +#include "lib/audio_content.h" +#include "lib/cross.h" #include "lib/dcp_content_type.h" -#include "lib/ratio.h" #include "lib/ffmpeg_content.h" -#include "lib/audio_content.h" +#include "lib/film.h" #include "lib/job_manager.h" -#include "lib/cross.h" +#include "lib/ratio.h" #include "test.h" #include -using boost::shared_ptr; + +using std::make_shared; +using std::shared_ptr; + /** Interrupt a DCP encode when it is in progress, as this used to (still does?) * sometimes give an error related to pthreads. */ BOOST_AUTO_TEST_CASE (interrupt_encoder_test) { - shared_ptr film = new_test_film ("interrupt_encoder_test"); - film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR")); - film->set_container (Ratio::from_id ("185")); + auto film = new_test_film ("interrupt_encoder_test"); + film->set_dcp_content_type (DCPContentType::from_isdcf_name("FTR")); + film->set_container (Ratio::from_id("185")); film->set_name ("interrupt_encoder_test"); - shared_ptr content (new FFmpegContent (film, private_data / "prophet_clip.mkv")); + auto content = make_shared(TestPaths::private_data() / "prophet_long_clip.mkv"); film->examine_and_add_content (content); - wait_for_jobs (); + BOOST_REQUIRE (!wait_for_jobs()); - film->make_dcp (); + film->make_dcp (TranscodeJob::ChangedBehaviour::IGNORE); - dcpomatic_sleep (10); + dcpomatic_sleep_seconds (10); JobManager::drop (); }