mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-20 05:50:10 +01:00
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>
This commit is contained in:
parent
5577223489
commit
33895904d5
3 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue