mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
check/gst/gstbin.c: since we don't know when preroll is done, use refcount range check for the sink
Original commit message from CVS: * check/gst/gstbin.c: (GST_START_TEST): since we don't know when preroll is done, use refcount range check for the sink * gst/check/gstcheck.h: add macro for checking refcount range
This commit is contained in:
parent
9e6c98a9e6
commit
d961ea4c93
5 changed files with 48 additions and 22 deletions
|
@ -1,3 +1,11 @@
|
|||
2005-08-22 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* check/gst/gstbin.c: (GST_START_TEST):
|
||||
since we don't know when preroll is done, use refcount range
|
||||
check for the sink
|
||||
* gst/check/gstcheck.h:
|
||||
add macro for checking refcount range
|
||||
|
||||
2005-08-21 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* check/Makefile.am:
|
||||
|
|
|
@ -269,12 +269,10 @@ GST_START_TEST (test_message_state_changed_children)
|
|||
fail_unless (gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING)
|
||||
== GST_STATE_SUCCESS);
|
||||
|
||||
/* each object is referenced by one message; sink still has an extra
|
||||
* because it's still blocked on preroll */
|
||||
/* FIXME: dual-CPU or HT machines seem to unblock from preroll after popping
|
||||
*/
|
||||
/* each object is referenced by one message
|
||||
* sink might have an extra reference if it's still blocked on preroll */
|
||||
ASSERT_OBJECT_REFCOUNT (src, "src", 2);
|
||||
//ASSERT_OBJECT_REFCOUNT (sink, "sink", 3);
|
||||
ASSERT_OBJECT_REFCOUNT_BETWEEN (sink, "sink", 2, 3);
|
||||
ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline", 2);
|
||||
|
||||
pop_messages (bus, 3);
|
||||
|
@ -282,15 +280,11 @@ GST_START_TEST (test_message_state_changed_children)
|
|||
|
||||
ASSERT_OBJECT_REFCOUNT (bus, "bus", 1);
|
||||
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
|
||||
/* FIXME: dual-CPU or HT machines seem to unblock from preroll after popping
|
||||
*/
|
||||
//ASSERT_OBJECT_REFCOUNT (sink, "sink", 2);
|
||||
/* sink might have an extra reference if it's still blocked on preroll */
|
||||
ASSERT_OBJECT_REFCOUNT_BETWEEN (sink, "sink", 1, 2);
|
||||
ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline", 1);
|
||||
|
||||
/* go back to READY, spawning six messages */
|
||||
/* FIXME: only now does the sink get unblocked from preroll
|
||||
* (check log for "done preroll")
|
||||
* mabe that's a bug ? */
|
||||
GST_DEBUG ("setting pipeline to READY");
|
||||
fail_unless (gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY)
|
||||
== GST_STATE_SUCCESS);
|
||||
|
|
|
@ -207,6 +207,21 @@ G_STMT_START { \
|
|||
name, object, rc, value); \
|
||||
} G_STMT_END
|
||||
|
||||
#define ASSERT_OBJECT_REFCOUNT_BETWEEN(object, name, lower, upper) \
|
||||
G_STMT_START { \
|
||||
int rc = GST_OBJECT_REFCOUNT_VALUE (object); \
|
||||
int lo = lower; \
|
||||
int hi = upper; \
|
||||
\
|
||||
fail_unless (rc >= lo, \
|
||||
"%s (%p) refcount %d is smaller than %d", \
|
||||
name, object, rc, lo); \
|
||||
fail_unless (rc <= hi, \
|
||||
"%s (%p) refcount %d is bigger than %d", \
|
||||
name, object, rc, hi); \
|
||||
} G_STMT_END
|
||||
|
||||
|
||||
#define ASSERT_CAPS_REFCOUNT(caps, name, value) \
|
||||
ASSERT_MINI_OBJECT_REFCOUNT(caps, name, value)
|
||||
|
||||
|
|
|
@ -207,6 +207,21 @@ G_STMT_START { \
|
|||
name, object, rc, value); \
|
||||
} G_STMT_END
|
||||
|
||||
#define ASSERT_OBJECT_REFCOUNT_BETWEEN(object, name, lower, upper) \
|
||||
G_STMT_START { \
|
||||
int rc = GST_OBJECT_REFCOUNT_VALUE (object); \
|
||||
int lo = lower; \
|
||||
int hi = upper; \
|
||||
\
|
||||
fail_unless (rc >= lo, \
|
||||
"%s (%p) refcount %d is smaller than %d", \
|
||||
name, object, rc, lo); \
|
||||
fail_unless (rc <= hi, \
|
||||
"%s (%p) refcount %d is bigger than %d", \
|
||||
name, object, rc, hi); \
|
||||
} G_STMT_END
|
||||
|
||||
|
||||
#define ASSERT_CAPS_REFCOUNT(caps, name, value) \
|
||||
ASSERT_MINI_OBJECT_REFCOUNT(caps, name, value)
|
||||
|
||||
|
|
|
@ -269,12 +269,10 @@ GST_START_TEST (test_message_state_changed_children)
|
|||
fail_unless (gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING)
|
||||
== GST_STATE_SUCCESS);
|
||||
|
||||
/* each object is referenced by one message; sink still has an extra
|
||||
* because it's still blocked on preroll */
|
||||
/* FIXME: dual-CPU or HT machines seem to unblock from preroll after popping
|
||||
*/
|
||||
/* each object is referenced by one message
|
||||
* sink might have an extra reference if it's still blocked on preroll */
|
||||
ASSERT_OBJECT_REFCOUNT (src, "src", 2);
|
||||
//ASSERT_OBJECT_REFCOUNT (sink, "sink", 3);
|
||||
ASSERT_OBJECT_REFCOUNT_BETWEEN (sink, "sink", 2, 3);
|
||||
ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline", 2);
|
||||
|
||||
pop_messages (bus, 3);
|
||||
|
@ -282,15 +280,11 @@ GST_START_TEST (test_message_state_changed_children)
|
|||
|
||||
ASSERT_OBJECT_REFCOUNT (bus, "bus", 1);
|
||||
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
|
||||
/* FIXME: dual-CPU or HT machines seem to unblock from preroll after popping
|
||||
*/
|
||||
//ASSERT_OBJECT_REFCOUNT (sink, "sink", 2);
|
||||
/* sink might have an extra reference if it's still blocked on preroll */
|
||||
ASSERT_OBJECT_REFCOUNT_BETWEEN (sink, "sink", 1, 2);
|
||||
ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline", 1);
|
||||
|
||||
/* go back to READY, spawning six messages */
|
||||
/* FIXME: only now does the sink get unblocked from preroll
|
||||
* (check log for "done preroll")
|
||||
* mabe that's a bug ? */
|
||||
GST_DEBUG ("setting pipeline to READY");
|
||||
fail_unless (gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY)
|
||||
== GST_STATE_SUCCESS);
|
||||
|
|
Loading…
Reference in a new issue