diff options
author | Edward Hervey <edward.hervey@collabora.co.uk> | 2011-01-31 16:05:15 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2011-02-09 11:01:12 +0100 |
commit | 07767da07a7f26b77bae2d73d59875e23f4b8037 (patch) | |
tree | 8b2c613c7fa5c7ca77cdfbd67732c24e9cfe7a45 | |
parent | d37d1c163e7ab02bbf069eba8656d7ab43ab9690 (diff) |
tests: Add a method for checking element states
-rw-r--r-- | tests/check/gnl/common.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/check/gnl/common.h b/tests/check/gnl/common.h index f0c9fb2..987c9eb 100644 --- a/tests/check/gnl/common.h +++ b/tests/check/gnl/common.h | |||
@@ -22,6 +22,16 @@ G_STMT_START { \ | |||
22 | GST_DEBUG_OBJECT (object, "start/stop/duration values valid"); \ | 22 | GST_DEBUG_OBJECT (object, "start/stop/duration values valid"); \ |
23 | } G_STMT_END; | 23 | } G_STMT_END; |
24 | 24 | ||
25 | #define check_state_simple(object, expected_state) \ | ||
26 | G_STMT_START { \ | ||
27 | GstStateChangeReturn ret; \ | ||
28 | GstState state, pending; \ | ||
29 | ret = gst_element_get_state(GST_ELEMENT_CAST(object), &state, &pending, 5 * GST_SECOND); \ | ||
30 | fail_if (ret == GST_STATE_CHANGE_FAILURE); \ | ||
31 | fail_unless (state == expected_state, "Element state (%s) is not the expected one (%s)", \ | ||
32 | gst_element_state_get_name(state), gst_element_state_get_name(expected_state)); \ | ||
33 | } G_STMT_END; | ||
34 | |||
25 | typedef struct _Segment { | 35 | typedef struct _Segment { |
26 | gdouble rate; | 36 | gdouble rate; |
27 | GstFormat format; | 37 | GstFormat format; |