conform: Use g_assert_cmpint() in cogl-readpixels test
The g_assert_cmpint() macro prints out not just the assertion condition but also the assertion contents; this is useful to catch wrong values without incrementing the verbosity of the test itself.
This commit is contained in:
parent
56f164f8a1
commit
e65bb38720
@ -73,11 +73,10 @@ on_paint (ClutterActor *actor, void *state)
|
|||||||
COGL_PIXEL_FORMAT_RGBA_8888,
|
COGL_PIXEL_FORMAT_RGBA_8888,
|
||||||
(guchar *)pixels);
|
(guchar *)pixels);
|
||||||
|
|
||||||
g_assert (pixels[0] == 0xff0000ff);
|
g_assert_cmpint (pixels[0], ==, 0xff0000ff);
|
||||||
g_assert (pixels[FRAMEBUFFER_WIDTH - 1] == 0xff00ff00);
|
g_assert_cmpint (pixels[FRAMEBUFFER_WIDTH - 1], ==, 0xff00ff00);
|
||||||
g_assert (pixels[(FRAMEBUFFER_HEIGHT - 1) * FRAMEBUFFER_WIDTH] == 0xffff0000);
|
g_assert_cmpint (pixels[(FRAMEBUFFER_HEIGHT - 1) * FRAMEBUFFER_WIDTH], ==, 0xffff0000);
|
||||||
g_assert (pixels[(FRAMEBUFFER_HEIGHT - 1) * FRAMEBUFFER_WIDTH +
|
g_assert_cmpint (pixels[(FRAMEBUFFER_HEIGHT - 1) * FRAMEBUFFER_WIDTH + FRAMEBUFFER_WIDTH - 1], ==, 0xffffffff);
|
||||||
FRAMEBUFFER_WIDTH - 1] == 0xffffffff);
|
|
||||||
g_free (pixels);
|
g_free (pixels);
|
||||||
|
|
||||||
cogl_pop_framebuffer ();
|
cogl_pop_framebuffer ();
|
||||||
@ -95,11 +94,10 @@ on_paint (ClutterActor *actor, void *state)
|
|||||||
COGL_PIXEL_FORMAT_RGBA_8888,
|
COGL_PIXEL_FORMAT_RGBA_8888,
|
||||||
(guchar *)pixels);
|
(guchar *)pixels);
|
||||||
|
|
||||||
g_assert (pixels[0] == 0xff0000ff);
|
g_assert_cmpint (pixels[0], ==, 0xff0000ff);
|
||||||
g_assert (pixels[FRAMEBUFFER_WIDTH - 1] == 0xff00ff00);
|
g_assert_cmpint (pixels[FRAMEBUFFER_WIDTH - 1], ==, 0xff00ff00);
|
||||||
g_assert (pixels[(FRAMEBUFFER_HEIGHT - 1) * FRAMEBUFFER_WIDTH] == 0xffff0000);
|
g_assert_cmpint (pixels[(FRAMEBUFFER_HEIGHT - 1) * FRAMEBUFFER_WIDTH], ==, 0xffff0000);
|
||||||
g_assert (pixels[(FRAMEBUFFER_HEIGHT - 1) * FRAMEBUFFER_WIDTH +
|
g_assert_cmpint (pixels[(FRAMEBUFFER_HEIGHT - 1) * FRAMEBUFFER_WIDTH + FRAMEBUFFER_WIDTH - 1], ==, 0xffffffff);
|
||||||
FRAMEBUFFER_WIDTH - 1] == 0xffffffff);
|
|
||||||
g_free (pixels);
|
g_free (pixels);
|
||||||
|
|
||||||
cogl_handle_unref (tex);
|
cogl_handle_unref (tex);
|
||||||
|
Loading…
Reference in New Issue
Block a user