diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-08-12 13:33:04 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-08-13 21:55:19 +0100 |
commit | d56ea9cc879650db0ad2e6b05e483f30f9f21566 (patch) | |
tree | f58334bf9ca6d3eef3ef0e7f5813c8b211f3ddac /test/xlib-surface.c | |
parent | f85a4aec1f94f8fbd8e4db770ff1f70c3286fc90 (diff) |
[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.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/xlib-surface.c b/test/xlib-surface.c index 71bbeab1..20c715eb 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; |