summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2015-03-30 12:51:35 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2015-04-04 07:58:44 -0300
commit4bba05339cd10d817854d0dc5f2f2e332ba5790d (patch)
tree0ac598d799e8783d4fa15b339218add52c63b00e
parente00f0de4f3e863c993af3137e7f75e364e3f6ac6 (diff)
tests: multifile: handle FIXME for proper checking when test finished
Use a GstBus and wait for EOS to finish the tests instead of relying on sleeping
-rw-r--r--tests/check/elements/multifile.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/check/elements/multifile.c b/tests/check/elements/multifile.c
index 20770bb8f..7a8e9024c 100644
--- a/tests/check/elements/multifile.c
+++ b/tests/check/elements/multifile.c
@@ -33,11 +33,22 @@
static void
run_pipeline (GstElement * pipeline)
{
+ GstMessage *msg;
+ GstBus *bus;
+
+ bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
+
gst_element_set_state (pipeline, GST_STATE_PAUSED);
gst_element_get_state (pipeline, NULL, NULL, -1);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
- /* FIXME too lazy */
- g_usleep (1000000);
+
+ msg =
+ gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
+ GST_MESSAGE_EOS | GST_MESSAGE_ERROR);
+ fail_unless (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_EOS);
+ gst_message_unref (msg);
+
+ gst_object_unref (bus);
gst_element_set_state (pipeline, GST_STATE_NULL);
}