summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-07-11 23:17:06 +0200
committerCarl Hetherington <cth@carlh.net>2024-07-14 17:54:42 +0200
commit96662de49cdc00780800fcc914e6dd7b949d9340 (patch)
tree4268100a193cbca2da585fdd733112833424ac03
parentc2b7422b8f0ad9fdf1e6e174a90486fb9e6346f4 (diff)
Fix tests on Ubuntu 24.04.
-rw-r--r--test/burnt_subtitle_test.cc16
m---------test/data0
-rw-r--r--test/render_subtitles_test.cc4
3 files changed, 17 insertions, 3 deletions
diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc
index 2be712262..185f69839 100644
--- a/test/burnt_subtitle_test.cc
+++ b/test/burnt_subtitle_test.cc
@@ -45,6 +45,7 @@
#include <dcp/openjpeg_image.h>
#include <dcp/reel_picture_asset.h>
#include <dcp/reel_mono_picture_asset.h>
+#include <pango/pango-utils.h>
#include <boost/test/unit_test.hpp>
@@ -55,6 +56,15 @@ using std::string;
using namespace dcpomatic;
+/* Some of these tests produce slightly different outputs on different platforms / OS versions.
+ * I'm not sure of the cause of these differences, but as it happens the tests on Ubuntu 24.04
+ * produce the same results as on macOS, while the Ubuntu 22.04 results are slightly different.
+ * Hence the hacks in this file to check for DCPOMATIC_OSX or the Ubuntu 24.04 version of Pango
+ * (22.04 uses Pango 1.52.1, 24.04 is 1.50.6, macOS is 1.51.0). Maybe it has nothing to do
+ * with Pango, of course...
+ */
+
+
/** Build a small DCP with no picture and a single subtitle overlaid onto it from a SubRip file */
BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip)
{
@@ -70,7 +80,7 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip)
#if defined(DCPOMATIC_WINDOWS)
check_dcp("test/data/windows/burnt_subtitle_test_subrip", film);
-#elif defined(DCPOMATIC_OSX)
+#elif defined(DCPOMATIC_OSX) || PANGO_VERSION_CHECK(1, 52, 1)
check_dcp("test/data/mac/burnt_subtitle_test_subrip", film);
#else
check_dcp("test/data/burnt_subtitle_test_subrip", film);
@@ -133,7 +143,7 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_onto_dcp)
#if defined(DCPOMATIC_WINDOWS)
check_dcp("test/data/windows/burnt_subtitle_test_onto_dcp2", film2);
-#elif defined(DCPOMATIC_OSX)
+#elif defined(DCPOMATIC_OSX) || PANGO_VERSION_CHECK(1, 52, 1)
check_dcp("test/data/mac/burnt_subtitle_test_onto_dcp2", film2);
#else
check_dcp("test/data/burnt_subtitle_test_onto_dcp2", film2);
@@ -162,7 +172,7 @@ BOOST_AUTO_TEST_CASE(burnt_subtitle_test_position)
#if defined(DCPOMATIC_WINDOWS)
check_dcp(String::compose("test/data/windows/%1", name), film);
-#elif defined(DCPOMATIC_OSX)
+#elif defined(DCPOMATIC_OSX) || PANGO_VERSION_CHECK(1, 52, 1)
check_dcp(String::compose("test/data/mac/%1", name), film);
#else
check_dcp(String::compose("test/data/%1", name), film);
diff --git a/test/data b/test/data
-Subproject e789dcb8769e329e33b2eb94f283c69f91deb92
+Subproject 4bb1b94fd1eda87051242a54309ca59a34c7b6e
diff --git a/test/render_subtitles_test.cc b/test/render_subtitles_test.cc
index e3034def0..9ff3c3817 100644
--- a/test/render_subtitles_test.cc
+++ b/test/render_subtitles_test.cc
@@ -31,6 +31,7 @@
#include "lib/string_text.h"
#include "test.h"
#include <dcp/subtitle_string.h>
+#include <pango/pango-utils.h>
#include <boost/test/unit_test.hpp>
@@ -167,6 +168,9 @@ BOOST_AUTO_TEST_CASE(render_text_with_newline_test)
check_image("test/data/mac/render_text_with_newline_test.png", "build/test/render_text_with_newline_test.png");
#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, 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");
#else
check_image("test/data/render_text_with_newline_test.png", "build/test/render_text_with_newline_test.png");
#endif