multifile: fix build of tests
authorThiago Santos <thiago.sousa.santos@collabora.com>
Thu, 24 Nov 2011 17:11:33 +0000 (14:11 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Thu, 24 Nov 2011 17:18:44 +0000 (14:18 -0300)
Tests fail to build because g_mkdtemp is available from glib since
2.26.

This patch adds a condition around the redefinition of
g_mkdtemp on the tests to only build it if glib is older than
2.26.

tests/check/elements/multifile.c

index 479e028..52ce2ce 100644 (file)
@@ -40,19 +40,19 @@ run_pipeline (GstElement * pipeline)
   gst_element_set_state (pipeline, GST_STATE_NULL);
 }
 
+#if !GLIB_CHECK_VERSION(2,26,0)
 static gchar *
-g_mkdtemp (const gchar * template)
+g_mkdtemp (gchar * template)
 {
-  gchar *s;
   gchar *tmpdir;
 
-  s = g_strdup (template);
-  tmpdir = mkdtemp (s);
+  tmpdir = mkdtemp (template);
   if (tmpdir == NULL) {
-    g_free (s);
+    g_free (template);
   }
   return tmpdir;
 }
+#endif
 
 GST_START_TEST (test_multifilesink_key_frame)
 {
@@ -93,7 +93,6 @@ GST_START_TEST (test_multifilesink_key_frame)
 
   g_free (mfs_pattern);
   g_free (my_tmpdir);
-  g_free (template);
 }
 
 GST_END_TEST;
@@ -144,7 +143,6 @@ GST_START_TEST (test_multifilesink_max_files)
 
   g_free (mfs_pattern);
   g_free (my_tmpdir);
-  g_free (template);
 }
 
 GST_END_TEST;
@@ -202,7 +200,6 @@ GST_START_TEST (test_multifilesrc)
 
   g_free (mfs_pattern);
   g_free (my_tmpdir);
-  g_free (template);
 }
 
 GST_END_TEST;