summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2007-03-21 15:21:05 -0400
committerBehdad Esfahbod <behdad@behdad.org>2007-03-21 15:21:05 -0400
commit52341f7e855c93fc8e58895c3a318c43c3d58474 (patch)
tree89b8e3fdcc5e22a28728d03454d8fe9c1f424373 /test
parent9cea8a4bb26f7de2ac56e318c72e7d048b8b6c0f (diff)
[test/nil-surface] Test cairo_create(NULL). Crashing in cairo_push_group!
Diffstat (limited to 'test')
-rw-r--r--test/nil-surface.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/nil-surface.c b/test/nil-surface.c
index c672e6474..9f10d0ea4 100644
--- a/test/nil-surface.c
+++ b/test/nil-surface.c
@@ -136,6 +136,25 @@ draw (cairo_t *cr, int width, int height)
cairo_destroy (cr2);
+ /*
+ * 5. Create a cairo_t for the NULL surface.
+ */
+ cr2 = cairo_create (NULL);
+
+ if (cairo_status (cr2) != CAIRO_STATUS_NULL_POINTER) {
+ cairo_test_log ("Error: Received status of \"%s\" rather than expected \"%s\"\n",
+ cairo_status_to_string (cairo_status (cr2)),
+ cairo_status_to_string (CAIRO_STATUS_NULL_POINTER));
+ return CAIRO_TEST_FAILURE;
+ }
+
+ /* Test that push_group doesn't crash */
+ cairo_push_group (cr2);
+ cairo_stroke (cr2);
+ cairo_pop_group (cr2);
+
+ cairo_destroy (cr2);
+
return CAIRO_TEST_SUCCESS;
}