mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
valve: Fix unit test by sending caps before buffers
Unexpected critical/warning: gstpad.c:4400:gst_pad_push_data:<'':src> Got data flow before segment event https://bugzilla.gnome.org/show_bug.cgi?id=763753
This commit is contained in:
parent
e8f58f5ba5
commit
d9a1cb21e4
1 changed files with 10 additions and 13 deletions
|
@ -30,21 +30,19 @@ GST_START_TEST (test_valve_basic)
|
||||||
{
|
{
|
||||||
GstHarness *h = gst_harness_new ("valve");
|
GstHarness *h = gst_harness_new ("valve");
|
||||||
|
|
||||||
|
gst_harness_set_src_caps_str (h, "mycaps");
|
||||||
|
|
||||||
/* when not dropping, we don't drop buffers.... */
|
/* when not dropping, we don't drop buffers.... */
|
||||||
g_object_set (h->element, "drop", FALSE, NULL);
|
g_object_set (h->element, "drop", FALSE, NULL);
|
||||||
fail_unless_equals_int (GST_FLOW_OK,
|
fail_unless_equals_int (GST_FLOW_OK, gst_harness_push (h, gst_buffer_new ()));
|
||||||
gst_harness_push (h, gst_buffer_new ()));
|
fail_unless_equals_int (GST_FLOW_OK, gst_harness_push (h, gst_buffer_new ()));
|
||||||
fail_unless_equals_int (GST_FLOW_OK,
|
|
||||||
gst_harness_push (h, gst_buffer_new ()));
|
|
||||||
fail_unless_equals_int (2, gst_harness_buffers_received (h));
|
fail_unless_equals_int (2, gst_harness_buffers_received (h));
|
||||||
|
|
||||||
/* when dropping, the buffers don't make it through */
|
/* when dropping, the buffers don't make it through */
|
||||||
g_object_set (h->element, "drop", TRUE, NULL);
|
g_object_set (h->element, "drop", TRUE, NULL);
|
||||||
fail_unless_equals_int (1, gst_harness_events_received (h));
|
fail_unless_equals_int (3, gst_harness_events_received (h));
|
||||||
fail_unless_equals_int (GST_FLOW_OK,
|
fail_unless_equals_int (GST_FLOW_OK, gst_harness_push (h, gst_buffer_new ()));
|
||||||
gst_harness_push (h, gst_buffer_new ()));
|
fail_unless_equals_int (GST_FLOW_OK, gst_harness_push (h, gst_buffer_new ()));
|
||||||
fail_unless_equals_int (GST_FLOW_OK,
|
|
||||||
gst_harness_push (h, gst_buffer_new ()));
|
|
||||||
fail_unless_equals_int (2, gst_harness_buffers_received (h));
|
fail_unless_equals_int (2, gst_harness_buffers_received (h));
|
||||||
|
|
||||||
gst_harness_teardown (h);
|
gst_harness_teardown (h);
|
||||||
|
@ -65,8 +63,8 @@ GST_START_TEST (test_valve_upstream_events_dont_send_sticky)
|
||||||
/* verify no events have made it through yet */
|
/* verify no events have made it through yet */
|
||||||
fail_unless_equals_int (0, gst_harness_events_received (h));
|
fail_unless_equals_int (0, gst_harness_events_received (h));
|
||||||
|
|
||||||
/* stop dropping */
|
/* stop dropping */
|
||||||
g_object_set (h->element, "drop", FALSE, NULL);
|
g_object_set (h->element, "drop", FALSE, NULL);
|
||||||
|
|
||||||
/* send an upstream event and verify that no
|
/* send an upstream event and verify that no
|
||||||
downstream events was pushed as a result of this */
|
downstream events was pushed as a result of this */
|
||||||
|
@ -74,8 +72,7 @@ GST_START_TEST (test_valve_upstream_events_dont_send_sticky)
|
||||||
fail_unless_equals_int (0, gst_harness_events_received (h));
|
fail_unless_equals_int (0, gst_harness_events_received (h));
|
||||||
|
|
||||||
/* push a buffer, and verify this pushes the sticky events */
|
/* push a buffer, and verify this pushes the sticky events */
|
||||||
fail_unless_equals_int (GST_FLOW_OK,
|
fail_unless_equals_int (GST_FLOW_OK, gst_harness_push (h, gst_buffer_new ()));
|
||||||
gst_harness_push (h, gst_buffer_new ()));
|
|
||||||
fail_unless_equals_int (3, gst_harness_events_received (h));
|
fail_unless_equals_int (3, gst_harness_events_received (h));
|
||||||
|
|
||||||
gst_harness_teardown (h);
|
gst_harness_teardown (h);
|
||||||
|
|
Loading…
Reference in a new issue