From bbd20953701383dddc4c45d2ab317d55845d8b89 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 15 Jul 2013 13:51:19 +0100 Subject: [PATCH] Use wait_for_jobs more. --- test/black_fill_test.cc | 2 +- test/ffmpeg_dcp_test.cc | 13 ++----------- test/scaling_test.cc | 7 +++---- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/test/black_fill_test.cc b/test/black_fill_test.cc index 60b215ffb..51ce605f8 100644 --- a/test/black_fill_test.cc +++ b/test/black_fill_test.cc @@ -39,7 +39,7 @@ BOOST_AUTO_TEST_CASE (black_fill_test) film->examine_and_add_content (contentA); film->examine_and_add_content (contentB); - while (JobManager::instance()->work_to_do ()) {} + wait_for_jobs (); contentA->set_video_length (3); contentA->set_start (film->video_frames_to_time (2)); diff --git a/test/ffmpeg_dcp_test.cc b/test/ffmpeg_dcp_test.cc index 06cb56e7d..946bccbb8 100644 --- a/test/ffmpeg_dcp_test.cc +++ b/test/ffmpeg_dcp_test.cc @@ -29,23 +29,14 @@ BOOST_AUTO_TEST_CASE (ffmpeg_dcp_test) c->set_ratio (Ratio::from_id ("185")); film->examine_and_add_content (c); - /* Wait for the examine to finish */ - while (JobManager::instance()->work_to_do ()) { - dcpomatic_sleep (1); - } - - BOOST_CHECK_EQUAL (JobManager::instance()->errors(), false); + wait_for_jobs (); film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test")); film->make_dcp (); film->write_metadata (); - while (JobManager::instance()->work_to_do ()) { - dcpomatic_sleep (1); - } - - BOOST_CHECK_EQUAL (JobManager::instance()->errors(), false); + wait_for_jobs (); } /** Test Film::have_dcp(). Requires the output from ffmpeg_dcp_test above */ diff --git a/test/scaling_test.cc b/test/scaling_test.cc index ab64928ce..fd700fbb9 100644 --- a/test/scaling_test.cc +++ b/test/scaling_test.cc @@ -31,9 +31,7 @@ static void scaling_test_for (shared_ptr film, shared_ptr co film->set_container (Ratio::from_id (container)); film->make_dcp (); - while (JobManager::instance()->work_to_do ()) {} - - BOOST_CHECK (!JobManager::instance()->errors()); + wait_for_jobs (); boost::filesystem::path ref; ref = "test"; @@ -57,7 +55,8 @@ BOOST_AUTO_TEST_CASE (scaling_test) shared_ptr imc (new ImageMagickContent (film, "test/data/simple_testcard_640x480.png")); film->examine_and_add_content (imc); - while (JobManager::instance()->work_to_do ()) {} + + wait_for_jobs (); imc->set_video_length (1); -- 2.30.2