summaryrefslogtreecommitdiffstats
path: root/tests/check/pipelines/flacdec.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2009-05-15 17:11:27 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-05-15 17:17:20 +0100
commitc014c4a621e1119ef8e2ca564de97878529b7197 (patch)
tree1d46c03f2b0e4a79d0806c116a578d905a05d3e5 /tests/check/pipelines/flacdec.c
parentad9b02b881e2f6dca0133a4831ee640d92701f41 (diff)
checks: move files required by unit tests into tests/files and make sure they're disted
Move unit test data into the directory where it belongs and make in particular the flacdec unit test cd into the directory with the test files instead of making assumptions about the current working directory in that unit test. As a side effect of movng those files, there's only one EXTRA_DIST in tests/check/Makefile.am now, which is likely to work better than having two. Hopefully fixes #582753.
Diffstat (limited to 'tests/check/pipelines/flacdec.c')
-rw-r--r--tests/check/pipelines/flacdec.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/tests/check/pipelines/flacdec.c b/tests/check/pipelines/flacdec.c
index 31710255..ced6c343 100644
--- a/tests/check/pipelines/flacdec.c
+++ b/tests/check/pipelines/flacdec.c
@@ -18,6 +18,7 @@
*/
#include <gst/check/gstcheck.h>
+#include <glib/gstdio.h>
static guint16
buffer_get_first_sample (GstBuffer * buf)
@@ -60,6 +61,8 @@ GST_START_TEST (test_decode)
guint16 first_sample = 0;
guint size = 0;
+ fail_unless_equals_int (g_chdir (GST_TEST_FILES_PATH), 0);
+
pipeline = gst_parse_launch ("filesrc location=audiotestsrc.flac"
" ! flacdec ! appsink name=sink", NULL);
fail_unless (pipeline != NULL);
@@ -105,6 +108,8 @@ GST_START_TEST (test_decode_seek_full)
gboolean result;
guint size = 0;
+ fail_unless_equals_int (g_chdir (GST_TEST_FILES_PATH), 0);
+
pipeline = gst_parse_launch ("filesrc location=audiotestsrc.flac"
" ! flacdec ! appsink name=sink", NULL);
fail_unless (pipeline != NULL);
@@ -158,6 +163,8 @@ GST_START_TEST (test_decode_seek_partial)
guint size = 0;
guint16 first_sample = 0;
+ fail_unless_equals_int (g_chdir (GST_TEST_FILES_PATH), 0);
+
pipeline = gst_parse_launch ("filesrc location=audiotestsrc.flac"
" ! flacdec ! appsink name=sink", NULL);
fail_unless (pipeline != NULL);
@@ -206,7 +213,7 @@ GST_START_TEST (test_decode_seek_partial)
GST_END_TEST;
-Suite *
+static Suite *
flacdec_suite (void)
{
Suite *s = suite_create ("flacdec");
@@ -224,20 +231,4 @@ flacdec_suite (void)
return s;
}
-int
-main (int argc, char **argv)
-{
- int nf;
-
- Suite *s = flacdec_suite ();
-
- SRunner *sr = srunner_create (s);
-
- gst_check_init (&argc, &argv);
-
- srunner_run_all (sr, CK_NORMAL);
- nf = srunner_ntests_failed (sr);
- srunner_free (sr);
-
- return nf;
-}
+GST_CHECK_MAIN (flacdec);