summaryrefslogtreecommitdiff
path: root/tests/png
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-05-17 23:32:16 -0400
committerMike Frysinger <vapier@gentoo.org>2016-05-17 23:32:16 -0400
commit10a491511437250e39428a45ec57f244c253f899 (patch)
treeb655b23dba1fc60ae64c5914076828b666db742b /tests/png
parent1239832a09b160a21a092cafcef56c3c16f554f1 (diff)
downloadlibgd-10a491511437250e39428a45ec57f244c253f899.tar.gz
tests: rework handling of temp output files
Many of the tests open files in local paths for writing which leaves a variety of temp files in the tests subdirs. This ends up failing in a few scenarios like out of tree builds or cmake builds. Add a few helper functions to the common gdtest module to quickly get handles to temp files for the tests to leverage.
Diffstat (limited to 'tests/png')
-rw-r--r--tests/png/png_im2im.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/png/png_im2im.c b/tests/png/png_im2im.c
index bac5e13..df6037d 100644
--- a/tests/png/png_im2im.c
+++ b/tests/png/png_im2im.c
@@ -23,13 +23,9 @@ int main()
gdImageEllipse(src, 70, 25, 30, 20, b);
#define OUTPUT_PNG(name) do { \
- FILE *fp; \
- \
- fp = fopen("png_im2im_" #name ".png", "wb"); \
- if (fp) { \
- gdImagePng(name, fp); \
- fclose(fp); \
- } \
+ FILE *fp = gdTestTempFp(); \
+ gdImagePng(name, fp); \
+ fclose(fp); \
} while (0)
OUTPUT_PNG(src);