gst-plugins-good: tests: fix autodetect test not testing correctly for state change success

Vincent Penquerc'h vincent at kemper.freedesktop.org
Mon Jan 16 08:12:47 PST 2012


Module: gst-plugins-good
Branch: master
Commit: e9e0bebde3ef6c4e55ac3fe621f249946a4fb0d9
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=e9e0bebde3ef6c4e55ac3fe621f249946a4fb0d9

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Mon Jan 16 16:10:08 2012 +0000

tests: fix autodetect test not testing correctly for state change success

State change to PAUSED can be done async, so if this happens, we need
to wait for the change to be done (or failed).

---

 tests/check/elements/autodetect.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tests/check/elements/autodetect.c b/tests/check/elements/autodetect.c
index 0eb798b..21f9bb5 100644
--- a/tests/check/elements/autodetect.c
+++ b/tests/check/elements/autodetect.c
@@ -62,6 +62,12 @@ GST_START_TEST (test_autovideosink_ghostpad_error_case)
 
   /* this should fail, there's no such format */
   state_ret = gst_element_set_state (pipeline, GST_STATE_PAUSED);
+  if (state_ret == GST_STATE_CHANGE_ASYNC) {
+    /* make sure we wait for the actual success/failure to happen */
+    GstState state;
+    state_ret =
+        gst_element_get_state (pipeline, &state, &state, GST_CLOCK_TIME_NONE);
+  }
   fail_unless (state_ret == GST_STATE_CHANGE_FAILURE,
       "pipeline _set_state() to PAUSED succeeded but should have failed");
 



More information about the gstreamer-commits mailing list