From c014c4a621e1119ef8e2ca564de97878529b7197 Mon Sep 17 00:00:00 2001 From: Tim-Philipp Müller Date: Fri, 15 May 2009 17:11:27 +0100 Subject: 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. --- tests/check/pipelines/flacdec.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'tests/check/pipelines/flacdec.c') 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 +#include 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); -- cgit