[0.11] gstreamer: check: add macro to check for memory refcount

Wim Taymans wtay at kemper.freedesktop.org
Thu Jan 5 04:11:52 PST 2012


Module: gstreamer
Branch: 0.11
Commit: ad659abe8efbdfb15df921952059f8c6b17e9e5e
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=ad659abe8efbdfb15df921952059f8c6b17e9e5e

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Thu Jan  5 13:09:29 2012 +0100

check: add macro to check for memory refcount

---

 libs/gst/check/gstcheck.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libs/gst/check/gstcheck.h b/libs/gst/check/gstcheck.h
index 84f2347..c0d349f 100644
--- a/libs/gst/check/gstcheck.h
+++ b/libs/gst/check/gstcheck.h
@@ -488,6 +488,14 @@ G_STMT_START {                                                          \
 #define ASSERT_BUFFER_REFCOUNT(buffer, name, value)             \
         ASSERT_MINI_OBJECT_REFCOUNT(buffer, name, value)
 
+#define ASSERT_MEMORY_REFCOUNT(memory, name, value)             \
+G_STMT_START {                                                  \
+  int rc;                                                       \
+  rc = memory->refcount;                                        \
+  fail_unless (rc == value,                                     \
+               name " (%p) refcount is %d instead of %d", memory, rc, value); \
+} G_STMT_END
+
 #define ASSERT_MINI_OBJECT_REFCOUNT(miniobj, name, value)       \
 G_STMT_START {                                                  \
   int rc;                                                       \



More information about the gstreamer-commits mailing list