[cairo-commit] cairo/test a8-mask.c,1.1,1.2

Carl Worth commit at pdx.freedesktop.org
Fri Aug 5 15:48:44 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv5723/test

Modified Files:
	a8-mask.c 
Log Message:

2005-08-05  Carl Worth  <cworth at cworth.org>

        * test/a8-mask.c (draw): Patch memory leaks.


Index: a8-mask.c
===================================================================
RCS file: /cvs/cairo/cairo/test/a8-mask.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- a8-mask.c	5 Aug 2005 22:07:46 -0000	1.1
+++ a8-mask.c	5 Aug 2005 22:48:42 -0000	1.2
@@ -42,24 +42,25 @@
     0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0x0
 };
 
-
-
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
-    cairo_surface_t *image;
+    cairo_surface_t *surface;
     cairo_pattern_t *pattern;
 
     cairo_set_source_rgb (cr, 0, 0, 1);
     cairo_paint (cr);
 
-    image = cairo_image_surface_create_for_data (mask, CAIRO_FORMAT_A8,
-						 7, 8, 7);
-    pattern = cairo_pattern_create_for_surface (image);
+    surface = cairo_image_surface_create_for_data (mask, CAIRO_FORMAT_A8,
+						   7, 8, 7);
+    pattern = cairo_pattern_create_for_surface (surface);
 
     cairo_set_source_rgb (cr, 1, 0, 0);
     cairo_mask (cr, pattern);
 
+    cairo_pattern_destroy (pattern);
+    cairo_surface_destroy (surface);
+
     return CAIRO_TEST_SUCCESS;
 }
 
@@ -67,5 +68,5 @@
 main (void)
 {
     return cairo_test_expect_failure (&test, draw,
-	    "only image fails");
+	    "image backend fails (unknown cause)");
 }




More information about the cairo-commit mailing list