diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-01 17:59:57 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-01 17:59:57 +0100 |
commit | b4f86638cc4b87bfaf10568ae9beb89626e26613 (patch) | |
tree | 504f774d84f53f7e37dfcac70e690c5d08948e91 /test/copy-path.c | |
parent | 042c382c094d1ea6f9a5a162d4d1d9ac83413233 (diff) |
[cairo-path] Don't raise an error when attempting to create an empty path.
Generate a real empty path structure instead of returning
_cairo_path_nil, if we have been asked to create an empty path.
(Also add a couple of missing _cairo_error()s and an appropriate test
case.)
Spotted by Fred Kiefer.
Diffstat (limited to 'test/copy-path.c')
-rw-r--r-- | test/copy-path.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/copy-path.c b/test/copy-path.c index 142bfa57..256f4612 100644 --- a/test/copy-path.c +++ b/test/copy-path.c @@ -125,6 +125,23 @@ draw (cairo_t *cr, int width, int height) cairo_path_destroy (path); cairo_destroy (cr_error); + + /* first check that we can copy an empty path */ + cairo_new_path (cr); + path = cairo_copy_path (cr); + if (path->status != CAIRO_STATUS_SUCCESS) { + cairo_test_log ("Error: cairo_copy_path returned status of %s\n", + cairo_status_to_string (path->status)); + cairo_path_destroy (path); + return CAIRO_TEST_FAILURE; + } + if (path->num_data != 0) { + cairo_test_log ("Error: cairo_copy_path did not copy an empty path, returned path contains %d elements\n", + path->num_data); + cairo_path_destroy (path); + return CAIRO_TEST_FAILURE; + } + cairo_path_destroy (path); /* We draw in the default black, so paint white first. */ cairo_save (cr); |