mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
add a uint64 checking method
Original commit message from CVS: add a uint64 checking method
This commit is contained in:
parent
46bb10ac37
commit
9ef5832ec0
4 changed files with 34 additions and 4 deletions
|
@ -138,12 +138,15 @@ gst_check_teardown_element (GstElement * element)
|
|||
gst_object_unref (element);
|
||||
}
|
||||
|
||||
/* FIXME: set_caps isn't that useful
|
||||
*/
|
||||
GstPad *
|
||||
gst_check_setup_src_pad (GstElement * element,
|
||||
GstStaticPadTemplate * srctemplate, GstCaps * caps)
|
||||
{
|
||||
GstPad *srcpad, *sinkpad;
|
||||
|
||||
GST_DEBUG_OBJECT (element, "setting up sending pad");
|
||||
/* sending pad */
|
||||
srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (srctemplate),
|
||||
|
@ -155,7 +158,7 @@ gst_check_setup_src_pad (GstElement * element,
|
|||
fail_if (sinkpad == NULL, "Could not get sink pad from %s",
|
||||
GST_ELEMENT_NAME (element));
|
||||
ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
|
||||
gst_pad_set_caps (srcpad, caps);
|
||||
fail_unless (gst_pad_set_caps (srcpad, caps));
|
||||
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
|
||||
"Could not link source and %s sink pads", GST_ELEMENT_NAME (element));
|
||||
gst_object_unref (sinkpad); /* because we got it higher up */
|
||||
|
@ -187,12 +190,15 @@ gst_check_teardown_src_pad (GstElement * element)
|
|||
gst_object_unref (srcpad);
|
||||
}
|
||||
|
||||
/* FIXME: set_caps isn't that useful; might want to check if fixed,
|
||||
* then use set_use_fixed or somesuch */
|
||||
GstPad *
|
||||
gst_check_setup_sink_pad (GstElement * element, GstStaticPadTemplate * template,
|
||||
GstCaps * caps)
|
||||
{
|
||||
GstPad *srcpad, *sinkpad;
|
||||
|
||||
GST_DEBUG_OBJECT (element, "setting up receiving pad");
|
||||
/* receiving pad */
|
||||
sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (template),
|
||||
|
@ -202,7 +208,7 @@ gst_check_setup_sink_pad (GstElement * element, GstStaticPadTemplate * template,
|
|||
srcpad = gst_element_get_pad (element, "src");
|
||||
fail_if (srcpad == NULL, "Could not get source pad from %s",
|
||||
GST_ELEMENT_NAME (element));
|
||||
gst_pad_set_caps (sinkpad, caps);
|
||||
fail_unless (gst_pad_set_caps (sinkpad, caps));
|
||||
gst_pad_set_chain_function (sinkpad, gst_check_chain_func);
|
||||
|
||||
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
|
||||
|
|
|
@ -86,6 +86,15 @@ G_STMT_START { \
|
|||
"'" #a "' (%d) is not equal to '" #b"' (%d)", first, second); \
|
||||
} G_STMT_END;
|
||||
|
||||
#define fail_unless_equals_uint64(a, b) \
|
||||
G_STMT_START { \
|
||||
guint64 first = a; \
|
||||
guint64 second = b; \
|
||||
fail_unless(first == second, \
|
||||
"'" #a "' (%" G_GUINT64_FORMAT ") is not equal to '" #b"' (%" \
|
||||
G_GUINT64_FORMAT ")", first, second); \
|
||||
} G_STMT_END;
|
||||
|
||||
#define fail_unless_equals_string(a, b) \
|
||||
G_STMT_START { \
|
||||
gchar * first = a; \
|
||||
|
|
|
@ -138,12 +138,15 @@ gst_check_teardown_element (GstElement * element)
|
|||
gst_object_unref (element);
|
||||
}
|
||||
|
||||
/* FIXME: set_caps isn't that useful
|
||||
*/
|
||||
GstPad *
|
||||
gst_check_setup_src_pad (GstElement * element,
|
||||
GstStaticPadTemplate * srctemplate, GstCaps * caps)
|
||||
{
|
||||
GstPad *srcpad, *sinkpad;
|
||||
|
||||
GST_DEBUG_OBJECT (element, "setting up sending pad");
|
||||
/* sending pad */
|
||||
srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (srctemplate),
|
||||
|
@ -155,7 +158,7 @@ gst_check_setup_src_pad (GstElement * element,
|
|||
fail_if (sinkpad == NULL, "Could not get sink pad from %s",
|
||||
GST_ELEMENT_NAME (element));
|
||||
ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
|
||||
gst_pad_set_caps (srcpad, caps);
|
||||
fail_unless (gst_pad_set_caps (srcpad, caps));
|
||||
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
|
||||
"Could not link source and %s sink pads", GST_ELEMENT_NAME (element));
|
||||
gst_object_unref (sinkpad); /* because we got it higher up */
|
||||
|
@ -187,12 +190,15 @@ gst_check_teardown_src_pad (GstElement * element)
|
|||
gst_object_unref (srcpad);
|
||||
}
|
||||
|
||||
/* FIXME: set_caps isn't that useful; might want to check if fixed,
|
||||
* then use set_use_fixed or somesuch */
|
||||
GstPad *
|
||||
gst_check_setup_sink_pad (GstElement * element, GstStaticPadTemplate * template,
|
||||
GstCaps * caps)
|
||||
{
|
||||
GstPad *srcpad, *sinkpad;
|
||||
|
||||
GST_DEBUG_OBJECT (element, "setting up receiving pad");
|
||||
/* receiving pad */
|
||||
sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get (template),
|
||||
|
@ -202,7 +208,7 @@ gst_check_setup_sink_pad (GstElement * element, GstStaticPadTemplate * template,
|
|||
srcpad = gst_element_get_pad (element, "src");
|
||||
fail_if (srcpad == NULL, "Could not get source pad from %s",
|
||||
GST_ELEMENT_NAME (element));
|
||||
gst_pad_set_caps (sinkpad, caps);
|
||||
fail_unless (gst_pad_set_caps (sinkpad, caps));
|
||||
gst_pad_set_chain_function (sinkpad, gst_check_chain_func);
|
||||
|
||||
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
|
||||
|
|
|
@ -86,6 +86,15 @@ G_STMT_START { \
|
|||
"'" #a "' (%d) is not equal to '" #b"' (%d)", first, second); \
|
||||
} G_STMT_END;
|
||||
|
||||
#define fail_unless_equals_uint64(a, b) \
|
||||
G_STMT_START { \
|
||||
guint64 first = a; \
|
||||
guint64 second = b; \
|
||||
fail_unless(first == second, \
|
||||
"'" #a "' (%" G_GUINT64_FORMAT ") is not equal to '" #b"' (%" \
|
||||
G_GUINT64_FORMAT ")", first, second); \
|
||||
} G_STMT_END;
|
||||
|
||||
#define fail_unless_equals_string(a, b) \
|
||||
G_STMT_START { \
|
||||
gchar * first = a; \
|
||||
|
|
Loading…
Reference in a new issue