From: Tim-Philipp Müller Date: Sun, 12 Aug 2012 17:36:09 +0000 (+0100) Subject: tests: fix collectpads test X-Git-Tag: RELEASE-0.11.94~86 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1507ce390717d6a932361aba14c85435ccca3d0e;p=platform%2Fupstream%2Fgstreamer.git tests: fix collectpads test After an EOS we must send a FLUSH_STOP event if we want to send data again. --- diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index b9e90e5..49ad8ed 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -139,13 +139,13 @@ check_PROGRAMS = \ libs/bitreader \ libs/bytereader \ libs/bytewriter \ + libs/collectpads \ libs/gstnetclientclock \ libs/gstnettimeprovider \ libs/transform1 # failing tests -noinst_PROGRAMS = \ - libs/collectpads +noinst_PROGRAMS = # elements to ignore for the state tests # STATE_IGNORE_ELEMENTS = diff --git a/tests/check/libs/collectpads.c b/tests/check/libs/collectpads.c index 72cac1b..229b46f 100644 --- a/tests/check/libs/collectpads.c +++ b/tests/check/libs/collectpads.c @@ -79,10 +79,19 @@ collected_cb (GstCollectPads * pads, gpointer user_data) static gpointer push_buffer (gpointer user_data) { + GstFlowReturn flow; + GstCaps *caps; TestData *test_data = (TestData *) user_data; - fail_unless (gst_pad_push (test_data->pad, test_data->buffer) - == GST_FLOW_OK); + gst_pad_push_event (test_data->pad, gst_event_new_stream_start ("test")); + + caps = gst_caps_new_empty_simple ("foo/x-bar"); + gst_pad_push_event (test_data->pad, gst_event_new_caps (caps)); + gst_caps_unref (caps); + + flow = gst_pad_push (test_data->pad, test_data->buffer); + fail_unless (flow == GST_FLOW_OK, "got flow %s instead of OK", + gst_flow_get_name (flow)); return NULL; } @@ -260,6 +269,8 @@ GST_START_TEST (test_collect_twice) sinkpad2, sizeof (TestData)); fail_unless (data2 != NULL); + GST_INFO ("round 1"); + buf1 = gst_buffer_new (); /* start collect pads */ @@ -294,8 +305,14 @@ GST_START_TEST (test_collect_twice) gst_collect_pads_stop (collect); collected = FALSE; + GST_INFO ("round 2"); + buf2 = gst_buffer_new (); + /* clear EOS from pads */ + gst_pad_push_event (srcpad1, gst_event_new_flush_stop (TRUE)); + gst_pad_push_event (srcpad2, gst_event_new_flush_stop (TRUE)); + /* start collect pads */ gst_collect_pads_start (collect);