summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2016-12-29 14:00:42 +0100
committerBastien Nocera <hadess@hadess.net>2016-12-29 14:00:42 +0100
commitd8ea84789810477aa130b2e5f7c8e27a5e3587ab (patch)
tree4afd199702324d9868de4397c3de1c881d43cc1f /tests
parent8c604de710de281c5a08f54f32a0670cbb607125 (diff)
downloadgdk-pixbuf-d8ea84789810477aa130b2e5f7c8e27a5e3587ab.tar.gz
tests: Fix non-sensical error in reftest
The debug output was always printing the very first pixel of the line as both the reference and test data, leading to "useful" output like: Image data at 1x1 is #B16C42FF, but should be #B16C42FF Read the reference and test pixel values from the correct offset in the line to fix this.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-common.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test-common.c b/tests/test-common.c
index a4ea4fa3b..cda99883a 100644
--- a/tests/test-common.c
+++ b/tests/test-common.c
@@ -156,15 +156,15 @@ pixdata_equal (GdkPixbuf *test,
{
g_set_error (error, GDK_PIXBUF_ERROR, 0, "Image data at %ux%u is #%02X%02X%02X%02X, but should be #%02X%02X%02X%02X",
x, y,
- test_pixels[0], test_pixels[1], test_pixels[2], test_pixels[3],
- ref_pixels[0], ref_pixels[1], ref_pixels[2], ref_pixels[3]);
+ test_pixels[x * n_channels + 0], test_pixels[x * n_channels + 1], test_pixels[x * n_channels + 2], test_pixels[x * n_channels + 3],
+ ref_pixels[x * n_channels + 0], ref_pixels[x * n_channels + 1], ref_pixels[x * n_channels + 2], ref_pixels[x * n_channels + 3]);
}
else if (n_channels == 3)
{
g_set_error (error, GDK_PIXBUF_ERROR, 0, "Image data at %ux%u is #%02X%02X%02X, but should be #%02X%02X%02X",
x, y,
- test_pixels[0], test_pixels[1], test_pixels[2],
- ref_pixels[0], ref_pixels[1], ref_pixels[2]);
+ test_pixels[x * n_channels + 0], test_pixels[x * n_channels + 1], test_pixels[x * n_channels + 2],
+ ref_pixels[x * n_channels + 0], ref_pixels[x * n_channels + 1], ref_pixels[x * n_channels + 2]);
}
else
{