summaryrefslogtreecommitdiff
path: root/test/bitmap-font.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-04 17:01:17 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-04 18:26:00 +0100
commitb0052c52153376400a30dca1d67f4aca9735cc09 (patch)
treec26c368245e7544f599885adce6baf7bd70640ea /test/bitmap-font.c
parent9187c7532755dda8d2677ec792162c71029fb37d (diff)
test/bitmap-font: Propagate memfault
Diffstat (limited to 'test/bitmap-font.c')
-rw-r--r--test/bitmap-font.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/bitmap-font.c b/test/bitmap-font.c
index 26a76db7..1c137794 100644
--- a/test/bitmap-font.c
+++ b/test/bitmap-font.c
@@ -121,7 +121,16 @@ draw (cairo_t *cr, int width, int height)
cairo_set_font_face (cr, font_face);
-#define CHECK_FONT_EXTENTS(comment) if (check_font_extents (ctx, cr, (comment)) != CAIRO_TEST_SUCCESS) return CAIRO_TEST_FAILURE
+ font_options = cairo_font_options_create ();
+
+#define CHECK_FONT_EXTENTS(comment) do {\
+ cairo_test_status_t test_status; \
+ test_status = check_font_extents (ctx, cr, (comment)); \
+ if (test_status != CAIRO_TEST_SUCCESS) { \
+ cairo_font_options_destroy (font_options); \
+ return test_status; \
+ } \
+} while (0)
cairo_font_extents (cr, &font_extents);
CHECK_FONT_EXTENTS ("default");
@@ -129,8 +138,6 @@ draw (cairo_t *cr, int width, int height)
FcPatternDestroy (pattern);
cairo_font_face_destroy (font_face);
- font_options = cairo_font_options_create ();
-
cairo_font_options_set_hint_metrics (font_options, CAIRO_HINT_METRICS_ON);
cairo_set_font_options (cr, font_options);