tests/check/pipelines/theoraenc.c: Turn these functions into macros so we can see right away where the failure occured.

Original commit message from CVS:
* tests/check/pipelines/theoraenc.c: (check_buffer_is_header),
(check_buffer_timestamp), (check_buffer_duration):
Turn these functions into macros so we can see right away
where the failure occured.
This commit is contained in:
Tim-Philipp Müller 2008-01-06 14:39:19 +00:00
parent 54f25e1158
commit 38a7abe545
2 changed files with 23 additions and 24 deletions

View file

@ -1,3 +1,10 @@
2008-01-06 Tim-Philipp Müller <tim at centricular dot net>
* tests/check/pipelines/theoraenc.c: (check_buffer_is_header),
(check_buffer_timestamp), (check_buffer_duration):
Turn these functions into macros so we can see right away
where the failure occured.
2008-01-05 Julien Moutte <julien@fluendo.com>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new): Add

View file

@ -31,32 +31,24 @@
/* I know all of these have a shift of 6 bits */
#define GRANULEPOS_SHIFT 6
static void
check_buffer_is_header (GstBuffer * buffer, gboolean is_header)
{
fail_unless (GST_BUFFER_FLAG_IS_SET (buffer,
GST_BUFFER_FLAG_IN_CAPS) == is_header,
"GST_BUFFER_IN_CAPS is set to %d but expected %d",
GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_IN_CAPS), is_header);
}
static void
check_buffer_timestamp (GstBuffer * buffer, GstClockTime timestamp)
{
fail_unless (GST_BUFFER_TIMESTAMP (buffer) == timestamp,
"expected timestamp %" GST_TIME_FORMAT
", but got timestamp %" GST_TIME_FORMAT,
GST_TIME_ARGS (timestamp), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)));
}
#define check_buffer_is_header(buffer,is_header) \
fail_unless (GST_BUFFER_FLAG_IS_SET (buffer, \
GST_BUFFER_FLAG_IN_CAPS) == is_header, \
"GST_BUFFER_IN_CAPS is set to %d but expected %d", \
GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_IN_CAPS), is_header)
static void
check_buffer_duration (GstBuffer * buffer, GstClockTime duration)
{
fail_unless (GST_BUFFER_DURATION (buffer) == duration,
"expected duration %" GST_TIME_FORMAT
", but got duration %" GST_TIME_FORMAT,
GST_TIME_ARGS (duration), GST_TIME_ARGS (GST_BUFFER_DURATION (buffer)));
}
#define check_buffer_timestamp(buffer,timestamp) \
fail_unless (GST_BUFFER_TIMESTAMP (buffer) == timestamp, \
"expected timestamp %" GST_TIME_FORMAT \
", but got timestamp %" GST_TIME_FORMAT, \
GST_TIME_ARGS (timestamp), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)))
#define check_buffer_duration(buffer,duration) \
fail_unless (GST_BUFFER_DURATION (buffer) == duration, \
"expected duration %" GST_TIME_FORMAT \
", but got duration %" GST_TIME_FORMAT, \
GST_TIME_ARGS (duration), GST_TIME_ARGS (GST_BUFFER_DURATION (buffer)))
static void
check_buffer_granulepos (GstBuffer * buffer, gint64 granulepos)