Top | ![]() |
![]() |
![]() |
![]() |
These macros and functions are for internal use of the unit tests found inside the 'check' directories of various GStreamer packages.
#define fail_unless_equals_int(a, b)
This macro checks that a
and b
are equal and aborts if this is not the
case, printing both expressions and the values they evaluated to. This
macro is for use in unit tests.
#define fail_unless_equals_float(a, b)
This macro checks that a
and b
are (almost) equal and aborts if this
is not the case, printing both expressions and the values they evaluated
to. This macro is for use in unit tests.
Since 0.10.14
#define fail_unless_equals_string(a, b)
This macro checks that a
and b
are equal (as per strcmp) and aborts if
this is not the case, printing both expressions and the values they
evaluated to. This macro is for use in unit tests.
#define fail_unless_equals_uint64(a, b)
This macro checks that a
and b
are equal and aborts if this is not the
case, printing both expressions and the values they evaluated to. This
macro is for use in unit tests.
#define assert_equals_int(a, b) fail_unless_equals_int(a, b)
This macro checks that a
and b
are equal and aborts if this is not the
case, printing both expressions and the values they evaluated to. This
macro is for use in unit tests.
#define assert_equals_float(a, b) fail_unless_equals_float(a, b)
This macro checks that a
and b
are (almost) equal and aborts if this
is not the case, printing both expressions and the values they evaluated
to. This macro is for use in unit tests.
Since 0.10.14
#define assert_equals_string(a, b) fail_unless_equals_string(a, b)
This macro checks that a
and b
are equal (as per strcmp) and aborts if
this is not the case, printing both expressions and the values they
evaluated to. This macro is for use in unit tests.
#define assert_equals_uint64(a, b) fail_unless_equals_uint64(a, b)
This macro checks that a
and b
are equal and aborts if this is not the
case, printing both expressions and the values they evaluated to. This
macro is for use in unit tests.
void gst_check_message_error (GstMessage *message
,GstMessageType type
,GQuark domain
,gint code
);
GstPad * gst_check_setup_sink_pad (GstElement *element
,GstStaticPadTemplate *tmpl
,GstCaps *caps
);
GstPad * gst_check_setup_src_pad (GstElement *element
,GstStaticPadTemplate *tmpl
,GstCaps *caps
);
GstPad * gst_check_setup_sink_pad_by_name (GstElement *element
,GstStaticPadTemplate *tmpl
,const gchar *name
);
GstPad * gst_check_setup_src_pad_by_name (GstElement *element
,GstStaticPadTemplate *tmpl
,const gchar *name
);
void gst_check_teardown_pad_by_name (GstElement *element
,const gchar *name
);
void
gst_check_drop_buffers (void
);
Unref and remove all buffers that are in the global buffers
GList,
emptying the list.
Since 0.10.18
void gst_check_caps_equal (GstCaps *caps1
,GstCaps *caps2
);
Compare two caps with gst_caps_is_equal and fail unless they are equal.
Since 0.10.18
void gst_check_element_push_buffer_list (const gchar *element_name
,GList *buffer_in
,GList *buffer_out
,GstFlowReturn last_flow_return
);
Create an element
with the factory with the name and push the buffers in
buffer_in
to this element. The element should create the buffers equal to
the buffers in buffer_out
. We only check the caps, size and the data of the
buffers. This function unrefs the buffers in the two lists.
The last_flow_return parameter indicates the expected flow return value from
pushing the final buffer in the list.
This can be used to set up a test which pushes some buffers and then an
invalid buffer, when the final buffer is expected to fail, for example.
element_name |
name of the element that needs to be created |
|
buffer_in |
a list of buffers that needs to be puched to the element |
|
buffer_out |
a list of buffers that we expect from the element |
|
last_flow_return |
the last buffer push needs to give this GstFlowReturn |
Since 0.10.18
void gst_check_element_push_buffer (const gchar *element_name
,GstBuffer *buffer_in
,GstBuffer *buffer_out
);
Create an element
with the factory with the name and push the
buffer_in
to this element. The element should create one buffer
and this will be compared with buffer_out
. We only check the caps
and the data of the buffers. This function unrefs the buffers.
element_name |
name of the element that needs to be created |
|
buffer_in |
push this buffer to the element |
|
buffer_out |
compare the result with this buffer |
Since 0.10.18