[gst-cvs] gst-plugins-good: check: Don't change directory in the test
Jan Schmidt
thaytan at kemper.freedesktop.org
Fri May 15 19:01:38 PDT 2009
Module: gst-plugins-good
Branch: master
Commit: bdd5f4f2d99d08587dead18da24c220a72552f22
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=bdd5f4f2d99d08587dead18da24c220a72552f22
Author: Jan Schmidt <thaytan at noraisin.net>
Date: Sat May 16 02:37:06 2009 +0100
check: Don't change directory in the test
Changing directory invalidates the paths the registry has picked
up for our plugins, because the test environment specifies relative
paths. Fixing that is a separate problem, in the meantime, build a
path to the test files instead of changing directory. Fixes the
distcheck.
---
tests/check/pipelines/flacdec.c | 39 +++++++++++++++++++++++++++------------
1 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/tests/check/pipelines/flacdec.c b/tests/check/pipelines/flacdec.c
index ced6c34..2f1890a 100644
--- a/tests/check/pipelines/flacdec.c
+++ b/tests/check/pipelines/flacdec.c
@@ -60,13 +60,18 @@ GST_START_TEST (test_decode)
GstBuffer *buffer = NULL;
guint16 first_sample = 0;
guint size = 0;
+ gchar *path =
+ g_build_filename (GST_TEST_FILES_PATH, "audiotestsrc.flac", NULL);
+ gchar *pipe_desc =
+ g_strdup_printf ("filesrc location=\"%s\" ! flacdec ! appsink name=sink",
+ path);
- fail_unless_equals_int (g_chdir (GST_TEST_FILES_PATH), 0);
-
- pipeline = gst_parse_launch ("filesrc location=audiotestsrc.flac"
- " ! flacdec ! appsink name=sink", NULL);
+ pipeline = gst_parse_launch (pipe_desc, NULL);
fail_unless (pipeline != NULL);
+ g_free (path);
+ g_free (pipe_desc);
+
appsink = gst_bin_get_by_name (GST_BIN (pipeline), "sink");
fail_unless (appsink != NULL);
@@ -107,13 +112,18 @@ GST_START_TEST (test_decode_seek_full)
guint16 first_sample = 0;
gboolean result;
guint size = 0;
+ gchar *path =
+ g_build_filename (GST_TEST_FILES_PATH, "audiotestsrc.flac", NULL);
+ gchar *pipe_desc =
+ g_strdup_printf ("filesrc location=\"%s\" ! flacdec ! appsink name=sink",
+ path);
- fail_unless_equals_int (g_chdir (GST_TEST_FILES_PATH), 0);
-
- pipeline = gst_parse_launch ("filesrc location=audiotestsrc.flac"
- " ! flacdec ! appsink name=sink", NULL);
+ pipeline = gst_parse_launch (pipe_desc, NULL);
fail_unless (pipeline != NULL);
+ g_free (pipe_desc);
+ g_free (path);
+
appsink = gst_bin_get_by_name (GST_BIN (pipeline), "sink");
fail_unless (appsink != NULL);
@@ -162,13 +172,18 @@ GST_START_TEST (test_decode_seek_partial)
gboolean result;
guint size = 0;
guint16 first_sample = 0;
+ gchar *path =
+ g_build_filename (GST_TEST_FILES_PATH, "audiotestsrc.flac", NULL);
+ gchar *pipe_desc =
+ g_strdup_printf ("filesrc location=\"%s\" ! flacdec ! appsink name=sink",
+ path);
- fail_unless_equals_int (g_chdir (GST_TEST_FILES_PATH), 0);
-
- pipeline = gst_parse_launch ("filesrc location=audiotestsrc.flac"
- " ! flacdec ! appsink name=sink", NULL);
+ pipeline = gst_parse_launch (pipe_desc, NULL);
fail_unless (pipeline != NULL);
+ g_free (path);
+ g_free (pipe_desc);
+
appsink = gst_bin_get_by_name (GST_BIN (pipeline), "sink");
fail_unless (appsink != NULL);
More information about the Gstreamer-commits
mailing list