gst-plugins-bad: tests: fix buffer leaks in opus tests

Vincent Penquerc'h vincent at kemper.freedesktop.org
Wed Jan 11 05:35:52 PST 2012


Module: gst-plugins-bad
Branch: master
Commit: 750cc41994230e745e0fa027d9d18101b1f91f0c
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=750cc41994230e745e0fa027d9d18101b1f91f0c

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Wed Jan 11 13:32:36 2012 +0000

tests: fix buffer leaks in opus tests

---

 tests/check/elements/opus.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/check/elements/opus.c b/tests/check/elements/opus.c
index 66c12a3..d18f623 100644
--- a/tests/check/elements/opus.c
+++ b/tests/check/elements/opus.c
@@ -110,7 +110,7 @@ cleanup_opusenc (GstElement * opusenc)
 }
 
 static void
-check_buffers (guint expected, gboolean headers_in_caps)
+check_buffers (guint expected)
 {
   GstBuffer *outbuffer;
   guint i, num_buffers;
@@ -152,7 +152,7 @@ GST_START_TEST (test_opus_id_header)
   /* ... and nothing ends up on the global buffer list */
   ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
   gst_buffer_unref (inbuffer);
-  fail_unless (g_list_length (buffers) == 0);
+  check_buffers (0);
 
   /* cleanup */
   cleanup_opusdec (opusdec);
@@ -248,7 +248,7 @@ GST_START_TEST (test_opus_encode_samples)
       "could not set to ready");
 
   /* default frame size is 20 ms, at 48000 Hz that's 960 samples */
-  check_buffers ((nsamples + 959) / 960, FALSE);
+  check_buffers ((nsamples + 959) / 960);
 
   /* cleanup */
   cleanup_opusenc (opusenc);
@@ -331,6 +331,8 @@ GST_START_TEST (test_opus_encode_properties)
     /* change random parameters */
     g_object_set (opusenc, param_changes[step].param, param_changes[step].value,
         NULL);
+
+    check_buffers (1);
   }
 
   gst_caps_unref (caps);



More information about the gstreamer-commits mailing list