From: Emmanuele Bassi Date: Tue, 18 Jan 2022 12:30:47 +0000 (+0000) Subject: reftest: Avoid assertions being compiled out X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~19^2~4^2~77^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=23aec81f1ade10e2c9fddc1cef6475bad137b952;p=gtk4.git reftest: Avoid assertions being compiled out Calling functions inside a g_assert() means those functions will be compiled out when building with G_DISABLE_ASSERT. This fixes the release job in the CI pipeline. --- diff --git a/testsuite/reftests/gtk-reftest.c b/testsuite/reftests/gtk-reftest.c index 1dd1a080f2..4d3d57db4a 100644 --- a/testsuite/reftests/gtk-reftest.c +++ b/testsuite/reftests/gtk-reftest.c @@ -551,8 +551,15 @@ main (int argc, char **argv) /* We need to ensure the process' current working directory * is the same as the reftest data, because we're using the * "file" property of GtkImage as a relative path in builder files. + * + * The g_assert() is needed to ensure GNU libc does not complain + * about the unused return value, and the G_GNUC_UNUSED is needed + * to avoid compiler warnings when g_assert() is compiled out + * during the release build. */ - g_assert (chdir (basedir) == 0); + int res G_GNUC_UNUSED; + res = chdir (basedir); + g_assert (res == 0); g_log_set_writer_func (log_writer, NULL, NULL);