summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-08-29 12:11:20 +0100
committerCarl Hetherington <cth@carlh.net>2013-08-29 12:11:20 +0100
commit1d347f4ed0f7840236a91477075f4dc7af16f23d (patch)
treeb16589bef7285ada4c51473686a21f9934057ee8
parent7287abe9609c2648e37b965efb1e1fa2bb0ce17a (diff)
Try again to fix ui signalling during tests.
-rw-r--r--src/lib/examine_content_job.cc1
-rw-r--r--src/lib/job_manager.cc1
-rw-r--r--test/audio_delay_test.cc1
-rw-r--r--test/test.cc19
4 files changed, 18 insertions, 4 deletions
diff --git a/src/lib/examine_content_job.cc b/src/lib/examine_content_job.cc
index 3cab9716d..cbf180ffc 100644
--- a/src/lib/examine_content_job.cc
+++ b/src/lib/examine_content_job.cc
@@ -26,6 +26,7 @@
#include "i18n.h"
using std::string;
+using std::cout;
using boost::shared_ptr;
ExamineContentJob::ExamineContentJob (shared_ptr<const Film> f, shared_ptr<Content> c)
diff --git a/src/lib/job_manager.cc b/src/lib/job_manager.cc
index 95961c3fc..a841fa60b 100644
--- a/src/lib/job_manager.cc
+++ b/src/lib/job_manager.cc
@@ -30,6 +30,7 @@
using std::string;
using std::list;
+using std::cout;
using boost::shared_ptr;
using boost::weak_ptr;
diff --git a/test/audio_delay_test.cc b/test/audio_delay_test.cc
index 929a941d6..77243ea6d 100644
--- a/test/audio_delay_test.cc
+++ b/test/audio_delay_test.cc
@@ -29,6 +29,7 @@
#include "test.h"
using std::string;
+using std::cout;
using boost::lexical_cast;
using boost::shared_ptr;
diff --git a/test/test.cc b/test/test.cc
index 1c7b7e245..154510738 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -39,6 +39,16 @@ using std::cerr;
using std::list;
using boost::shared_ptr;
+class TestUISignaller : public UISignaller
+{
+public:
+ /* No wakes in tests: we call ui_idle ourselves */
+ void wake_ui ()
+ {
+
+ }
+};
+
struct TestConfig
{
TestConfig()
@@ -52,7 +62,7 @@ struct TestConfig
Config::instance()->set_default_container (static_cast<Ratio*> (0));
Config::instance()->set_default_dcp_content_type (static_cast<DCPContentType*> (0));
- ui_signaller = new UISignaller ();
+ ui_signaller = new TestUISignaller ();
}
};
@@ -141,7 +151,9 @@ void
wait_for_jobs ()
{
JobManager* jm = JobManager::instance ();
- while (jm->work_to_do ()) {}
+ while (jm->work_to_do ()) {
+ ui_signaller->ui_idle ();
+ }
if (jm->errors ()) {
for (list<shared_ptr<Job> >::iterator i = jm->_jobs.begin(); i != jm->_jobs.end(); ++i) {
if ((*i)->finished_in_error ()) {
@@ -153,6 +165,5 @@ wait_for_jobs ()
BOOST_CHECK (!jm->errors());
- /* Hack: wait for ui_signaller signals to fire */
- dcpomatic_sleep (1);
+ ui_signaller->ui_idle ();
}