summaryrefslogtreecommitdiff
path: root/test/xlib-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-08-12 13:33:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-08-13 21:55:19 +0100
commitd56ea9cc879650db0ad2e6b05e483f30f9f21566 (patch)
treef58334bf9ca6d3eef3ef0e7f5813c8b211f3ddac /test/xlib-surface.c
parentf85a4aec1f94f8fbd8e4db770ff1f70c3286fc90 (diff)
downloadcairo-d56ea9cc879650db0ad2e6b05e483f30f9f21566.tar.gz
[test] Set CAIRO_TEST_UNTESTED to 77
77 is the magic exit code used by automake to indicate a skipped test, so by using it we can get a slightly more informative test log.
Diffstat (limited to 'test/xlib-surface.c')
-rw-r--r--test/xlib-surface.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/xlib-surface.c b/test/xlib-surface.c
index 71bbeab1d..20c715eb2 100644
--- a/test/xlib-surface.c
+++ b/test/xlib-surface.c
@@ -299,26 +299,22 @@ main (void)
cairo_bool_t use_pixmap;
cairo_bool_t set_size;
cairo_bool_t offscreen;
- cairo_test_status_t status, result = CAIRO_TEST_SUCCESS;
+ cairo_test_status_t status, result = CAIRO_TEST_UNTESTED;
int stride;
cairo_test_init (&ctx, "xlib-surface");
- if (! cairo_test_is_target_enabled (&ctx, "xlib")) {
- cairo_test_fini (&ctx);
- return CAIRO_TEST_UNTESTED;
- }
+ if (! cairo_test_is_target_enabled (&ctx, "xlib"))
+ goto CLEANUP_TEST;
dpy = XOpenDisplay (NULL);
if (!dpy) {
cairo_test_log (&ctx, "xlib-surface: Cannot open display, skipping\n");
- cairo_test_fini (&ctx);
- return CAIRO_TEST_SUCCESS;
+ goto CLEANUP_TEST;
}
if (!check_visual (dpy)) {
cairo_test_log (&ctx, "xlib-surface: default visual is not RGB24 or BGR24, skipping\n");
- cairo_test_fini (&ctx);
- return CAIRO_TEST_SUCCESS;
+ goto CLEANUP_DISPLAY;
}
stride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, SIZE);
@@ -335,6 +331,8 @@ main (void)
draw_pattern (reference_surface);
cairo_surface_destroy (reference_surface);
+ result = CAIRO_TEST_SUCCESS;
+
for (set_size = 0; set_size <= 1; set_size++)
for (use_pixmap = 0; use_pixmap <= 1; use_pixmap++)
for (offscreen = 0; offscreen <= 1; offscreen++) {
@@ -359,8 +357,10 @@ main (void)
free (test_data);
free (diff_data);
+ CLEANUP_DISPLAY:
XCloseDisplay (dpy);
+ CLEANUP_TEST:
cairo_test_fini (&ctx);
return result;