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

Chris Wilson ickle at kemper.freedesktop.org
Thu Sep 11 02:17:52 PDT 2008


 test/cairo-test.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 140ffa6e271c6e27bafbaf5edc2f026dedf4ed49
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 11 10:00:57 2008 +0100

    [test] Fix order of deleting images vs checks.
    
    The early-checks assume that the images are still available - so it helps
    not to unlink them before comparing results to the previous run.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 15dd251..b9eaf36 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -680,9 +680,6 @@ cairo_test_for_target (cairo_test_context_t		 *ctx,
 	    }
 	}
 
-	_xunlink (ctx, png_name);
-	_xunlink (ctx, diff_name);
-
 	/* first *always* save the test output */
 	test_image = target->get_image_surface (surface,
 					       ctx->test->width,
@@ -695,6 +692,7 @@ cairo_test_for_target (cairo_test_context_t		 *ctx,
 	    goto UNWIND_CAIRO;
 	}
 
+	_xunlink (ctx, png_name);
 	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",
@@ -795,6 +793,7 @@ cairo_test_for_target (cairo_test_context_t		 *ctx,
 				  test_image, ref_image,
 				  diff_image,
 				  &result);
+	_xunlink (ctx, diff_name);
 	if (diff_status) {
 	    cairo_test_log (ctx, "Error: Failed to compare images: %s\n",
 			    cairo_status_to_string (diff_status));


More information about the cairo-commit mailing list