summaryrefslogtreecommitdiff
path: root/test/surface-finish-twice.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-04-14 11:01:39 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-04-16 09:34:02 +0100
commit82cccb26723697492504f395fed33afba28d84ba (patch)
tree5f3aababf173871638e0014f1928c8646794e874 /test/surface-finish-twice.c
parentf12d52bfcae0792729b33a1fd1b2d23bd3fc7cf3 (diff)
downloadcairo-82cccb26723697492504f395fed33afba28d84ba.tar.gz
[test] Handle memfaults during surface-finish-twice
Check and report memory allocation failures.
Diffstat (limited to 'test/surface-finish-twice.c')
-rw-r--r--test/surface-finish-twice.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/surface-finish-twice.c b/test/surface-finish-twice.c
index 5154e99e7..f63b50175 100644
--- a/test/surface-finish-twice.c
+++ b/test/surface-finish-twice.c
@@ -45,21 +45,26 @@
static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
+ const cairo_test_context_t *ctx = cairo_test_get_context (cr);
cairo_surface_t *surface;
+ cairo_status_t status;
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1);
cairo_surface_finish (surface);
- if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
- return CAIRO_TEST_FAILURE;
+ status = cairo_surface_status (surface);
+ if (status != CAIRO_STATUS_SUCCESS)
+ return cairo_test_status_from_status (ctx, status);
cairo_surface_finish (surface);
- if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
- return CAIRO_TEST_FAILURE;
+ status = cairo_surface_status (surface);
+ if (status != CAIRO_STATUS_SUCCESS)
+ return cairo_test_status_from_status (ctx, status);
cairo_surface_finish (surface);
- if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
- return CAIRO_TEST_FAILURE;
+ status = cairo_surface_status (surface);
+ if (status != CAIRO_STATUS_SUCCESS)
+ return cairo_test_status_from_status (ctx, status);
cairo_surface_destroy (surface);