summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward.hervey@collabora.co.uk>2011-01-31 15:05:15 (GMT)
committerEdward Hervey <bilboed@bilboed.com>2011-02-09 10:01:12 (GMT)
commit07767da07a7f26b77bae2d73d59875e23f4b8037 (patch)
tree8b2c613c7fa5c7ca77cdfbd67732c24e9cfe7a45
parentd37d1c163e7ab02bbf069eba8656d7ab43ab9690 (diff)
tests: Add a method for checking element states
-rw-r--r--tests/check/gnl/common.h10
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 { \
GST_DEBUG_OBJECT (object, "start/stop/duration values valid"); \
} G_STMT_END;
+#define check_state_simple(object, expected_state) \
+ G_STMT_START { \
+ GstStateChangeReturn ret; \
+ GstState state, pending; \
+ ret = gst_element_get_state(GST_ELEMENT_CAST(object), &state, &pending, 5 * GST_SECOND); \
+ fail_if (ret == GST_STATE_CHANGE_FAILURE); \
+ fail_unless (state == expected_state, "Element state (%s) is not the expected one (%s)", \
+ gst_element_state_get_name(state), gst_element_state_get_name(expected_state)); \
+ } G_STMT_END;
+
typedef struct _Segment {
gdouble rate;
GstFormat format;