From 32591f5649aa69664bf91893f350cd13583d8d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 20 Aug 2017 17:15:33 +0100 Subject: [PATCH] tests: tagschecking: remove gst-check-xmp-* temp files when done Also fix temp file creation a bit. --- tests/check/pipelines/tagschecking.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/check/pipelines/tagschecking.c b/tests/check/pipelines/tagschecking.c index 13c72b5896..8670bf9e1f 100644 --- a/tests/check/pipelines/tagschecking.c +++ b/tests/check/pipelines/tagschecking.c @@ -19,6 +19,7 @@ */ #include +#include static GstTagList *received_tags = NULL; @@ -257,16 +258,19 @@ test_tags (const gchar * tag_str, const gchar * caps, const gchar * muxer, const gchar * demuxer) { gchar *tmpfile; - gchar *tmp; + gchar *tmpdir; - tmp = g_strdup_printf ("%s%d", "gst-check-xmp-test-", g_random_int ()); - tmpfile = g_build_filename (g_get_tmp_dir (), tmp, NULL); - g_free (tmp); + tmpdir = g_dir_make_tmp ("gst-check-good-XXXXXX", NULL); + fail_unless (tmpdir != NULL); + tmpfile = g_build_filename (tmpdir, "tagschecking-xmp", NULL); GST_DEBUG ("testing tags : %s", tag_str); test_mux_tags (tag_str, caps, muxer, tmpfile); test_demux_tags (tag_str, demuxer, tmpfile); + g_unlink (tmpfile); + g_rmdir (tmpdir); g_free (tmpfile); + g_free (tmpdir); } #define H264_CAPS "video/x-h264, width=(int)320, height=(int)240," \