summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2020-05-18 12:09:38 +0200
committerTimm Bäder <mail@baedert.org>2020-05-19 08:32:33 +0200
commitdd370db62a3ca9aea07f1994e4635b18b8b89d82 (patch)
treef70cd57db1c8eaa7ff08386233aa84e3df88e2be
parent43ba86b7afcaeee2298c03036e2a6b49f66b5265 (diff)
downloadgtk+-dd370db62a3ca9aea07f1994e4635b18b8b89d82.tar.gz
reftests: Pass common_cflags
-rw-r--r--testsuite/gsk/reftest-compare.c18
-rw-r--r--testsuite/reftests/meson.build13
-rw-r--r--testsuite/reftests/reftest-compare.c18
-rw-r--r--testsuite/reftests/reftest-module.c2
4 files changed, 31 insertions, 20 deletions
diff --git a/testsuite/gsk/reftest-compare.c b/testsuite/gsk/reftest-compare.c
index 21f5962d9c..6cb8af7fef 100644
--- a/testsuite/gsk/reftest-compare.c
+++ b/testsuite/gsk/reftest-compare.c
@@ -120,15 +120,15 @@ buffer_diff_core (const guchar *buf_a,
{
int value_a = (row_a[x] >> (channel*8)) & 0xff;
int value_b = (row_b[x] >> (channel*8)) & 0xff;
- guint diff;
-
- diff = ABS (value_a - value_b);
- diff *= 4; /* emphasize */
- if (diff)
- diff += 128; /* make sure it's visible */
- if (diff > 255)
- diff = 255;
- diff_pixel |= diff << (channel*8);
+ guint channel_diff;
+
+ channel_diff = ABS (value_a - value_b);
+ channel_diff *= 4; /* emphasize */
+ if (channel_diff)
+ channel_diff += 128; /* make sure it's visible */
+ if (channel_diff > 255)
+ channel_diff = 255;
+ diff_pixel |= channel_diff << (channel*8);
}
if ((diff_pixel & 0x00ffffff) == 0)
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index e85699f0f7..16bfa5231b 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -1,7 +1,17 @@
# FIXME: $(no_undefined) ?
+
+reftest_cflags = []
+foreach flag: common_cflags
+ if flag not in ['-Werror=missing-prototypes', '-Werror=missing-declarations', '-fvisibility=hidden']
+ reftest_cflags += flag
+ endif
+endforeach
+
+
libgtkreftestprivate = library('gtkreftestprivate',
'reftest-compare.c', 'reftest-module.c', 'reftest-snapshot.c',
- dependencies : libgtk_dep)
+ dependencies : libgtk_dep,
+ c_args: reftest_cflags)
libreftest = library('reftest',
[ 'expand-expander.c',
@@ -14,6 +24,7 @@ libreftest = library('reftest',
'animation-direction.c',
],
link_with: libgtkreftestprivate,
+ c_args: reftest_cflags,
dependencies : libgtk_dep)
tcdata = configuration_data()
diff --git a/testsuite/reftests/reftest-compare.c b/testsuite/reftests/reftest-compare.c
index dc422089cd..651eac9ca9 100644
--- a/testsuite/reftests/reftest-compare.c
+++ b/testsuite/reftests/reftest-compare.c
@@ -121,15 +121,15 @@ buffer_diff_core (const guchar *buf_a,
{
int value_a = (row_a[x] >> (channel*8)) & 0xff;
int value_b = (row_b[x] >> (channel*8)) & 0xff;
- guint diff;
-
- diff = ABS (value_a - value_b);
- diff *= 4; /* emphasize */
- if (diff)
- diff += 128; /* make sure it's visible */
- if (diff > 255)
- diff = 255;
- diff_pixel |= diff << (channel*8);
+ guint channel_difff;
+
+ channel_difff = ABS (value_a - value_b);
+ channel_difff *= 4; /* emphasize */
+ if (channel_difff)
+ channel_difff += 128; /* make sure it's visible */
+ if (channel_difff > 255)
+ channel_difff = 255;
+ diff_pixel |= channel_difff << (channel * 8);
}
if ((diff_pixel & 0x00ffffff) == 0)
diff --git a/testsuite/reftests/reftest-module.c b/testsuite/reftests/reftest-module.c
index acab359522..d47243edd2 100644
--- a/testsuite/reftests/reftest-module.c
+++ b/testsuite/reftests/reftest-module.c
@@ -54,7 +54,7 @@ reftest_module_new_take (GModule *module,
if (all_modules == NULL)
all_modules = g_hash_table_new (g_str_hash, g_str_equal);
- g_hash_table_insert (all_modules, filename ? filename : "", result);
+ g_hash_table_insert (all_modules, filename ? filename : g_strdup (""), result);
return result;
}