Fix warnings.
[dcpomatic.git] / test / test.cc
index 0de7ace62d737641dcb7c93b612daa94b50e121f..0636c6e4875667181c96e0e6eaa82dc5414ffd95 100644 (file)
@@ -46,6 +46,7 @@ using std::min;
 using std::cout;
 using std::cerr;
 using std::list;
+using std::abs;
 using boost::shared_ptr;
 using boost::scoped_array;
 
@@ -68,7 +69,7 @@ struct TestConfig
                dcpomatic_setup ();
 
                Config::instance()->set_num_local_encoding_threads (1);
-               Config::instance()->set_server_port_base (61920);
+               Config::instance()->set_server_port_base (61921);
                Config::instance()->set_default_isdcf_metadata (ISDCFMetadata ());
                Config::instance()->set_default_container (Ratio::from_id ("185"));
                Config::instance()->set_default_dcp_content_type (static_cast<DCPContentType*> (0));
@@ -143,7 +144,7 @@ check_audio_file (boost::filesystem::path ref, boost::filesystem::path check)
                BOOST_CHECK_EQUAL (r, this_time);
 
                for (sf_count_t i = 0; i < this_time; ++i) {
-                       BOOST_CHECK (fabs (ref_buffer[i] - check_buffer[i]) <= 65536);
+                       BOOST_REQUIRE (abs (ref_buffer[i] - check_buffer[i]) <= 65536);
                }
 
                N -= this_time;
@@ -210,7 +211,7 @@ check_dcp (boost::filesystem::path ref, boost::filesystem::path check)
        options.max_std_dev_pixel_error = 5;
        options.max_audio_sample_error = 255;
        options.cpl_annotation_texts_can_differ = true;
-       options.mxf_filenames_can_differ = true;
+       options.reel_annotation_texts_can_differ = true;
        options.reel_hashes_can_differ = true;
        
        BOOST_CHECK (ref_dcp.equals (check_dcp, options, boost::bind (note, _1, _2)));
@@ -287,6 +288,9 @@ wait_for_jobs ()
        while (jm->work_to_do ()) {
                signal_manager->ui_idle ();
        }
+
+       cout << "Waiting for jobs: all finished; errors=" << jm->errors() << ".\n";
+       
        if (jm->errors ()) {
                int N = 0;
                for (list<shared_ptr<Job> >::iterator i = jm->_jobs.begin(); i != jm->_jobs.end(); ++i) {
@@ -307,8 +311,12 @@ wait_for_jobs ()
 
        signal_manager->ui_idle ();
 
-       /* Discard all jobs so we lose any we just reported an error in */
-       JobManager::drop ();
+       if (jm->errors ()) {
+               cout << "Dropping JobManager\n";
+               JobManager::drop ();
+       } else {
+               cout << "Not dropping JobManager\n";
+       }
 }
 
 void