[cairo] [PATCH v2 7/7] test: Add special cases for create-from-png and fallback-resolution

Bryce W. Harrington b.harrington at samsung.com
Wed Jul 3 15:37:41 PDT 2013


These tests use reference images somewhat differently from other tests,
so treat them as special cases and avoid recommending deleting any of
their files.

Add TODO's to each test to rework them to be more consistent with other
tests.

Signed-off-by: Bryce Harrington <b.harrington at samsung.com>
---
 test/check_refs.sh         |   10 ++++++++++
 test/create-from-png.c     |    5 +++++
 test/fallback-resolution.c |    1 +
 3 files changed, 16 insertions(+)

diff --git a/test/check_refs.sh b/test/check_refs.sh
index a9dfe17..3c111a7 100755
--- a/test/check_refs.sh
+++ b/test/check_refs.sh
@@ -46,6 +46,16 @@ for file in *.ref.png; do
 	fi
     fi
 
+    # Special cases
+    if [ $test = "create-from-png" ]; then
+	# The create-from-png test utilizes multiple reference images directly
+	continue
+    elif [ $test = "fallback-resolution" ]; then
+	# The fallback-resolution test generates a set of reference images;
+	# These won't be redundant with one another, but just ignore them all.
+	continue
+    fi
+
     if [ -e $ref ]; then
 	if cmp --silent "$ref" "$file" ; then
 	    printf "redundant: %s and %s are byte-by-byte identical files\n" $file $ref
diff --git a/test/create-from-png.c b/test/create-from-png.c
index f620956..2ca1fa2 100644
--- a/test/create-from-png.c
+++ b/test/create-from-png.c
@@ -182,6 +182,7 @@ preamble (cairo_test_context_t *ctx)
 	return result;
 
     /* check that loading alpha/opaque PNGs generate the correct surfaces */
+    /* TODO: Avoid using target-specific references as sample images */
     xasprintf (&filename, "%s/%s", path, "create-from-png.alpha.ref.png");
     surface = cairo_image_surface_create_from_png (filename);
     if (cairo_surface_status (surface)) {
@@ -223,6 +224,7 @@ preamble (cairo_test_context_t *ctx)
 	return result;
 
     /* check paletted PNGs */
+    /* TODO: Avoid using target-specific references as sample images */
     xasprintf (&filename, "%s/%s", path, "create-from-png.indexed-alpha.ref.png");
     surface = cairo_image_surface_create_from_png (filename);
     if (cairo_surface_status (surface)) {
@@ -243,6 +245,7 @@ preamble (cairo_test_context_t *ctx)
     if (result != CAIRO_TEST_SUCCESS)
 	return result;
 
+    /* TODO: Avoid using target-specific references as sample images */
     xasprintf (&filename, "%s/%s", path, "create-from-png.indexed.ref.png");
     surface = cairo_image_surface_create_from_png (filename);
     if (cairo_surface_status (surface)) {
@@ -264,6 +267,7 @@ preamble (cairo_test_context_t *ctx)
 	return result;
 
     /* check grayscale PNGs */
+    /* TODO: Avoid using target-specific references as sample images */
     xasprintf (&filename, "%s/%s", path, "create-from-png.gray-alpha.ref.png");
     surface = cairo_image_surface_create_from_png (filename);
     if (cairo_surface_status (surface)) {
@@ -284,6 +288,7 @@ preamble (cairo_test_context_t *ctx)
     if (result != CAIRO_TEST_SUCCESS)
 	return result;
 
+    /* TODO: Avoid using target-specific references as sample images */
     xasprintf (&filename, "%s/%s", path, "create-from-png.gray.ref.png");
     surface = cairo_image_surface_create_from_png (filename);
     if (cairo_surface_status (surface)) {
diff --git a/test/fallback-resolution.c b/test/fallback-resolution.c
index bf83e31..138b3a4 100644
--- a/test/fallback-resolution.c
+++ b/test/fallback-resolution.c
@@ -338,6 +338,7 @@ _cairo_test_mkdir (const char *path)
     return errno == EEXIST;
 }
 
+/* TODO: Split each ppi case out to its own CAIRO_TEST() test case */
 static cairo_test_status_t
 preamble (cairo_test_context_t *ctx)
 {
-- 
1.7.9.5

--
Bryce Harrington
Senior Open Source Developer  -  b.harrington at samsung.com
Open Source Group             -  Samsung Research America


More information about the cairo mailing list