summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce W. Harrington <b.harrington@samsung.com>2013-07-03 22:37:41 (GMT)
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-04 08:27:56 (GMT)
commit33895904d52f47d0d89156ca1e1ff7cc8f5887d2 (patch)
tree21fbda58a9236ae86c3929ecacaea38cdb530f49
parent5577223489dc3f6e282c498d70f66f8ee9327474 (diff)
downloadcairo-33895904d52f47d0d89156ca1e1ff7cc8f5887d2.tar.gz
cairo-33895904d52f47d0d89156ca1e1ff7cc8f5887d2.tar.xz
test: Add special cases for create-from-png and fallback-resolution
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@samsung.com>
-rwxr-xr-xtest/check-refs.sh10
-rw-r--r--test/create-from-png.c5
-rw-r--r--test/fallback-resolution.c1
3 files changed, 16 insertions, 0 deletions
diff --git a/test/check-refs.sh b/test/check-refs.sh
index 2f558cb..b9b1031 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)
{