diff options
author | Matthew Waters <matthew@centricular.com> | 2015-12-30 12:06:17 +1100 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2015-12-30 12:16:29 +1100 |
commit | 05c5c27f1cf6c1021577ffa52eff91b89a2b1c1e (patch) | |
tree | db149be3528c71cc06f926897232c6ab2416ad9e /tests | |
parent | 8c02a4774182a7d7851d1b26aea3e31896e98234 (diff) | |
download | gstreamer-plugins-bad-05c5c27f1cf6c1021577ffa52eff91b89a2b1c1e.tar.gz |
tests/glmemory: output data pointer values on failure
Allows quicker inspection of what failed.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/libs/gstglmemory.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/tests/check/libs/gstglmemory.c b/tests/check/libs/gstglmemory.c index 7387e25dd..4130e3ba2 100644 --- a/tests/check/libs/gstglmemory.c +++ b/tests/check/libs/gstglmemory.c @@ -183,10 +183,12 @@ test_transfer_allocator (const gchar * allocator_name) fail_unless (!GST_MEMORY_FLAG_IS_SET (mem2, GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD)); - fail_unless (((gchar *) map_info.data)[0] == rgba_pixel[0]); - fail_unless (((gchar *) map_info.data)[1] == rgba_pixel[1]); - fail_unless (((gchar *) map_info.data)[2] == rgba_pixel[2]); - fail_unless (((gchar *) map_info.data)[3] == rgba_pixel[3]); + fail_unless (memcmp (map_info.data, rgba_pixel, + G_N_ELEMENTS (rgba_pixel)) == 0, + "0x%02x%02x%02x%02x != 0x%02x%02x%02x%02x", map_info.data[0], + map_info.data[1], map_info.data[2], map_info.data[3], + (guint8) rgba_pixel[0], (guint8) rgba_pixel[1], (guint8) rgba_pixel[2], + (guint8) rgba_pixel[3]); gst_memory_unmap (mem2, &map_info); @@ -222,10 +224,12 @@ test_transfer_allocator (const gchar * allocator_name) /* test download of copied texture */ fail_unless (gst_memory_map (mem, &map_info, GST_MAP_READ)); - fail_unless (((gchar *) map_info.data)[0] == rgba_pixel[0]); - fail_unless (((gchar *) map_info.data)[1] == rgba_pixel[1]); - fail_unless (((gchar *) map_info.data)[2] == rgba_pixel[2]); - fail_unless (((gchar *) map_info.data)[3] == rgba_pixel[3]); + fail_unless (memcmp (map_info.data, rgba_pixel, + G_N_ELEMENTS (rgba_pixel)) == 0, + "0x%02x%02x%02x%02x != 0x%02x%02x%02x%02x", (guint8) map_info.data[0], + (guint8) map_info.data[1], (guint8) map_info.data[2], + (guint8) map_info.data[3], (guint8) rgba_pixel[0], (guint8) rgba_pixel[1], + (guint8) rgba_pixel[2], (guint8) rgba_pixel[3]); gst_memory_unmap (mem, &map_info); @@ -237,10 +241,12 @@ test_transfer_allocator (const gchar * allocator_name) fail_unless (!GST_MEMORY_FLAG_IS_SET (mem, GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD)); - fail_unless (((gchar *) map_info.data)[0] == rgba_pixel[0]); - fail_unless (((gchar *) map_info.data)[1] == rgba_pixel[1]); - fail_unless (((gchar *) map_info.data)[2] == rgba_pixel[2]); - fail_unless (((gchar *) map_info.data)[3] == rgba_pixel[3]); + fail_unless (memcmp (map_info.data, rgba_pixel, + G_N_ELEMENTS (rgba_pixel)) == 0, + "0x%02x%02x%02x%02x != 0x%02x%02x%02x%02x", (guint8) map_info.data[0], + (guint8) map_info.data[1], (guint8) map_info.data[2], + (guint8) map_info.data[3], (guint8) rgba_pixel[0], (guint8) rgba_pixel[1], + (guint8) rgba_pixel[2], (guint8) rgba_pixel[3]); gst_memory_unmap (mem3, &map_info); @@ -313,10 +319,11 @@ GST_START_TEST (test_separate_transfer) fail_unless (gst_memory_map (mem, &info, GST_MAP_READ)); - fail_unless (((gchar *) info.data)[0] == rgba_pixel[0]); - fail_unless (((gchar *) info.data)[1] == rgba_pixel[1]); - fail_unless (((gchar *) info.data)[2] == rgba_pixel[2]); - fail_unless (((gchar *) info.data)[3] == rgba_pixel[3]); + fail_unless (memcmp (info.data, rgba_pixel, G_N_ELEMENTS (rgba_pixel)) == 0, + "0x%02x%02x%02x%02x != 0x%02x%02x%02x%02x", (guint8) info.data[0], + (guint8) info.data[1], (guint8) info.data[2], + (guint8) info.data[3], (guint8) rgba_pixel[0], (guint8) rgba_pixel[1], + (guint8) rgba_pixel[2], (guint8) rgba_pixel[3]); gst_memory_unmap (mem, &info); |