diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-02-12 00:06:13 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-02-12 00:06:13 +0100 |
| commit | 6f9adc9f7215a362d23e45b861017638ec67c723 (patch) | |
| tree | 81c07fa6ddc8dca328c269bdfc8f2534c46ccd2c /test | |
| parent | eade5cc8657f51d1d768b705936e918f8d1f53ee (diff) | |
| parent | eb04ac87ccfa046dd342ca7b9e6478c3bdcabbba (diff) | |
Merge branch 'main' into v2.17.x
Diffstat (limited to 'test')
| -rw-r--r-- | test/audio_analysis_test.cc | 25 | ||||
| -rw-r--r-- | test/audio_ring_buffers_test.cc | 2 | ||||
| m--------- | test/data | 0 | ||||
| -rw-r--r-- | test/subtitle_font_id_test.cc | 11 |
4 files changed, 36 insertions, 2 deletions
diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc index 8bdca4c32..8ded9eda9 100644 --- a/test/audio_analysis_test.cc +++ b/test/audio_analysis_test.cc @@ -41,6 +41,7 @@ #include "lib/ratio.h" #include "test.h" #include <boost/test/unit_test.hpp> +#include <numeric> using std::make_shared; @@ -283,3 +284,27 @@ BOOST_AUTO_TEST_CASE(analyse_audio_with_more_channels_than_film) BOOST_CHECK(!wait_for_jobs()); } + +BOOST_AUTO_TEST_CASE(analyse_audio_uses_processor_when_analysing_whole_film) +{ + auto sound = content_factory(TestPaths::private_data() / "betty_stereo.wav")[0]; + auto film = new_test_film2("analyse_audio_uses_processor_when_analysing_whole_film", { sound }); + + auto job = make_shared<AnalyseAudioJob>(film, film->playlist(), true); + JobManager::instance()->add(job); + BOOST_REQUIRE(!wait_for_jobs()); + + AudioAnalysis analysis(job->path()); + + BOOST_REQUIRE(analysis.channels() > 2); + bool centre_non_zero = false; + /* Make sure there's something from the mid-side decoder on the centre channel */ + for (auto point = 0; point < analysis.points(2); ++point) { + if (std::abs(analysis.get_point(2, point)[AudioPoint::Type::PEAK]) > 0) { + centre_non_zero = true; + } + } + + BOOST_CHECK(centre_non_zero); +} + diff --git a/test/audio_ring_buffers_test.cc b/test/audio_ring_buffers_test.cc index ef64f5fba..265142d53 100644 --- a/test/audio_ring_buffers_test.cc +++ b/test/audio_ring_buffers_test.cc @@ -30,8 +30,6 @@ using namespace dcpomatic; #define CANARY 9999 -/* XXX: these tests don't check the timestamping in AudioRingBuffers */ - /** Basic tests fetching the same number of channels as went in */ BOOST_AUTO_TEST_CASE (audio_ring_buffers_test1) { diff --git a/test/data b/test/data -Subproject a5b12872bf034712039414fad58e7e68c068b77 +Subproject ddf878730354cdec8a802a59543591f6f943f5c diff --git a/test/subtitle_font_id_test.cc b/test/subtitle_font_id_test.cc index 9575868a1..bc09a9cf1 100644 --- a/test/subtitle_font_id_test.cc +++ b/test/subtitle_font_id_test.cc @@ -23,6 +23,7 @@ #include "lib/dcp_content.h" #include "lib/film.h" #include "lib/font.h" +#include "lib/player.h" #include "lib/text_content.h" #include "lib/util.h" #include <dcp/cpl.h> @@ -291,3 +292,13 @@ BOOST_AUTO_TEST_CASE(use_first_loadfont_as_default) BOOST_REQUIRE_EQUAL(subtitle->font_data().size(), 1U); BOOST_CHECK(subtitle->font_data().begin()->second == dcp::ArrayData("test/data/Inconsolata-VF.ttf")); } + + +BOOST_AUTO_TEST_CASE(no_error_with_ccap_that_mentions_no_font) +{ + auto dcp = make_shared<DCPContent>("test/data/ccap_only"); + auto film = new_test_film2("no_error_with_ccap_that_mentions_no_font", { dcp }); + auto player = Player(film, film->playlist()); + while (!player.pass()) {} +} + |
