diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2023-02-19 21:10:58 +1030 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2023-04-18 18:27:12 +0930 |
commit | b53b48116e610d61cdf630c24a11b59a18345e16 (patch) | |
tree | 3bc8f3410e795ce81c1408b9d7f3a217033d29ba /test/cairo-test.c | |
parent | e7ed40a71dac04cb4c608b409b04577d01f08454 (diff) | |
download | cairo-b53b48116e610d61cdf630c24a11b59a18345e16.tar.gz |
Make cairo_tag_begin/end work correctly in groups
Fixes #508
Diffstat (limited to 'test/cairo-test.c')
-rw-r--r-- | test/cairo-test.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/cairo-test.c b/test/cairo-test.c index 5a2cf1a74..49dfadb15 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -185,7 +185,7 @@ _cairo_test_init (cairo_test_context_t *ctx, ctx->own_targets = FALSE; ctx->srcdir = parent->srcdir; - ctx->refdir = parent->refdir; + ctx->refdir = xstrdup (parent->refdir); } else { int tmp_num_targets; cairo_bool_t tmp_limited_targets; @@ -204,7 +204,10 @@ _cairo_test_init (cairo_test_context_t *ctx, ctx->srcdir = "srcdir"; #endif } - ctx->refdir = getenv ("CAIRO_REF_DIR"); + + ctx->refdir = xstrdup (getenv ("CAIRO_REF_DIR")); + if (ctx->refdir == NULL) + xasprintf (&ctx->refdir, "%s/reference", ctx->srcdir); } #ifdef HAVE_UNISTD_H @@ -246,6 +249,7 @@ cairo_test_fini (cairo_test_context_t *ctx) fclose (ctx->log_file); ctx->log_file = NULL; + free (ctx->refdir); free (ctx->ref_name); cairo_surface_destroy (ctx->ref_image); cairo_surface_destroy (ctx->ref_image_flattened); |