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:
Thomas Vander Stichele 2005-08-22 09:25:51 +00:00
parent 9e6c98a9e6
commit d961ea4c93
5 changed files with 48 additions and 22 deletions

View file

@ -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:

View file

@ -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);

View file

@ -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)

View file

@ -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)

View file

@ -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);