[cairo-commit] test/cairo-test.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Aug 19 07:15:18 PDT 2008


 test/cairo-test.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 0354457bedf278c6504856148c51495754d94ebb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Aug 19 15:10:51 2008 +0100

    [test] Always write the test output to a png.
    
    Always write the test output to a png so that it can be copied and used as
    a reference image with CAIRO_REF_DIR.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 29ff63d..80e62ed 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -637,6 +637,15 @@ cairo_test_for_target (cairo_test_context_t		 *ctx,
 	    goto UNWIND_CAIRO;
 	}
 
+	diff_status = cairo_surface_write_to_png (test_image, png_name);
+	if (diff_status) {
+	    cairo_test_log (ctx, "Error: Failed to write output image: %s\n",
+			    cairo_status_to_string (diff_status));
+	    ret = CAIRO_TEST_FAILURE;
+	    goto UNWIND_CAIRO;
+	}
+	have_output = TRUE;
+
 	diff_image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
 						 ctx->test->width,
 						 ctx->test->height);
@@ -655,13 +664,6 @@ cairo_test_for_target (cairo_test_context_t		 *ctx,
 	{
 	    ret = CAIRO_TEST_FAILURE;
 
-	    diff_status = cairo_surface_write_to_png (test_image, png_name);
-	    if (diff_status) {
-		cairo_test_log (ctx, "Error: Failed to write output image: %s\n",
-				cairo_status_to_string (diff_status));
-	    } else
-		have_output = TRUE;
-
 	    diff_status = cairo_surface_write_to_png (diff_image, diff_name);
 	    if (diff_status) {
 		cairo_test_log (ctx, "Error: Failed to write differences image: %s\n",


More information about the cairo-commit mailing list