mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
tests/check/gst/gstquery.c: Added another check.
Original commit message from CVS: * tests/check/gst/gstquery.c: (GST_START_TEST): Added another check.
This commit is contained in:
parent
a225c1ed41
commit
70e4214ebf
2 changed files with 26 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2006-02-17 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* tests/check/gst/gstquery.c: (GST_START_TEST):
|
||||||
|
Added another check.
|
||||||
|
|
||||||
2006-02-15 Tim-Philipp Müller <tim at centricular dot net>
|
2006-02-15 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* plugins/elements/gsttypefindelement.c: (find_peek):
|
* plugins/elements/gsttypefindelement.c: (find_peek):
|
||||||
|
|
|
@ -86,14 +86,17 @@ GST_START_TEST (create_queries)
|
||||||
fail_if (query == NULL);
|
fail_if (query == NULL);
|
||||||
fail_unless (GST_QUERY_TYPE (query) == GST_QUERY_FORMATS);
|
fail_unless (GST_QUERY_TYPE (query) == GST_QUERY_FORMATS);
|
||||||
|
|
||||||
|
/* empty */
|
||||||
gst_query_parse_formats_length (query, &size);
|
gst_query_parse_formats_length (query, &size);
|
||||||
fail_if (size != 0);
|
fail_if (size != 0);
|
||||||
|
|
||||||
|
/* see if empty gives undefined formats */
|
||||||
gst_query_parse_formats_nth (query, 0, &format);
|
gst_query_parse_formats_nth (query, 0, &format);
|
||||||
fail_if (format != GST_FORMAT_UNDEFINED);
|
fail_if (format != GST_FORMAT_UNDEFINED);
|
||||||
gst_query_parse_formats_nth (query, 1, &format);
|
gst_query_parse_formats_nth (query, 1, &format);
|
||||||
fail_if (format != GST_FORMAT_UNDEFINED);
|
fail_if (format != GST_FORMAT_UNDEFINED);
|
||||||
|
|
||||||
|
/* set 2 formats */
|
||||||
gst_query_set_formats (query, 2, GST_FORMAT_TIME, GST_FORMAT_BYTES);
|
gst_query_set_formats (query, 2, GST_FORMAT_TIME, GST_FORMAT_BYTES);
|
||||||
|
|
||||||
gst_query_parse_formats_length (query, &size);
|
gst_query_parse_formats_length (query, &size);
|
||||||
|
@ -110,6 +113,7 @@ GST_START_TEST (create_queries)
|
||||||
gst_query_parse_formats_nth (query, 2, &format);
|
gst_query_parse_formats_nth (query, 2, &format);
|
||||||
fail_if (format != GST_FORMAT_UNDEFINED);
|
fail_if (format != GST_FORMAT_UNDEFINED);
|
||||||
|
|
||||||
|
/* overwrite with 3 formats */
|
||||||
gst_query_set_formats (query, 3, GST_FORMAT_TIME, GST_FORMAT_BYTES,
|
gst_query_set_formats (query, 3, GST_FORMAT_TIME, GST_FORMAT_BYTES,
|
||||||
GST_FORMAT_PERCENT);
|
GST_FORMAT_PERCENT);
|
||||||
|
|
||||||
|
@ -119,6 +123,23 @@ GST_START_TEST (create_queries)
|
||||||
gst_query_parse_formats_nth (query, 2, &format);
|
gst_query_parse_formats_nth (query, 2, &format);
|
||||||
fail_if (format != GST_FORMAT_PERCENT);
|
fail_if (format != GST_FORMAT_PERCENT);
|
||||||
|
|
||||||
|
/* create one from an array */
|
||||||
|
{
|
||||||
|
static GstFormat formats[] = {
|
||||||
|
GST_FORMAT_TIME,
|
||||||
|
GST_FORMAT_BYTES,
|
||||||
|
GST_FORMAT_PERCENT
|
||||||
|
};
|
||||||
|
gst_query_set_formatsv (query, 3, formats);
|
||||||
|
|
||||||
|
gst_query_parse_formats_length (query, &size);
|
||||||
|
fail_if (size != 3);
|
||||||
|
|
||||||
|
gst_query_parse_formats_nth (query, 0, &format);
|
||||||
|
fail_if (format != GST_FORMAT_TIME);
|
||||||
|
gst_query_parse_formats_nth (query, 2, &format);
|
||||||
|
fail_if (format != GST_FORMAT_PERCENT);
|
||||||
|
}
|
||||||
gst_query_unref (query);
|
gst_query_unref (query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue