diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-05-17 23:32:16 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-05-17 23:32:16 -0400 |
commit | 10a491511437250e39428a45ec57f244c253f899 (patch) | |
tree | b655b23dba1fc60ae64c5914076828b666db742b /tests/wbmp | |
parent | 1239832a09b160a21a092cafcef56c3c16f554f1 (diff) | |
download | libgd-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/wbmp')
-rw-r--r-- | tests/wbmp/wbmp_im2im.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/wbmp/wbmp_im2im.c b/tests/wbmp/wbmp_im2im.c index 826c7fa..597f602 100644 --- a/tests/wbmp/wbmp_im2im.c +++ b/tests/wbmp/wbmp_im2im.c @@ -21,13 +21,9 @@ int main() gdImageEllipse(src, 70, 25, 30, 20, b); #define OUTPUT_WBMP(name) do { \ - FILE *fp; \ - \ - fp = fopen("wbmp_im2im_" #name ".wbmp", "wb"); \ - if (fp) { \ - gdImageWBMP(name, 1, fp); \ - fclose(fp); \ - } \ + FILE *fp = gdTestTempFp(); \ + gdImageWBMP(name, 1, fp); \ + fclose(fp); \ } while (0) OUTPUT_WBMP(src); |