From 53c22085d9d7f4204d333e43dc5f8d3d372868ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 15 May 2013 11:15:24 +0200 Subject: [PATCH] parser: Fix event handling in unit tests --- tests/check/elements/parser.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/check/elements/parser.c b/tests/check/elements/parser.c index 43b4d84bba..770a8db76f 100644 --- a/tests/check/elements/parser.c +++ b/tests/check/elements/parser.c @@ -141,6 +141,7 @@ setup_element (const gchar * factory, ElementSetup setup, { GstElement *element; GstBus *bus; + gchar *caps_str = NULL; if (setup) { element = setup (factory); @@ -148,13 +149,16 @@ setup_element (const gchar * factory, ElementSetup setup, element = gst_check_setup_element (factory); } srcpad = gst_check_setup_src_pad (element, src_template); + + if (sink_caps) { + caps_str = gst_caps_to_string (sink_caps); + sink_template->static_caps.string = caps_str; + } + sinkpad = gst_check_setup_sink_pad (element, sink_template); gst_pad_set_active (srcpad, TRUE); + gst_check_setup_events (srcpad, element, src_caps, GST_FORMAT_BYTES); gst_pad_set_active (sinkpad, TRUE); - if (src_caps) - fail_unless (gst_pad_set_caps (srcpad, src_caps)); - if (sink_caps) - fail_unless (gst_pad_set_caps (sinkpad, sink_caps)); bus = gst_bus_new (); gst_element_set_bus (element, bus); @@ -164,6 +168,7 @@ setup_element (const gchar * factory, ElementSetup setup, "could not set to playing"); buffers = NULL; + g_free (caps_str); return element; }