diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-03 19:21:59 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-03 19:21:59 +0100 |
commit | af26560f258d93cc78782ddd0208128756874c11 (patch) | |
tree | 43c77d3b21b57cd7143a04ec73c30a8b60dc73df /test/toy-font-face.c | |
parent | c549203c8d69474be4362037f702e4fb59c9929e (diff) | |
download | cairo-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/toy-font-face.c')
-rw-r--r-- | test/toy-font-face.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/toy-font-face.c b/test/toy-font-face.c index 147c43b73..cbebf840a 100644 --- a/test/toy-font-face.c +++ b/test/toy-font-face.c @@ -51,6 +51,7 @@ preamble (cairo_test_context_t *ctx) cairo_t *cr; cairo_surface_t *surface; cairo_font_face_t *font_face; + cairo_status_t status; surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, 0, 0); cr = cairo_create (surface); @@ -61,9 +62,12 @@ preamble (cairo_test_context_t *ctx) assert (cairo_toy_font_face_get_family (font_face) != NULL); assert (cairo_toy_font_face_get_slant (font_face) == CAIRO_FONT_SLANT_NORMAL); assert (cairo_toy_font_face_get_weight (font_face) == CAIRO_FONT_WEIGHT_NORMAL); - assert (cairo_font_face_status(font_face) == CAIRO_STATUS_SUCCESS); + status = cairo_font_face_status(font_face); cairo_font_face_destroy (font_face); + if (status) + return cairo_test_status_from_status (ctx, status); + cairo_select_font_face (cr, "bizarre", CAIRO_FONT_SLANT_OBLIQUE, @@ -73,9 +77,12 @@ preamble (cairo_test_context_t *ctx) assert (0 == (strcmp) (cairo_toy_font_face_get_family (font_face), "bizarre")); assert (cairo_toy_font_face_get_slant (font_face) == CAIRO_FONT_SLANT_OBLIQUE); assert (cairo_toy_font_face_get_weight (font_face) == CAIRO_FONT_WEIGHT_BOLD); - assert (cairo_font_face_status(font_face) == CAIRO_STATUS_SUCCESS); + status = cairo_font_face_status(font_face); cairo_font_face_destroy (font_face); + if (status) + return cairo_test_status_from_status (ctx, status); + font_face = cairo_toy_font_face_create ("bozarre", CAIRO_FONT_SLANT_OBLIQUE, CAIRO_FONT_WEIGHT_BOLD); @@ -83,9 +90,12 @@ preamble (cairo_test_context_t *ctx) assert (0 == (strcmp) (cairo_toy_font_face_get_family (font_face), "bozarre")); assert (cairo_toy_font_face_get_slant (font_face) == CAIRO_FONT_SLANT_OBLIQUE); assert (cairo_toy_font_face_get_weight (font_face) == CAIRO_FONT_WEIGHT_BOLD); - assert (cairo_font_face_status(font_face) == CAIRO_STATUS_SUCCESS); + status = cairo_font_face_status(font_face); cairo_font_face_destroy (font_face); + if (status) + return cairo_test_status_from_status (ctx, status); + font_face = cairo_toy_font_face_create (NULL, CAIRO_FONT_SLANT_OBLIQUE, CAIRO_FONT_WEIGHT_BOLD); |