diff options
Diffstat (limited to 'test/ps-features.c')
-rw-r--r-- | test/ps-features.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/ps-features.c b/test/ps-features.c index 2eb9acea5..fe5de42fa 100644 --- a/test/ps-features.c +++ b/test/ps-features.c @@ -91,9 +91,10 @@ preamble (cairo_test_context_t *ctx) cairo_surface_t *surface; cairo_t *cr; cairo_status_t status; - const char *filename; size_t i; char dsc[255]; + char *filename; + const char *path = cairo_test_mkdir (CAIRO_TEST_OUTPUT_DIR) ? CAIRO_TEST_OUTPUT_DIR : "."; if (! (cairo_test_is_target_enabled (ctx, "ps2") || cairo_test_is_target_enabled (ctx, "ps3"))) @@ -101,8 +102,7 @@ preamble (cairo_test_context_t *ctx) return CAIRO_TEST_UNTESTED; } - filename = CAIRO_TEST_OUTPUT_DIR "/" BASENAME ".ps"; - + xasprintf (&filename, "%s/%s.ps", path, BASENAME); /* We demonstrate that the initial size doesn't matter (we're * passing 0,0), if we use cairo_ps_surface_set_size on the first * page. */ @@ -149,10 +149,12 @@ preamble (cairo_test_context_t *ctx) if (status) { cairo_test_log (ctx, "Failed to create ps surface for file %s: %s\n", filename, cairo_status_to_string (status)); + free (filename); return CAIRO_TEST_FAILURE; } printf ("ps-features: Please check %s to ensure it looks/prints correctly.\n", filename); + free (filename); return CAIRO_TEST_SUCCESS; } |