summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2013-03-13 00:25:48 +0000
committerTim-Philipp Müller <tim@centricular.net>2013-03-13 00:40:42 +0000
commitae3313df2ce547b77c3ca8d73a6e34b374f05953 (patch)
tree44cbf8aee901ec1cbc29a9bb5d5f1b6feaf07748 /tests
parentc66fd54e78fbc777e928ad82d6cb5064676ab7ea (diff)
downloadgstreamer-plugins-bad-ae3313df2ce547b77c3ca8d73a6e34b374f05953.tar.gz
tests: fix up mpegtsmux unit test after collectpads change
It was passing expected flow returns (which might be negative) in the buffer timestamp field, which was maybe not the best idea.
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/mpegtsmux.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/check/elements/mpegtsmux.c b/tests/check/elements/mpegtsmux.c
index ccc09311d..7c979bd6f 100644
--- a/tests/check/elements/mpegtsmux.c
+++ b/tests/check/elements/mpegtsmux.c
@@ -620,13 +620,16 @@ GST_START_TEST (test_force_key_unit_event_upstream)
GST_END_TEST;
+static GstFlowReturn expected_flow;
+
static GstFlowReturn
flow_test_stat_chain_func (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
- /* the requested status is conveyed in the timestamp */
- GstFlowReturn ret = (GstFlowReturn) GST_BUFFER_TIMESTAMP (buffer);
gst_buffer_unref (buffer);
- return ret;
+
+ GST_INFO ("returning flow %s (%d)", gst_flow_get_name (expected_flow),
+ expected_flow);
+ return expected_flow;
}
GST_START_TEST (test_propagate_flow_status)
@@ -662,12 +665,15 @@ GST_START_TEST (test_propagate_flow_status)
inbuffer = gst_buffer_new_and_alloc (1);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
- /* convey the requested status in the timestamp */
- GST_BUFFER_TIMESTAMP (inbuffer) = expected[i];
+ expected_flow = expected[i];
+ GST_INFO ("expecting flow %s (%d)", gst_flow_get_name (expected_flow),
+ expected_flow);
+
+ GST_BUFFER_TIMESTAMP (inbuffer) = i * GST_SECOND;
+
res = gst_pad_push (mysrcpad, inbuffer);
- fail_unless (res == expected[i],
- "result: %d, expected: %d", res, expected[i]);
+ fail_unless_equals_int (res, expected[i]);
}
cleanup_tsmux (mux, padname);
@@ -716,7 +722,8 @@ GST_START_TEST (test_multiple_state_change)
inbuffer = gst_buffer_new_and_alloc (1);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
- GST_BUFFER_TIMESTAMP (inbuffer) = GST_FLOW_OK;
+ expected_flow = GST_FLOW_OK;
+ GST_BUFFER_PTS (inbuffer) = 0;
fail_unless (GST_FLOW_OK == gst_pad_push (mysrcpad, inbuffer));
}
}