? test/surface-finish-with-context.c Index: test/.cvsignore =================================================================== RCS file: /cvs/cairo/cairo/test/.cvsignore,v retrieving revision 1.30 diff -u -r1.30 .cvsignore --- test/.cvsignore 17 May 2005 08:05:35 -0000 1.30 +++ test/.cvsignore 26 May 2005 11:33:17 -0000 @@ -33,6 +33,7 @@ source-clip source-surface-scale-paint surface-finish-twice +surface-finish-with-context surface-pattern text-cache-crash text-rotate Index: test/Makefile.am =================================================================== RCS file: /cvs/cairo/cairo/test/Makefile.am,v retrieving revision 1.52 diff -u -r1.52 Makefile.am --- test/Makefile.am 17 May 2005 16:08:23 -0000 1.52 +++ test/Makefile.am 26 May 2005 11:33:17 -0000 @@ -31,7 +31,8 @@ translate-show-surface \ trap-clip \ user-data \ -rel-path +rel-path \ +surface-finish-with-context if CAIRO_HAS_PDF_SURFACE TESTS += pdf-surface @@ -95,7 +96,8 @@ pixman-rotate \ self-copy \ source-surface-scale-paint \ -text-rotate +text-rotate \ +surface-finish-with-context check_PROGRAMS = $(TESTS) @@ -159,6 +161,7 @@ user_data_LDADD = $(LDADDS) rel_path_LDADD = $(LDADDS) xlib_surface_LDADD = $(LDADDS) +surface_finish_with_context_LDADD = $(LDADDS) noinst_PROGRAMS = imagediff imagediff_LDADD = $(LDADDS) --- /dev/null 2005-05-25 20:46:45.982831424 +0200 +++ test/surface-finish-with-context.c 2005-05-26 13:23:59.000000000 +0200 @@ -0,0 +1,34 @@ +#include "cairo-test.h" + +cairo_test_t test = { + "surface-finish-with-context", + "Test to exercise cairo_surface_finish when a cairo context holds a reference on the surface.", + 0, 0 +}; + +static cairo_test_status_t +draw (cairo_t *cr, int width, int height) +{ + cairo_status_t status; + cairo_test_status_t r; + + r = CAIRO_TEST_FAILURE; + + status = cairo_surface_finish (cairo_get_target (cr)); + if (status != CAIRO_STATUS_SUCCESS) + { + cairo_test_log ("cairo_surface_finish returned status %d (%s)\n", + status); + goto out; + } + r = CAIRO_TEST_SUCCESS; + + out: + return r; +} + +int +main (void) +{ + return cairo_test (&test, draw); +}