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/gd2 | |
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/gd2')
-rw-r--r-- | tests/gd2/gd2_im2im.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/gd2/gd2_im2im.c b/tests/gd2/gd2_im2im.c index 7745fa5..72e99da 100644 --- a/tests/gd2/gd2_im2im.c +++ b/tests/gd2/gd2_im2im.c @@ -23,13 +23,9 @@ int main() gdImageEllipse(src, 70, 25, 30, 20, b); #define OUTPUT_GD2(x) do { \ - FILE *fp; \ - \ - fp = fopen("gd2_im2im_" #x ".gd2", "wb"); \ - if (fp) { \ - gdImageGd2(x, fp, (GD2_CHUNKSIZE_MIN+GD2_CHUNKSIZE_MAX)/2, GD2_FMT_COMPRESSED); \ - fclose(fp); \ - } \ + FILE *fp = gdTestTempFp(); \ + gdImageGd2(x, fp, (GD2_CHUNKSIZE_MIN+GD2_CHUNKSIZE_MAX)/2, GD2_FMT_COMPRESSED); \ + fclose(fp); \ } while (0) OUTPUT_GD2(src); |