mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 00:38:06 +02:00
test/create-from-png: Update to point to new reference/ images
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
f162f7ebb4
commit
7e5e2dd5e1
1 changed files with 13 additions and 16 deletions
|
|
@ -49,8 +49,8 @@ draw (cairo_t *cr, int width, int height)
|
|||
char *filename;
|
||||
cairo_surface_t *surface;
|
||||
|
||||
xasprintf (&filename, "%s/%s", ctx->srcdir,
|
||||
"create-from-png.ref.png");
|
||||
xasprintf (&filename, "%s/reference/%s",
|
||||
ctx->srcdir, "create-from-png.ref.png");
|
||||
|
||||
surface = cairo_image_surface_create_from_png (filename);
|
||||
if (cairo_surface_status (surface)) {
|
||||
|
|
@ -82,6 +82,7 @@ static cairo_test_status_t
|
|||
preamble (cairo_test_context_t *ctx)
|
||||
{
|
||||
char *filename;
|
||||
char *path;
|
||||
cairo_surface_t *surface;
|
||||
cairo_status_t status;
|
||||
cairo_test_status_t result = CAIRO_TEST_SUCCESS;
|
||||
|
|
@ -126,8 +127,8 @@ preamble (cairo_test_context_t *ctx)
|
|||
return result;
|
||||
|
||||
/* cheekily test error propagation from the user write funcs as well ... */
|
||||
xasprintf (&filename, "%s/%s", ctx->srcdir,
|
||||
"create-from-png.ref.png");
|
||||
xasprintf (&path, "%s/reference", ctx->srcdir);
|
||||
xasprintf (&filename, "%s/%s", path, "create-from-png.ref.png");
|
||||
|
||||
surface = cairo_image_surface_create_from_png (filename);
|
||||
if (cairo_surface_status (surface)) {
|
||||
|
|
@ -177,8 +178,7 @@ preamble (cairo_test_context_t *ctx)
|
|||
return result;
|
||||
|
||||
/* check that loading alpha/opaque PNGs generate the correct surfaces */
|
||||
xasprintf (&filename, "%s/%s", ctx->srcdir,
|
||||
"create-from-png.alpha.ref.png");
|
||||
xasprintf (&filename, "%s/%s", path, "create-from-png.alpha.ref.png");
|
||||
surface = cairo_image_surface_create_from_png (filename);
|
||||
if (cairo_surface_status (surface)) {
|
||||
result = cairo_test_status_from_status (ctx,
|
||||
|
|
@ -198,8 +198,7 @@ preamble (cairo_test_context_t *ctx)
|
|||
if (result != CAIRO_TEST_SUCCESS)
|
||||
return result;
|
||||
|
||||
xasprintf (&filename, "%s/%s", ctx->srcdir,
|
||||
"create-from-png.ref.png");
|
||||
xasprintf (&filename, "%s/%s", path, "create-from-png.ref.png");
|
||||
surface = cairo_image_surface_create_from_png (filename);
|
||||
if (cairo_surface_status (surface)) {
|
||||
result = cairo_test_status_from_status (ctx,
|
||||
|
|
@ -220,8 +219,7 @@ preamble (cairo_test_context_t *ctx)
|
|||
return result;
|
||||
|
||||
/* check paletted PNGs */
|
||||
xasprintf (&filename, "%s/%s", ctx->srcdir,
|
||||
"create-from-png.indexed-alpha.ref.png");
|
||||
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)) {
|
||||
result = cairo_test_status_from_status (ctx,
|
||||
|
|
@ -241,8 +239,7 @@ preamble (cairo_test_context_t *ctx)
|
|||
if (result != CAIRO_TEST_SUCCESS)
|
||||
return result;
|
||||
|
||||
xasprintf (&filename, "%s/%s", ctx->srcdir,
|
||||
"create-from-png.indexed.ref.png");
|
||||
xasprintf (&filename, "%s/%s", path, "create-from-png.indexed.ref.png");
|
||||
surface = cairo_image_surface_create_from_png (filename);
|
||||
if (cairo_surface_status (surface)) {
|
||||
result = cairo_test_status_from_status (ctx,
|
||||
|
|
@ -263,8 +260,7 @@ preamble (cairo_test_context_t *ctx)
|
|||
return result;
|
||||
|
||||
/* check grayscale PNGs */
|
||||
xasprintf (&filename, "%s/%s", ctx->srcdir,
|
||||
"create-from-png.gray-alpha.ref.png");
|
||||
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)) {
|
||||
result = cairo_test_status_from_status (ctx,
|
||||
|
|
@ -284,8 +280,7 @@ preamble (cairo_test_context_t *ctx)
|
|||
if (result != CAIRO_TEST_SUCCESS)
|
||||
return result;
|
||||
|
||||
xasprintf (&filename, "%s/%s", ctx->srcdir,
|
||||
"create-from-png.gray.ref.png");
|
||||
xasprintf (&filename, "%s/%s", path, "create-from-png.gray.ref.png");
|
||||
surface = cairo_image_surface_create_from_png (filename);
|
||||
if (cairo_surface_status (surface)) {
|
||||
result = cairo_test_status_from_status (ctx,
|
||||
|
|
@ -303,6 +298,8 @@ preamble (cairo_test_context_t *ctx)
|
|||
free (filename);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
free (path);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue