summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2013-02-06 12:13:33 +0000
committerNeil Roberts <neil@linux.intel.com>2013-02-08 12:20:33 +0000
commitd6dacf2f656a0e66f3d9b4a4dea64c9d5b54fd7d (patch)
tree337988d681165d44936e810c1ace1f35b5eadac0 /tests
parent1e39819c4939f47c9b7a6c80b174de4941b11187 (diff)
downloadmutter-d6dacf2f656a0e66f3d9b4a4dea64c9d5b54fd7d.tar.gz
test-gles2-context: Use test_utils_compare_pixel instead of g_asserts
test_utils_compare_pixel makes the error report slightly easier to read because it displays the values for the whole pixel instead of reporting that there was a difference somewhere. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit a094ac9688a5e6b53be1cd379dc045973aab2fae)
Diffstat (limited to 'tests')
-rw-r--r--tests/conform/test-gles2-context.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/tests/conform/test-gles2-context.c b/tests/conform/test-gles2-context.c
index 9e66ab03f..814a96ba5 100644
--- a/tests/conform/test-gles2-context.c
+++ b/tests/conform/test-gles2-context.c
@@ -301,9 +301,7 @@ test_gles2_read_pixels (void)
gles2->glClear (GL_COLOR_BUFFER_BIT);
gles2->glReadPixels (0, 0, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &pixel);
- g_assert (pixel[0] == 0xff);
- g_assert (pixel[1] == 0);
- g_assert (pixel[2] == 0);
+ test_utils_compare_pixel (pixel, 0xff0000ff);
fbo_handle = create_gles2_framebuffer (gles2, 256, 256);
@@ -313,9 +311,7 @@ test_gles2_read_pixels (void)
gles2->glClear (GL_COLOR_BUFFER_BIT);
gles2->glReadPixels (0, 0, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &pixel);
- g_assert (pixel[0] == 0);
- g_assert (pixel[1] == 0xff);
- g_assert (pixel[2] == 0);
+ test_utils_compare_pixel (pixel, 0x00ff00ff);
gles2->glBindFramebuffer (GL_FRAMEBUFFER, 0);
@@ -323,9 +319,7 @@ test_gles2_read_pixels (void)
gles2->glClear (GL_COLOR_BUFFER_BIT);
gles2->glReadPixels (0, 0, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &pixel);
- g_assert (pixel[0] == 0);
- g_assert (pixel[1] == 0xff);
- g_assert (pixel[2] == 0xff);
+ test_utils_compare_pixel (pixel, 0x00ffffff);
cogl_pop_gles2_context (test_ctx);
@@ -343,9 +337,7 @@ test_gles2_read_pixels (void)
gles2->glReadPixels (0, 0, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &pixel);
- g_assert (pixel[0] == 0);
- g_assert (pixel[1] == 0xff);
- g_assert (pixel[2] == 0xff);
+ test_utils_compare_pixel (pixel, 0x00ffffff);
cogl_pop_gles2_context (test_ctx);
@@ -365,9 +357,7 @@ test_gles2_read_pixels (void)
gles2->glReadPixels (0, 0, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &pixel);
- g_assert (pixel[0] == 0xff);
- g_assert (pixel[1] == 0xff);
- g_assert (pixel[2] == 0xff);
+ test_utils_compare_pixel (pixel, 0xffffffff);
cogl_pop_gles2_context (test_ctx);
}