X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fhints_test.cc;h=c228cd07af4c6b38089c259dd9242a0b0785b20f;hb=3d40a861b4e77f04df7196cffda5b41b9852b2c7;hp=f929da9c46f993f64b1596c27ad1493a6de376cf;hpb=03dac68294060d84f57cf255584c2a7ca0dccc07;p=dcpomatic.git diff --git a/test/hints_test.cc b/test/hints_test.cc index f929da9c4..c228cd07a 100644 --- a/test/hints_test.cc +++ b/test/hints_test.cc @@ -19,6 +19,7 @@ */ +#include "lib/audio_content.h" #include "lib/content.h" #include "lib/content_factory.h" #include "lib/cross.h" @@ -55,6 +56,8 @@ get_hints (shared_ptr film) { current_hints.clear (); Hints hints (film); + /* None of our tests need the audio analysis, and it is quite time-consuming */ + hints.disable_audio_analysis (); hints.Hint.connect (collect_hint); hints.start (); hints.join (); @@ -222,3 +225,35 @@ BOOST_AUTO_TEST_CASE (hint_closed_caption_xml_too_big) ); } + +BOOST_AUTO_TEST_CASE (hints_destroyed_while_running) +{ + auto film = new_test_film2 ("hints_destroyed_while_running"); + auto content = content_factory(TestPaths::private_data() / "boon_telly.mkv").front(); + film->examine_and_add_content (content); + BOOST_REQUIRE (!wait_for_jobs()); + + auto hints = make_shared(film); + hints->start (); + dcpomatic_sleep_seconds (1); + hints.reset (); + dcpomatic_sleep_seconds (1); +} + + +BOOST_AUTO_TEST_CASE (hints_audio_with_no_language) +{ + auto content = content_factory("test/data/sine_440.wav").front(); + auto film = new_test_film2 ("hints_audio_with_no_language", { content }); + content->audio->set_gain (-6); + + auto hints = get_hints (film); + BOOST_REQUIRE_EQUAL (hints.size(), 1U); + BOOST_CHECK_EQUAL ( + hints[0], + "Some of your content has audio but you have not set the audio language. It is advisable to set the audio language " + "in the \"DCP\" tab unless your audio has no spoken parts." + ); + +} +