summaryrefslogtreecommitdiff
path: root/test/cairo-test.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-09-30 17:50:09 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-09-30 17:50:35 +0100
commit8e4e0aa7ee5b4e0963409cda825705a09aae61e1 (patch)
tree345272105cf8b5827026238c39ec552d7d10f1bb /test/cairo-test.c
parent395555b116a497c99b9e8365a202377c344c0c45 (diff)
downloadcairo-8e4e0aa7ee5b4e0963409cda825705a09aae61e1.tar.gz
[boilerplate/xcb] Check for connection errors during test
Diffstat (limited to 'test/cairo-test.c')
-rw-r--r--test/cairo-test.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 1f495af60..722886564 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1014,61 +1014,61 @@ REPEAT:
}
#endif
- /* Skip image check for tests with no image (width,height == 0,0) */
- if (ctx->test->width != 0 && ctx->test->height != 0) {
- cairo_surface_t *ref_image;
- cairo_surface_t *test_image;
- cairo_surface_t *diff_image;
- buffer_diff_result_t result;
- cairo_status_t diff_status;
-
- if (target->finish_surface != NULL) {
+ if (target->finish_surface != NULL) {
#if HAVE_MEMFAULT
- /* We need to re-enable faults as most meta-surface processing
- * is done during cairo_surface_finish().
- */
- MEMFAULT_CLEAR_FAULTS ();
- last_fault_count = MEMFAULT_COUNT_FAULTS ();
- MEMFAULT_ENABLE_FAULTS ();
+ /* We need to re-enable faults as most meta-surface processing
+ * is done during cairo_surface_finish().
+ */
+ MEMFAULT_CLEAR_FAULTS ();
+ last_fault_count = MEMFAULT_COUNT_FAULTS ();
+ MEMFAULT_ENABLE_FAULTS ();
#endif
- /* also check for infinite loops whilst replaying */
- alarm (ctx->timeout);
- diff_status = target->finish_surface (surface);
- alarm (0);
+ /* also check for infinite loops whilst replaying */
+ alarm (ctx->timeout);
+ status = target->finish_surface (surface);
+ alarm (0);
#if HAVE_MEMFAULT
- MEMFAULT_DISABLE_FAULTS ();
+ MEMFAULT_DISABLE_FAULTS ();
- if (ctx->malloc_failure &&
- MEMFAULT_COUNT_FAULTS () - last_fault_count > 0 &&
- diff_status == CAIRO_STATUS_NO_MEMORY)
- {
- cairo_destroy (cr);
- cairo_surface_destroy (surface);
- if (target->cleanup)
- target->cleanup (closure);
- if (ctx->thread == 0) {
- cairo_debug_reset_static_data ();
+ if (ctx->malloc_failure &&
+ MEMFAULT_COUNT_FAULTS () - last_fault_count > 0 &&
+ status == CAIRO_STATUS_NO_MEMORY)
+ {
+ cairo_destroy (cr);
+ cairo_surface_destroy (surface);
+ if (target->cleanup)
+ target->cleanup (closure);
+ if (ctx->thread == 0) {
+ cairo_debug_reset_static_data ();
#if HAVE_FCFINI
- FcFini ();
+ FcFini ();
#endif
- if (MEMFAULT_COUNT_LEAKS () > 0) {
- MEMFAULT_PRINT_FAULTS ();
- MEMFAULT_PRINT_LEAKS ();
- }
+ if (MEMFAULT_COUNT_LEAKS () > 0) {
+ MEMFAULT_PRINT_FAULTS ();
+ MEMFAULT_PRINT_LEAKS ();
}
-
- goto REPEAT;
}
+
+ goto REPEAT;
+ }
#endif
- if (diff_status) {
- cairo_test_log (ctx, "Error: Failed to finish surface: %s\n",
- cairo_status_to_string (diff_status));
- ret = CAIRO_TEST_FAILURE;
- goto UNWIND_CAIRO;
- }
+ if (status) {
+ cairo_test_log (ctx, "Error: Failed to finish surface: %s\n",
+ cairo_status_to_string (status));
+ ret = CAIRO_TEST_FAILURE;
+ goto UNWIND_CAIRO;
}
+ }
+
+ /* Skip image check for tests with no image (width,height == 0,0) */
+ if (ctx->test->width != 0 && ctx->test->height != 0) {
+ cairo_surface_t *ref_image;
+ cairo_surface_t *test_image;
+ cairo_surface_t *diff_image;
+ buffer_diff_result_t result;
+ cairo_status_t diff_status;
if (ref_png_path == NULL) {
cairo_test_log (ctx, "Error: Cannot find reference image for %s\n",