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
parent 9e6c98a9
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment