summaryrefslogtreecommitdiff
path: root/test/get-path-extents.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-03-20 11:06:29 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2009-03-24 07:50:58 +0000
commit1a7b94f934f8c9a25e60d9466651b0b7fb919656 (patch)
tree6ebc71e073625dd6dae42095029d2f4f0cb0dee4 /test/get-path-extents.c
parent3b545330887209c68128fca0d1bb40bf4927c2a6 (diff)
downloadcairo-1a7b94f934f8c9a25e60d9466651b0b7fb919656.tar.gz
[test] Check for errors during get-path-extents.
Need to check that an error was not raised on the context before checking whether the extents match expectations.
Diffstat (limited to 'test/get-path-extents.c')
-rw-r--r--test/get-path-extents.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/get-path-extents.c b/test/get-path-extents.c
index ce1bc7c6b..96fdfccdb 100644
--- a/test/get-path-extents.c
+++ b/test/get-path-extents.c
@@ -57,6 +57,10 @@ check_extents (const cairo_test_context_t *ctx,
break;
}
+ /* ignore results after an error occurs */
+ if (cairo_status (cr))
+ return 1;
+
/* let empty rects match */
if ((ext_x1 == ext_x2 || ext_y1 == ext_y2) && (width == 0 || height == 0))
return 1;
@@ -106,6 +110,7 @@ draw (cairo_t *cr, int width, int height)
const char *phase;
const char string[] = "The quick brown fox jumps over the lazy dog.";
cairo_text_extents_t extents, scaled_font_extents;
+ cairo_status_t status;
int errors = 0;
surface = cairo_surface_create_similar (cairo_get_group_target (cr),
@@ -365,8 +370,12 @@ draw (cairo_t *cr, int width, int height)
cairo_new_path (cr2);
cairo_restore (cr2);
+ status = cairo_status (cr2);
cairo_destroy (cr2);
+ if (status)
+ return cairo_test_status_from_status (ctx, status);
+
return errors == 0 ? CAIRO_TEST_SUCCESS : CAIRO_TEST_FAILURE;
}