diff options
Diffstat (limited to 'test')
| m--------- | test/data | 0 | ||||
| -rw-r--r-- | test/render_subtitles_test.cc | 7 | ||||
| -rw-r--r-- | test/test.cc | 7 | ||||
| -rw-r--r-- | test/test.h | 1 |
4 files changed, 13 insertions, 2 deletions
diff --git a/test/data b/test/data -Subproject fe6973d73602cff710f5ea2396a47074b21686d +Subproject 2576ae9426703165d81eb44776d515a54eda587 diff --git a/test/render_subtitles_test.cc b/test/render_subtitles_test.cc index 4e87abde0..4fc98cb56 100644 --- a/test/render_subtitles_test.cc +++ b/test/render_subtitles_test.cc @@ -176,8 +176,11 @@ BOOST_AUTO_TEST_CASE(render_text_with_newline_test) #elif defined(DCPOMATIC_WINDOWS) check_image("test/data/windows/render_text_with_newline_test.png", "build/test/render_text_with_newline_test.png"); #elif PANGO_VERSION_CHECK(1, 57, 0) - /* This pango version is the one on Arch, which renders slightly differently */ - check_image("test/data/arch/render_text_with_newline_test.png", "build/test/render_text_with_newline_test.png"); + /* This pango version is the one on Arch and Ubuntu 26.04, both of which render slightly differently */ + BOOST_REQUIRE( + check_image_and_report("test/data/arch/render_text_with_newline_test.png", "build/test/render_text_with_newline_test.png") + || check_image_and_report("test/data/ubuntu-26.04/render_text_with_newline_test.png", "build/test/render_text_with_newline_test.png") + ); #elif PANGO_VERSION_CHECK(1, 52, 1) /* This pango version is the one on Ubuntu 24.04, which renders slightly differently */ check_image("test/data/ubuntu-24.04/render_text_with_newline_test.png", "build/test/render_text_with_newline_test.png"); diff --git a/test/test.cc b/test/test.cc index 641ee4085..27b00b9d3 100644 --- a/test/test.cc +++ b/test/test.cc @@ -473,6 +473,13 @@ check_image (boost::filesystem::path ref, boost::filesystem::path check, double } +bool +check_image_and_report(boost::filesystem::path ref, boost::filesystem::path check, double threshold) +{ + return rms_error(ref, check) < threshold; +} + + void check_file (boost::filesystem::path ref, boost::filesystem::path check) { diff --git a/test/test.h b/test/test.h index 172edcf71..cd40c7872 100644 --- a/test/test.h +++ b/test/test.h @@ -69,6 +69,7 @@ extern bool mxf_atmos_files_same (boost::filesystem::path ref, boost::filesystem extern void check_xml(boost::filesystem::path, boost::filesystem::path, std::list<Glib::ustring>); extern void check_ffmpeg(boost::filesystem::path, boost::filesystem::path, float audio_tolerance); extern void check_image(boost::filesystem::path ref, boost::filesystem::path check, double threshold = 4); +extern bool check_image_and_report(boost::filesystem::path ref, boost::filesystem::path check, double threshold = 4); extern boost::filesystem::path test_film_dir (std::string); extern void write_image (std::shared_ptr<const Image> image, boost::filesystem::path file); boost::filesystem::path dcp_file (std::shared_ptr<const Film> film, std::string prefix); |
