summaryrefslogtreecommitdiff
path: root/test/cairo-test.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-03 19:21:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-03 19:21:59 +0100
commitaf26560f258d93cc78782ddd0208128756874c11 (patch)
tree43c77d3b21b57cd7143a04ec73c30a8b60dc73df /test/cairo-test.c
parentc549203c8d69474be4362037f702e4fb59c9929e (diff)
downloadcairo-af26560f258d93cc78782ddd0208128756874c11.tar.gz
test: Improve memfault behaviour.
Various minor tweaks to convert asserts into error returns and to improve error checking on intermediate surfaces.
Diffstat (limited to 'test/cairo-test.c')
-rw-r--r--test/cairo-test.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/test/cairo-test.c b/test/cairo-test.c
index f78519f1e..aa8dd3a60 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -917,10 +917,23 @@ REPEAT:
goto UNWIND_SURFACE;
}
- cairo_surface_set_user_data (surface,
- &cairo_boilerplate_output_basename_key,
- base_path,
- NULL);
+ if (cairo_surface_set_user_data (surface,
+ &cairo_boilerplate_output_basename_key,
+ base_path,
+ NULL))
+ {
+#if HAVE_MEMFAULT
+ cairo_surface_destroy (surface);
+
+ if (target->cleanup)
+ target->cleanup (closure);
+
+ goto REPEAT;
+#else
+ ret = CAIRO_TEST_FAILURE;
+ goto UNWIND_SURFACE;
+#endif
+ }
cairo_surface_set_device_offset (surface, dev_offset, dev_offset);