fix buffer leaks in tests

Need to call gst_check_drop_buffers() to release the buffers exchanged
during the test.

https://bugzilla.gnome.org/show_bug.cgi?id=766561
This commit is contained in:
Guillaume Desmottes 2016-05-16 17:31:58 +02:00 committed by Sebastian Dröge
parent fb41b307a6
commit 6ae9c23fa3
8 changed files with 10 additions and 0 deletions

View file

@ -61,6 +61,7 @@ cleanup_capssetter (GstElement * capssetter)
{ {
GST_DEBUG ("cleanup_capssetter"); GST_DEBUG ("cleanup_capssetter");
gst_check_drop_buffers ();
gst_pad_set_active (mysrcpad, FALSE); gst_pad_set_active (mysrcpad, FALSE);
gst_pad_set_active (mysinkpad, FALSE); gst_pad_set_active (mysinkpad, FALSE);
gst_check_teardown_src_pad (capssetter); gst_check_teardown_src_pad (capssetter);

View file

@ -148,6 +148,7 @@ cleanup_icydemux (void)
gst_object_unref (bus); gst_object_unref (bus);
bus = NULL; bus = NULL;
gst_check_drop_buffers ();
gst_check_teardown_src_pad (icydemux); gst_check_teardown_src_pad (icydemux);
if (sinkpad) if (sinkpad)
gst_check_teardown_sink_pad (icydemux); gst_check_teardown_sink_pad (icydemux);

View file

@ -81,6 +81,7 @@ cleanup_jpegenc (GstElement * jpegenc)
GST_DEBUG ("cleanup_jpegenc"); GST_DEBUG ("cleanup_jpegenc");
gst_element_set_state (jpegenc, GST_STATE_NULL); gst_element_set_state (jpegenc, GST_STATE_NULL);
gst_check_drop_buffers ();
gst_pad_set_active (mysrcpad, FALSE); gst_pad_set_active (mysrcpad, FALSE);
gst_pad_set_active (mysinkpad, FALSE); gst_pad_set_active (mysinkpad, FALSE);
gst_check_teardown_sink_pad (jpegenc); gst_check_teardown_sink_pad (jpegenc);

View file

@ -241,6 +241,7 @@ GST_START_TEST (test_message_is_valid)
gst_object_unref (bus); gst_object_unref (bus);
gst_element_set_state (level, GST_STATE_NULL); gst_element_set_state (level, GST_STATE_NULL);
cleanup_level (level); cleanup_level (level);
gst_check_drop_buffers ();
} }
GST_END_TEST; GST_END_TEST;

View file

@ -371,6 +371,7 @@ GST_START_TEST (test_multifilesrc_stop_index)
gst_element_set_state (src, GST_STATE_NULL); gst_element_set_state (src, GST_STATE_NULL);
gst_check_drop_buffers ();
gst_check_teardown_pad_by_name (src, "src"); gst_check_teardown_pad_by_name (src, "src");
gst_check_teardown_element (src); gst_check_teardown_element (src);
} }

View file

@ -577,6 +577,7 @@ GST_START_TEST (test_reuse)
fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ()) == TRUE); fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ()) == TRUE);
cleanup_qtmux (qtmux, "video_%u"); cleanup_qtmux (qtmux, "video_%u");
gst_check_drop_buffers ();
} }
GST_END_TEST; GST_END_TEST;
@ -879,6 +880,7 @@ test_average_bitrate_custom (const gchar * elementname,
gst_element_set_state (qtmux, GST_STATE_NULL); gst_element_set_state (qtmux, GST_STATE_NULL);
gst_element_set_state (filesink, GST_STATE_NULL); gst_element_set_state (filesink, GST_STATE_NULL);
gst_check_drop_buffers ();
gst_pad_set_active (mysrcpad, FALSE); gst_pad_set_active (mysrcpad, FALSE);
teardown_src_pad (mysrcpad); teardown_src_pad (mysrcpad);
gst_object_unref (filesink); gst_object_unref (filesink);

View file

@ -138,6 +138,7 @@ cleanup_rtprtx (GstElement * rtprtxsend, GstElement * rtprtxreceive)
g_list_free (inbuffers); g_list_free (inbuffers);
inbuffers = NULL; inbuffers = NULL;
gst_check_drop_buffers ();
gst_pad_set_active (srcpad, FALSE); gst_pad_set_active (srcpad, FALSE);
gst_check_teardown_src_pad (rtprtxsend); gst_check_teardown_src_pad (rtprtxsend);
gst_check_teardown_element (rtprtxsend); gst_check_teardown_element (rtprtxsend);

View file

@ -125,6 +125,7 @@ no_socket:
gst_element_set_state (udpsrc, GST_STATE_NULL); gst_element_set_state (udpsrc, GST_STATE_NULL);
gst_check_drop_buffers ();
gst_check_teardown_pad_by_name (udpsrc, "src"); gst_check_teardown_pad_by_name (udpsrc, "src");
gst_check_teardown_element (udpsrc); gst_check_teardown_element (udpsrc);
@ -222,6 +223,7 @@ send_failure:
gst_element_set_state (udpsrc, GST_STATE_NULL); gst_element_set_state (udpsrc, GST_STATE_NULL);
gst_check_drop_buffers ();
gst_check_teardown_pad_by_name (udpsrc, "src"); gst_check_teardown_pad_by_name (udpsrc, "src");
gst_check_teardown_element (udpsrc); gst_check_teardown_element (udpsrc);