tests: fix unit-tests for new stream-status

Fix the unit-tests so that they don't fail on the new stream-status messages
that are emited now.
This commit is contained in:
Wim Taymans 2009-04-21 15:25:12 +02:00 committed by Wim Taymans
parent 540560a758
commit 2efaf65c4c
3 changed files with 13 additions and 10 deletions

View file

@ -300,8 +300,9 @@ GST_START_TEST (test_message_state_changed_children)
/* each object is referenced by a message; /* each object is referenced by a message;
* base_src is blocked in the push and has an extra refcount. * base_src is blocked in the push and has an extra refcount.
* base_sink_chain has taken a refcount on the sink, and is blocked on * base_sink_chain has taken a refcount on the sink, and is blocked on
* preroll */ * preroll
ASSERT_OBJECT_REFCOUNT (src, "src", 2); * The stream-status message holds another ref to the element */
ASSERT_OBJECT_REFCOUNT (src, "src", 3);
/* refcount can be 4 if the bin is still processing the async_done message of /* refcount can be 4 if the bin is still processing the async_done message of
* the sink. */ * the sink. */
ASSERT_OBJECT_REFCOUNT_BETWEEN (sink, "sink", 2, 3); ASSERT_OBJECT_REFCOUNT_BETWEEN (sink, "sink", 2, 3);
@ -352,8 +353,9 @@ GST_START_TEST (test_message_state_changed_children)
ret = gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY); ret = gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY);
fail_unless (ret == GST_STATE_CHANGE_SUCCESS); fail_unless (ret == GST_STATE_CHANGE_SUCCESS);
/* each object is referenced by two messages */ /* each object is referenced by two messages, the source also has the
ASSERT_OBJECT_REFCOUNT (src, "src", 3); * stream-status message referencing it */
ASSERT_OBJECT_REFCOUNT (src, "src", 4);
ASSERT_OBJECT_REFCOUNT (sink, "sink", 3); ASSERT_OBJECT_REFCOUNT (sink, "sink", 3);
ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline", 3); ASSERT_OBJECT_REFCOUNT (pipeline, "pipeline", 3);

View file

@ -91,7 +91,7 @@ GST_START_TEST (test_pipeline_unref)
run_pipeline (pipeline, s, run_pipeline (pipeline, s,
GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED | GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_EOS); GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_EOS);
while (GST_OBJECT_REFCOUNT_VALUE (src) > 1) while (GST_OBJECT_REFCOUNT_VALUE (src) > 1)
THREAD_SWITCH (); THREAD_SWITCH ();
ASSERT_OBJECT_REFCOUNT (src, "src", 1); ASSERT_OBJECT_REFCOUNT (src, "src", 1);

View file

@ -102,27 +102,28 @@ GST_START_TEST (test_2_elements)
s = "fakesrc can-activate-push=false ! fakesink can-activate-pull=true"; s = "fakesrc can-activate-push=false ! fakesink can-activate-pull=true";
run_pipeline (setup_pipeline (s), s, run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED | GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_UNKNOWN); GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_UNKNOWN);
s = "fakesrc can-activate-push=true ! fakesink can-activate-pull=false"; s = "fakesrc can-activate-push=true ! fakesink can-activate-pull=false";
run_pipeline (setup_pipeline (s), s, run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED | GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_UNKNOWN); GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_UNKNOWN);
s = "fakesrc can-activate-push=false num-buffers=10 ! fakesink can-activate-pull=true"; s = "fakesrc can-activate-push=false num-buffers=10 ! fakesink can-activate-pull=true";
run_pipeline (setup_pipeline (s), s, run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED | GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_EOS); GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_EOS);
s = "fakesrc can-activate-push=true num-buffers=10 ! fakesink can-activate-pull=false"; s = "fakesrc can-activate-push=true num-buffers=10 ! fakesink can-activate-pull=false";
run_pipeline (setup_pipeline (s), s, run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED | GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_EOS); GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_EOS);
s = "fakesrc can-activate-push=false ! fakesink can-activate-pull=false"; s = "fakesrc can-activate-push=false ! fakesink can-activate-pull=false";
ASSERT_CRITICAL (run_pipeline (setup_pipeline (s), s, ASSERT_CRITICAL (run_pipeline (setup_pipeline (s), s,
GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED | GST_MESSAGE_NEW_CLOCK | GST_MESSAGE_STATE_CHANGED |
GST_MESSAGE_ASYNC_DONE, GST_MESSAGE_UNKNOWN)); GST_MESSAGE_STREAM_STATUS | GST_MESSAGE_ASYNC_DONE,
GST_MESSAGE_UNKNOWN));
} }
GST_END_TEST; GST_END_TEST;