# GstCheck

These macros and functions are for internal use of the unit tests found inside the 'check' directories of various GStreamer packages.

One notable feature is that one can use the environment variables GST_CHECKS and GST_CHECKS_IGNORE to select which tests to run or skip. Both variables can contain a comma separated list of test name globs (e.g. test_*).

## GstCheckABIStruct

### Members

`name` (const char*) –

The name of the structure

`size` (int) –

The current size of a structure

`abi_size` (int) –

The reference size of the structure

## GstCheck.CheckABIStruct

### Members

`name` (String) –

The name of the structure

`size` (Number) –

The current size of a structure

`abi_size` (Number) –

The reference size of the structure

## GstCheck.CheckABIStruct

### Members

`name` (str) –

The name of the structure

`size` (int) –

The current size of a structure

`abi_size` (int) –

The reference size of the structure

## GstCheckLogFilter

Opaque structure containing data about a log filter function.

## GstCheck.CheckLogFilter

Opaque structure containing data about a log filter function.

## GstCheck.CheckLogFilter

Opaque structure containing data about a log filter function.

## Functions

### gst_check_abi_list

    gst_check_abi_list (GstCheckABIStruct * list,
                        gboolean have_abi_sizes)

Verifies that reference values and current values are equals in list.

Parameters:

`list` –

A list of GstCheckABIStruct to be verified

`have_abi_sizes` –

Whether there is a reference ABI size already specified, if it is FALSE and the `GST_ABI` environment variable is set, usable code for list will be printed.

### GstCheck.prototype.check_abi_list

    function GstCheck.prototype.check_abi_list(list: GstCheck.CheckABIStruct, have_abi_sizes: Number): {
        // javascript wrapper for 'gst_check_abi_list'
    }

Verifies that reference values and current values are equals in list.

Parameters:

`list` (GstCheck.CheckABIStruct) –

A list of GstCheckABIStruct to be verified

`have_abi_sizes` (Number) –

Whether there is a reference ABI size already specified, if it is FALSE and the `GST_ABI` environment variable is set, usable code for list will be printed.

### GstCheck.check_abi_list

    def GstCheck.check_abi_list (list, have_abi_sizes):
        #python wrapper for 'gst_check_abi_list'

Verifies that reference values and current values are equals in list.

Parameters:

`list` (GstCheck.CheckABIStruct) –

A list of GstCheckABIStruct to be verified

`have_abi_sizes` (bool) –

Whether there is a reference ABI size already specified, if it is FALSE and the `GST_ABI` environment variable is set, usable code for list will be printed.

### gst_check_add_log_filter

    GstCheckLogFilter *
    gst_check_add_log_filter (const gchar* log_domain,
                              GLogLevelFlags log_level,
                              GRegex * regex,
                              GstCheckLogFilterFunc func,
                              gpointer user_data,
                              GDestroyNotify destroy_data)

Add a callback func to be called for all log messages that matches log_domain, log_level and regex. If func is NULL the matching logs will be silently discarded by GstCheck.

MT safe.

Parameters:

`log_domain` –

the log domain of the message

`log_level` –

the log level of the message

`regex` ( [transfer: full]) –

a GRegex to match the message

`func` –

the function to call for matching messages

`user_data` –

the user data to pass to func

`destroy_data` –

GDestroyNotify for user_data

Returns –

A filter that can be passed to gst_check_remove_log_filter.

Since : 1.12

### gst_check_buffer_data

    gst_check_buffer_data (GstBuffer * buffer,
                           gconstpointer data,
                           gsize size)

Compare the buffer contents with data and size.

Parameters:

`buffer` –

buffer to compare

`data` –

data to compare to

`size` –

size of data to compare

### GstCheck.prototype.check_buffer_data

    function GstCheck.prototype.check_buffer_data(buffer: Gst.Buffer, data: Object, size: Number): {
        // javascript wrapper for 'gst_check_buffer_data'
    }

Compare the buffer contents with data and size.

Parameters:

`buffer` (Gst.Buffer) –

buffer to compare

`data` (Object) –

data to compare to

`size` (Number) –

size of data to compare

### GstCheck.check_buffer_data

    def GstCheck.check_buffer_data (buffer, data, size):
        #python wrapper for 'gst_check_buffer_data'

Compare the buffer contents with data and size.

Parameters:

`buffer` (Gst.Buffer) –

buffer to compare

`data` (object) –

data to compare to

`size` (int) –

size of data to compare

### gst_check_caps_equal

    gst_check_caps_equal (GstCaps * caps1,
                          GstCaps * caps2)

Compare two caps with gst_caps_is_equal and fail unless they are equal.

Parameters:

`caps1` –

first caps to compare

`caps2` –

second caps to compare

### GstCheck.prototype.check_caps_equal

    function GstCheck.prototype.check_caps_equal(caps1: Gst.Caps, caps2: Gst.Caps): {
        // javascript wrapper for 'gst_check_caps_equal'
    }

Compare two caps with gst_caps_is_equal and fail unless they are equal.

Parameters:

`caps1` (Gst.Caps) –

first caps to compare

`caps2` (Gst.Caps) –

second caps to compare

### GstCheck.check_caps_equal

    def GstCheck.check_caps_equal (caps1, caps2):
        #python wrapper for 'gst_check_caps_equal'

Compare two caps with gst_caps_is_equal and fail unless they are equal.

Parameters:

`caps1` (Gst.Caps) –

first caps to compare

`caps2` (Gst.Caps) –

second caps to compare

### gst_check_chain_func

    GstFlowReturn
    gst_check_chain_func (GstPad * pad,
                          GstObject * parent,
                          GstBuffer * buffer)

A fake chain function that appends the buffer to the internal list of buffers.

Parameters:

`pad` –
No description available
`parent` –
No description available
`buffer` –
No description available
Returns –
No description available

### GstCheck.prototype.check_chain_func

    function GstCheck.prototype.check_chain_func(pad: Gst.Pad, parent: Gst.Object, buffer: Gst.Buffer): {
        // javascript wrapper for 'gst_check_chain_func'
    }

A fake chain function that appends the buffer to the internal list of buffers.

Parameters:

`pad` (Gst.Pad) –
No description available
`parent` (Gst.Object) –
No description available
`buffer` (Gst.Buffer) –
No description available
Returns (Gst.FlowReturn) –
No description available

### GstCheck.check_chain_func

    def GstCheck.check_chain_func (pad, parent, buffer):
        #python wrapper for 'gst_check_chain_func'

A fake chain function that appends the buffer to the internal list of buffers.

Parameters:

`pad` (Gst.Pad) –
No description available
`parent` (Gst.Object) –
No description available
`buffer` (Gst.Buffer) –
No description available
Returns (Gst.FlowReturn) –
No description available

### gst_check_clear_log_filter

    gst_check_clear_log_filter ()

Clear all filters added by gst_check_add_log_filter.

MT safe.

Since : 1.12

### GstCheck.prototype.check_clear_log_filter

    function GstCheck.prototype.check_clear_log_filter(): {
        // javascript wrapper for 'gst_check_clear_log_filter'
    }

Clear all filters added by gst_check_add_log_filter.

MT safe.

Since : 1.12

### GstCheck.check_clear_log_filter

    def GstCheck.check_clear_log_filter ():
        #python wrapper for 'gst_check_clear_log_filter'

Clear all filters added by gst_check_add_log_filter.

MT safe.

Since : 1.12

### gst_check_drop_buffers

    gst_check_drop_buffers ()

Unref and remove all buffers that are in the global buffers GList, emptying the list.

### GstCheck.prototype.check_drop_buffers

    function GstCheck.prototype.check_drop_buffers(): {
        // javascript wrapper for 'gst_check_drop_buffers'
    }

Unref and remove all buffers that are in the global buffers GList, emptying the list.

### GstCheck.check_drop_buffers

    def GstCheck.check_drop_buffers ():
        #python wrapper for 'gst_check_drop_buffers'

Unref and remove all buffers that are in the global buffers GList, emptying the list.

### gst_check_element_push_buffer

    gst_check_element_push_buffer (const gchar* element_name,
                                   GstBuffer * buffer_in,
                                   GstCaps * caps_in,
                                   GstBuffer * buffer_out,
                                   GstCaps * caps_out)

Create an element using the factory providing the element_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.

Parameters:

`element_name` –

name of the element that needs to be created

`buffer_in` –

push this buffer to the element

`caps_in` –

the GstCaps expected of the sinkpad of the element

`buffer_out` –

compare the result with this buffer

`caps_out` –

the GstCaps expected of the srcpad of the element

### GstCheck.prototype.check_element_push_buffer

    function GstCheck.prototype.check_element_push_buffer(element_name: String, buffer_in: Gst.Buffer, caps_in: Gst.Caps, buffer_out: Gst.Buffer, caps_out: Gst.Caps): {
        // javascript wrapper for 'gst_check_element_push_buffer'
    }

Create an element using the factory providing the element_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.

Parameters:

`element_name` (String) –

name of the element that needs to be created

`buffer_in` (Gst.Buffer) –

push this buffer to the element

`caps_in` (Gst.Caps) –

the Gst.Caps expected of the sinkpad of the element

`buffer_out` (Gst.Buffer) –

compare the result with this buffer

`caps_out` (Gst.Caps) –

the Gst.Caps expected of the srcpad of the element

### GstCheck.check_element_push_buffer

    def GstCheck.check_element_push_buffer (element_name, buffer_in, caps_in, buffer_out, caps_out):
        #python wrapper for 'gst_check_element_push_buffer'

Create an element using the factory providing the element_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.

Parameters:

`element_name` (str) –

name of the element that needs to be created

`buffer_in` (Gst.Buffer) –

push this buffer to the element

`caps_in` (Gst.Caps) –

the Gst.Caps expected of the sinkpad of the element

`buffer_out` (Gst.Buffer) –

compare the result with this buffer

`caps_out` (Gst.Caps) –

the Gst.Caps expected of the srcpad of the element

### gst_check_element_push_buffer_list

    gst_check_element_push_buffer_list (const gchar* element_name,
                                        GList * buffer_in,
                                        GstCaps * caps_in,
                                        GList * buffer_out,
                                        GstCaps * caps_out,
                                        GstFlowReturn last_flow_return)

Create an element using the factory providing the element_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 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.

Parameters:

`element_name` –

name of the element that needs to be created

`buffer_in` ( [element-typeGstBuffer][transfer: full]) –

a list of buffers that needs to be pushed to the element

`caps_in` –

the GstCaps expected of the sinkpad of the element

`buffer_out` ( [element-typeGstBuffer][transfer: full]) –

a list of buffers that we expect from the element

`caps_out` –

the GstCaps expected of the srcpad of the element

`last_flow_return` –

the last buffer push needs to give this GstFlowReturn

### GstCheck.prototype.check_element_push_buffer_list

    function GstCheck.prototype.check_element_push_buffer_list(element_name: String, buffer_in: [ Gst.Buffer ], caps_in: Gst.Caps, buffer_out: [ Gst.Buffer ], caps_out: Gst.Caps, last_flow_return: Gst.FlowReturn): {
        // javascript wrapper for 'gst_check_element_push_buffer_list'
    }

Create an element using the factory providing the element_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 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.

Parameters:

`element_name` (String) –

name of the element that needs to be created

`buffer_in` ([ Gst.Buffer ]) –

a list of buffers that needs to be pushed to the element

`caps_in` (Gst.Caps) –

the Gst.Caps expected of the sinkpad of the element

`buffer_out` ([ Gst.Buffer ]) –

a list of buffers that we expect from the element

`caps_out` (Gst.Caps) –

the Gst.Caps expected of the srcpad of the element

`last_flow_return` (Gst.FlowReturn) –

the last buffer push needs to give this GstFlowReturn

### GstCheck.check_element_push_buffer_list

    def GstCheck.check_element_push_buffer_list (element_name, buffer_in, caps_in, buffer_out, caps_out, last_flow_return):
        #python wrapper for 'gst_check_element_push_buffer_list'

Create an element using the factory providing the element_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 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.

Parameters:

`element_name` (str) –

name of the element that needs to be created

`buffer_in` ([ Gst.Buffer ]) –

a list of buffers that needs to be pushed to the element

`caps_in` (Gst.Caps) –

the Gst.Caps expected of the sinkpad of the element

`buffer_out` ([ Gst.Buffer ]) –

a list of buffers that we expect from the element

`caps_out` (Gst.Caps) –

the Gst.Caps expected of the srcpad of the element

`last_flow_return` (Gst.FlowReturn) –

the last buffer push needs to give this GstFlowReturn

### gst_check_init

    gst_check_init (int* argc,
                    char*** argv)

Parameters:

`argc` –
No description available
`argv` –
No description available

### GstCheck.prototype.check_init

    function GstCheck.prototype.check_init(argc: Number, argv: String): {
        // javascript wrapper for 'gst_check_init'
    }

Parameters:

`argc` (Number) –
No description available
`argv` (String) –
No description available

### GstCheck.check_init

    def GstCheck.check_init (argc, argv):
        #python wrapper for 'gst_check_init'

Parameters:

`argc` (int) –
No description available
`argv` (str) –
No description available

### gst_check_message_error

    gst_check_message_error (GstMessage * message,
                             GstMessageType type,
                             GQuark domain,
                             gint code)

Parameters:

`message` –
No description available
`type` –
No description available
`domain` –
No description available
`code` –
No description available

### GstCheck.prototype.check_message_error

    function GstCheck.prototype.check_message_error(message: Gst.Message, type: Gst.MessageType, domain: GLib.Quark, code: Number): {
        // javascript wrapper for 'gst_check_message_error'
    }

Parameters:

`message` (Gst.Message) –
No description available
`type` (Gst.MessageType) –
No description available
`domain` (GLib.Quark) –
No description available
`code` (Number) –
No description available

### GstCheck.check_message_error

    def GstCheck.check_message_error (message, type, domain, code):
        #python wrapper for 'gst_check_message_error'

Parameters:

`message` (Gst.Message) –
No description available
`type` (Gst.MessageType) –
No description available
`domain` (GLib.Quark) –
No description available
`code` (int) –
No description available

### gst_check_object_destroyed_on_unref

    gst_check_object_destroyed_on_unref (gpointer object_to_unref)

Unrefs object_to_unref and checks that is has properly been destroyed.

Parameters:

`object_to_unref` –

The GObject to unref

Since : 1.6

### GstCheck.prototype.check_object_destroyed_on_unref

    function GstCheck.prototype.check_object_destroyed_on_unref(object_to_unref: Object): {
        // javascript wrapper for 'gst_check_object_destroyed_on_unref'
    }

Unrefs object_to_unref and checks that is has properly been destroyed.

Parameters:

`object_to_unref` (Object) –

The GObject.Object to unref

Since : 1.6

### GstCheck.check_object_destroyed_on_unref

    def GstCheck.check_object_destroyed_on_unref (object_to_unref):
        #python wrapper for 'gst_check_object_destroyed_on_unref'

Unrefs object_to_unref and checks that is has properly been destroyed.

Parameters:

`object_to_unref` (object) –

The GObject.Object to unref

Since : 1.6

### gst_check_objects_destroyed_on_unref

    gst_check_objects_destroyed_on_unref (gpointer object_to_unref,
                                          gpointer first_object,
                                          ... ...)

Unrefs object_to_unref and checks that is has properly been destroyed, also checks that the other objects passed in parameter have been destroyed as a concequence of unrefing object_to_unref. Last variable argument should be NULL.

Parameters:

`object_to_unref` –

The GObject to unref

`first_object` ( [allow-none]) –

The first object that should be destroyed as a concequence of unrefing object_to_unref.

`...` –

Additional object that should have been destroyed.

Since : 1.6

### gst_check_remove_log_filter

    gst_check_remove_log_filter (GstCheckLogFilter * filter)

Remove a filter that has been added by gst_check_add_log_filter.

MT safe.

Parameters:

`filter` –

Filter returned by gst_check_add_log_filter

Since : 1.12

### GstCheck.prototype.check_remove_log_filter

    function GstCheck.prototype.check_remove_log_filter(filter: GstCheck.CheckLogFilter): {
        // javascript wrapper for 'gst_check_remove_log_filter'
    }

Remove a filter that has been added by gst_check_add_log_filter.

MT safe.

Parameters:

`filter` (GstCheck.CheckLogFilter) –

Filter returned by gst_check_add_log_filter

Since : 1.12

### GstCheck.check_remove_log_filter

    def GstCheck.check_remove_log_filter (filter):
        #python wrapper for 'gst_check_remove_log_filter'

Remove a filter that has been added by gst_check_add_log_filter.

MT safe.

Parameters:

`filter` (GstCheck.CheckLogFilter) –

Filter returned by gst_check_add_log_filter

Since : 1.12

### gst_check_run_suite

    gint
    gst_check_run_suite (Suite* suite,
                         const gchar* name,
                         const gchar* fname)

Parameters:

`suite` –

the check test suite

`name` –

name

`fname` –

file name

Returns –

number of failed tests

### gst_check_setup_element

    GstElement *
    gst_check_setup_element (const gchar* factory)

setup an element for a filter test with mysrcpad and mysinkpad

Parameters:

`factory` –

factory

Returns ( [transfer: full]) –

a new element

### GstCheck.prototype.check_setup_element

    function GstCheck.prototype.check_setup_element(factory: String): {
        // javascript wrapper for 'gst_check_setup_element'
    }

setup an element for a filter test with mysrcpad and mysinkpad

Parameters:

`factory` (String) –

factory

Returns (Gst.Element) –

a new element

### GstCheck.check_setup_element

    def GstCheck.check_setup_element (factory):
        #python wrapper for 'gst_check_setup_element'

setup an element for a filter test with mysrcpad and mysinkpad

Parameters:

`factory` (str) –

factory

Returns (Gst.Element) –

a new element

### gst_check_setup_events

    gst_check_setup_events (GstPad * srcpad,
                            GstElement * element,
                            GstCaps * caps,
                            GstFormat format)

Push stream-start, caps and segment event, which consist of the minimum required events to allow streaming. Caps is optional to allow raw src testing. If element has more than one src or sink pad, use gst_check_setup_events_with_stream_id instead.

Parameters:

`srcpad` –

The src GstPad to push on

`element` –

The GstElement use to create the stream id

`caps` ( [allow-none]) –

GstCaps in case caps event must be sent

`format` –

The GstFormat of the default segment to send

### GstCheck.prototype.check_setup_events

    function GstCheck.prototype.check_setup_events(srcpad: Gst.Pad, element: Gst.Element, caps: Gst.Caps, format: Gst.Format): {
        // javascript wrapper for 'gst_check_setup_events'
    }

Push stream-start, caps and segment event, which consist of the minimum required events to allow streaming. Caps is optional to allow raw src testing. If element has more than one src or sink pad, use GstCheck.prototype.check_setup_events_with_stream_id instead.

Parameters:

`srcpad` (Gst.Pad) –

The src Gst.Pad to push on

`element` (Gst.Element) –

The Gst.Element use to create the stream id

`caps` (Gst.Caps) –

Gst.Caps in case caps event must be sent

`format` (Gst.Format) –

The Gst.Format of the default segment to send

### GstCheck.check_setup_events

    def GstCheck.check_setup_events (srcpad, element, caps, format):
        #python wrapper for 'gst_check_setup_events'

Push stream-start, caps and segment event, which consist of the minimum required events to allow streaming. Caps is optional to allow raw src testing. If element has more than one src or sink pad, use GstCheck.check_setup_events_with_stream_id instead.

Parameters:

`srcpad` (Gst.Pad) –

The src Gst.Pad to push on

`element` (Gst.Element) –

The Gst.Element use to create the stream id

`caps` (Gst.Caps) –

Gst.Caps in case caps event must be sent

`format` (Gst.Format) –

The Gst.Format of the default segment to send

### gst_check_setup_events_with_stream_id

    gst_check_setup_events_with_stream_id (GstPad * srcpad,
                                           GstElement * element,
                                           GstCaps * caps,
                                           GstFormat format,
                                           const gchar* stream_id)

Push stream-start, caps and segment event, which consist of the minimum required events to allow streaming. Caps is optional to allow raw src testing.

Parameters:

`srcpad` –

The src GstPad to push on

`element` –

The GstElement use to create the stream id

`caps` ( [allow-none]) –

GstCaps in case caps event must be sent

`format` –

The GstFormat of the default segment to send

`stream_id` –

A unique identifier for the stream

### GstCheck.prototype.check_setup_events_with_stream_id

    function GstCheck.prototype.check_setup_events_with_stream_id(srcpad: Gst.Pad, element: Gst.Element, caps: Gst.Caps, format: Gst.Format, stream_id: String): {
        // javascript wrapper for 'gst_check_setup_events_with_stream_id'
    }

Push stream-start, caps and segment event, which consist of the minimum required events to allow streaming. Caps is optional to allow raw src testing.

Parameters:

`srcpad` (Gst.Pad) –

The src Gst.Pad to push on

`element` (Gst.Element) –

The Gst.Element use to create the stream id

`caps` (Gst.Caps) –

Gst.Caps in case caps event must be sent

`format` (Gst.Format) –

The Gst.Format of the default segment to send

`stream_id` (String) –

A unique identifier for the stream

### GstCheck.check_setup_events_with_stream_id

    def GstCheck.check_setup_events_with_stream_id (srcpad, element, caps, format, stream_id):
        #python wrapper for 'gst_check_setup_events_with_stream_id'

Push stream-start, caps and segment event, which consist of the minimum required events to allow streaming. Caps is optional to allow raw src testing.

Parameters:

`srcpad` (Gst.Pad) –

The src Gst.Pad to push on

`element` (Gst.Element) –

The Gst.Element use to create the stream id

`caps` (Gst.Caps) –

Gst.Caps in case caps event must be sent

`format` (Gst.Format) –

The Gst.Format of the default segment to send

`stream_id` (str) –

A unique identifier for the stream

### gst_check_setup_sink_pad

    GstPad *
    gst_check_setup_sink_pad (GstElement * element,
                              GstStaticPadTemplate * tmpl)

Does the same as gst_check_setup_sink_pad_by_name with the name parameter equal to "src".

Parameters:

`element` –

element to setup pad on

`tmpl` –

pad template

Returns ( [transfer: full]) –

a new pad that can be used to check the output of element

### GstCheck.prototype.check_setup_sink_pad

    function GstCheck.prototype.check_setup_sink_pad(element: Gst.Element, tmpl: Gst.StaticPadTemplate): {
        // javascript wrapper for 'gst_check_setup_sink_pad'
    }

Does the same as GstCheck.prototype.check_setup_sink_pad_by_name with the name parameter equal to "src".

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.StaticPadTemplate) –

pad template

Returns (Gst.Pad) –

a new pad that can be used to check the output of element

### GstCheck.check_setup_sink_pad

    def GstCheck.check_setup_sink_pad (element, tmpl):
        #python wrapper for 'gst_check_setup_sink_pad'

Does the same as GstCheck.check_setup_sink_pad_by_name with the name parameter equal to "src".

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.StaticPadTemplate) –

pad template

Returns (Gst.Pad) –

a new pad that can be used to check the output of element

### gst_check_setup_sink_pad_by_name

    GstPad *
    gst_check_setup_sink_pad_by_name (GstElement * element,
                                      GstStaticPadTemplate * tmpl,
                                      const gchar* name)

Creates a new sink pad (based on the given tmpl) and links it to the given element src pad (the pad that matches the given name). You can set event/chain/query functions on this pad to check the output of the element.

Parameters:

`element` –

element to setup pad on

`tmpl` –

pad template

`name` –

Name of the element src pad that will be linked to the sink pad that will be setup

Returns ( [transfer: full]) –

a new pad that can be used to check the output of element

### GstCheck.prototype.check_setup_sink_pad_by_name

    function GstCheck.prototype.check_setup_sink_pad_by_name(element: Gst.Element, tmpl: Gst.StaticPadTemplate, name: String): {
        // javascript wrapper for 'gst_check_setup_sink_pad_by_name'
    }

Creates a new sink pad (based on the given tmpl) and links it to the given element src pad (the pad that matches the given name). You can set event/chain/query functions on this pad to check the output of the element.

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.StaticPadTemplate) –

pad template

`name` (String) –

Name of the element src pad that will be linked to the sink pad that will be setup

Returns (Gst.Pad) –

a new pad that can be used to check the output of element

### GstCheck.check_setup_sink_pad_by_name

    def GstCheck.check_setup_sink_pad_by_name (element, tmpl, name):
        #python wrapper for 'gst_check_setup_sink_pad_by_name'

Creates a new sink pad (based on the given tmpl) and links it to the given element src pad (the pad that matches the given name). You can set event/chain/query functions on this pad to check the output of the element.

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.StaticPadTemplate) –

pad template

`name` (str) –

Name of the element src pad that will be linked to the sink pad that will be setup

Returns (Gst.Pad) –

a new pad that can be used to check the output of element

### gst_check_setup_sink_pad_by_name_from_template

    GstPad *
    gst_check_setup_sink_pad_by_name_from_template (GstElement * element,
                                                    GstPadTemplate * tmpl,
                                                    const gchar* name)

Parameters:

`element` –

element to setup pad on

`tmpl` –

pad template

`name` –

name

Returns ( [transfer: full]) –

a new pad

Since : 1.4

### GstCheck.prototype.check_setup_sink_pad_by_name_from_template

    function GstCheck.prototype.check_setup_sink_pad_by_name_from_template(element: Gst.Element, tmpl: Gst.PadTemplate, name: String): {
        // javascript wrapper for 'gst_check_setup_sink_pad_by_name_from_template'
    }

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.PadTemplate) –

pad template

`name` (String) –

name

Returns (Gst.Pad) –

a new pad

Since : 1.4

### GstCheck.check_setup_sink_pad_by_name_from_template

    def GstCheck.check_setup_sink_pad_by_name_from_template (element, tmpl, name):
        #python wrapper for 'gst_check_setup_sink_pad_by_name_from_template'

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.PadTemplate) –

pad template

`name` (str) –

name

Returns (Gst.Pad) –

a new pad

Since : 1.4

### gst_check_setup_sink_pad_from_template

    GstPad *
    gst_check_setup_sink_pad_from_template (GstElement * element,
                                            GstPadTemplate * tmpl)

Parameters:

`element` –

element to setup pad on

`tmpl` –

pad template

Returns ( [transfer: full]) –

a new pad

Since : 1.4

### GstCheck.prototype.check_setup_sink_pad_from_template

    function GstCheck.prototype.check_setup_sink_pad_from_template(element: Gst.Element, tmpl: Gst.PadTemplate): {
        // javascript wrapper for 'gst_check_setup_sink_pad_from_template'
    }

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.PadTemplate) –

pad template

Returns (Gst.Pad) –

a new pad

Since : 1.4

### GstCheck.check_setup_sink_pad_from_template

    def GstCheck.check_setup_sink_pad_from_template (element, tmpl):
        #python wrapper for 'gst_check_setup_sink_pad_from_template'

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.PadTemplate) –

pad template

Returns (Gst.Pad) –

a new pad

Since : 1.4

### gst_check_setup_src_pad

    GstPad *
    gst_check_setup_src_pad (GstElement * element,
                             GstStaticPadTemplate * tmpl)

Does the same as gst_check_setup_src_pad_by_name with the name parameter equal to "sink".

Parameters:

`element` –

element to setup pad on

`tmpl` –

pad template

Returns ( [transfer: full]) –

A new pad that can be used to inject data on element

### GstCheck.prototype.check_setup_src_pad

    function GstCheck.prototype.check_setup_src_pad(element: Gst.Element, tmpl: Gst.StaticPadTemplate): {
        // javascript wrapper for 'gst_check_setup_src_pad'
    }

Does the same as GstCheck.prototype.check_setup_src_pad_by_name with the name parameter equal to "sink".

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.StaticPadTemplate) –

pad template

Returns (Gst.Pad) –

A new pad that can be used to inject data on element

### GstCheck.check_setup_src_pad

    def GstCheck.check_setup_src_pad (element, tmpl):
        #python wrapper for 'gst_check_setup_src_pad'

Does the same as GstCheck.check_setup_src_pad_by_name with the name parameter equal to "sink".

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.StaticPadTemplate) –

pad template

Returns (Gst.Pad) –

A new pad that can be used to inject data on element

### gst_check_setup_src_pad_by_name

    GstPad *
    gst_check_setup_src_pad_by_name (GstElement * element,
                                     GstStaticPadTemplate * tmpl,
                                     const gchar* name)

Creates a new src pad (based on the given tmpl) and links it to the given element sink pad (the pad that matches the given name). Before using the src pad to push data on element you need to call gst_check_setup_events on the created src pad.

Example of how to push a buffer on element:

     static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS (YOUR_CAPS_TEMPLATE_STRING)
     );
     static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS (YOUR_CAPS_TEMPLATE_STRING)
     );

     GstElement * element = gst_check_setup_element ("element");
     GstPad * mysrcpad = gst_check_setup_src_pad (element, &srctemplate);
     GstPad * mysinkpad = gst_check_setup_sink_pad (element, &sinktemplate);

     gst_pad_set_active (mysrcpad, TRUE);
     gst_pad_set_active (mysinkpad, TRUE);
     fail_unless (gst_element_set_state (element, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing");

     GstCaps * caps = gst_caps_from_string (YOUR_DESIRED_SINK_CAPS);
     gst_check_setup_events (mysrcpad, element, caps, GST_FORMAT_TIME);
     gst_caps_unref (caps);

     fail_unless (gst_pad_push (mysrcpad, gst_buffer_new_and_alloc(2)) == GST_FLOW_OK);

For very simple input/output test scenarios checkout gst_check_element_push_buffer_list and gst_check_element_push_buffer.

Parameters:

`element` –

element to setup src pad on

`tmpl` –

pad template

`name` –

Name of the element sink pad that will be linked to the src pad that will be setup

Returns ( [transfer: full]) –

A new pad that can be used to inject data on element

### GstCheck.prototype.check_setup_src_pad_by_name

    function GstCheck.prototype.check_setup_src_pad_by_name(element: Gst.Element, tmpl: Gst.StaticPadTemplate, name: String): {
        // javascript wrapper for 'gst_check_setup_src_pad_by_name'
    }

Creates a new src pad (based on the given tmpl) and links it to the given element sink pad (the pad that matches the given name). Before using the src pad to push data on element you need to call GstCheck.prototype.check_setup_events on the created src pad.

Example of how to push a buffer on element:

     static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS (YOUR_CAPS_TEMPLATE_STRING)
     );
     static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS (YOUR_CAPS_TEMPLATE_STRING)
     );

     GstElement * element = gst_check_setup_element ("element");
     GstPad * mysrcpad = gst_check_setup_src_pad (element, &srctemplate);
     GstPad * mysinkpad = gst_check_setup_sink_pad (element, &sinktemplate);

     gst_pad_set_active (mysrcpad, TRUE);
     gst_pad_set_active (mysinkpad, TRUE);
     fail_unless (gst_element_set_state (element, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing");

     GstCaps * caps = gst_caps_from_string (YOUR_DESIRED_SINK_CAPS);
     gst_check_setup_events (mysrcpad, element, caps, GST_FORMAT_TIME);
     gst_caps_unref (caps);

     fail_unless (gst_pad_push (mysrcpad, gst_buffer_new_and_alloc(2)) == GST_FLOW_OK);

For very simple input/output test scenarios checkout GstCheck.prototype.check_element_push_buffer_list and GstCheck.prototype.check_element_push_buffer.

Parameters:

`element` (Gst.Element) –

element to setup src pad on

`tmpl` (Gst.StaticPadTemplate) –

pad template

`name` (String) –

Name of the element sink pad that will be linked to the src pad that will be setup

Returns (Gst.Pad) –

A new pad that can be used to inject data on element

### GstCheck.check_setup_src_pad_by_name

    def GstCheck.check_setup_src_pad_by_name (element, tmpl, name):
        #python wrapper for 'gst_check_setup_src_pad_by_name'

Creates a new src pad (based on the given tmpl) and links it to the given element sink pad (the pad that matches the given name). Before using the src pad to push data on element you need to call GstCheck.check_setup_events on the created src pad.

Example of how to push a buffer on element:

     static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS (YOUR_CAPS_TEMPLATE_STRING)
     );
     static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS (YOUR_CAPS_TEMPLATE_STRING)
     );

     GstElement * element = gst_check_setup_element ("element");
     GstPad * mysrcpad = gst_check_setup_src_pad (element, &srctemplate);
     GstPad * mysinkpad = gst_check_setup_sink_pad (element, &sinktemplate);

     gst_pad_set_active (mysrcpad, TRUE);
     gst_pad_set_active (mysinkpad, TRUE);
     fail_unless (gst_element_set_state (element, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, "could not set to playing");

     GstCaps * caps = gst_caps_from_string (YOUR_DESIRED_SINK_CAPS);
     gst_check_setup_events (mysrcpad, element, caps, GST_FORMAT_TIME);
     gst_caps_unref (caps);

     fail_unless (gst_pad_push (mysrcpad, gst_buffer_new_and_alloc(2)) == GST_FLOW_OK);

For very simple input/output test scenarios checkout GstCheck.check_element_push_buffer_list and GstCheck.check_element_push_buffer.

Parameters:

`element` (Gst.Element) –

element to setup src pad on

`tmpl` (Gst.StaticPadTemplate) –

pad template

`name` (str) –

Name of the element sink pad that will be linked to the src pad that will be setup

Returns (Gst.Pad) –

A new pad that can be used to inject data on element

### gst_check_setup_src_pad_by_name_from_template

    GstPad *
    gst_check_setup_src_pad_by_name_from_template (GstElement * element,
                                                   GstPadTemplate * tmpl,
                                                   const gchar* name)

Parameters:

`element` –

element to setup pad on

`tmpl` –

pad template

`name` –

name

Returns ( [transfer: full]) –

a new pad

Since : 1.4

### GstCheck.prototype.check_setup_src_pad_by_name_from_template

    function GstCheck.prototype.check_setup_src_pad_by_name_from_template(element: Gst.Element, tmpl: Gst.PadTemplate, name: String): {
        // javascript wrapper for 'gst_check_setup_src_pad_by_name_from_template'
    }

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.PadTemplate) –

pad template

`name` (String) –

name

Returns (Gst.Pad) –

a new pad

Since : 1.4

### GstCheck.check_setup_src_pad_by_name_from_template

    def GstCheck.check_setup_src_pad_by_name_from_template (element, tmpl, name):
        #python wrapper for 'gst_check_setup_src_pad_by_name_from_template'

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.PadTemplate) –

pad template

`name` (str) –

name

Returns (Gst.Pad) –

a new pad

Since : 1.4

### gst_check_setup_src_pad_from_template

    GstPad *
    gst_check_setup_src_pad_from_template (GstElement * element,
                                           GstPadTemplate * tmpl)

Parameters:

`element` –

element to setup pad on

`tmpl` –

pad template

Returns ( [transfer: full]) –

a new pad

Since : 1.4

### GstCheck.prototype.check_setup_src_pad_from_template

    function GstCheck.prototype.check_setup_src_pad_from_template(element: Gst.Element, tmpl: Gst.PadTemplate): {
        // javascript wrapper for 'gst_check_setup_src_pad_from_template'
    }

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.PadTemplate) –

pad template

Returns (Gst.Pad) –

a new pad

Since : 1.4

### GstCheck.check_setup_src_pad_from_template

    def GstCheck.check_setup_src_pad_from_template (element, tmpl):
        #python wrapper for 'gst_check_setup_src_pad_from_template'

Parameters:

`element` (Gst.Element) –

element to setup pad on

`tmpl` (Gst.PadTemplate) –

pad template

Returns (Gst.Pad) –

a new pad

Since : 1.4

### gst_check_teardown_element

    gst_check_teardown_element (GstElement * element)

Parameters:

`element` –
No description available

### GstCheck.prototype.check_teardown_element

    function GstCheck.prototype.check_teardown_element(element: Gst.Element): {
        // javascript wrapper for 'gst_check_teardown_element'
    }

Parameters:

`element` (Gst.Element) –
No description available

### GstCheck.check_teardown_element

    def GstCheck.check_teardown_element (element):
        #python wrapper for 'gst_check_teardown_element'

Parameters:

`element` (Gst.Element) –
No description available

### gst_check_teardown_pad_by_name

    gst_check_teardown_pad_by_name (GstElement * element,
                                    const gchar* name)

Parameters:

`element` –
No description available
`name` –
No description available

### GstCheck.prototype.check_teardown_pad_by_name

    function GstCheck.prototype.check_teardown_pad_by_name(element: Gst.Element, name: String): {
        // javascript wrapper for 'gst_check_teardown_pad_by_name'
    }

Parameters:

`element` (Gst.Element) –
No description available
`name` (String) –
No description available

### GstCheck.check_teardown_pad_by_name

    def GstCheck.check_teardown_pad_by_name (element, name):
        #python wrapper for 'gst_check_teardown_pad_by_name'

Parameters:

`element` (Gst.Element) –
No description available
`name` (str) –
No description available

### gst_check_teardown_sink_pad

    gst_check_teardown_sink_pad (GstElement * element)

Parameters:

`element` –
No description available

### GstCheck.prototype.check_teardown_sink_pad

    function GstCheck.prototype.check_teardown_sink_pad(element: Gst.Element): {
        // javascript wrapper for 'gst_check_teardown_sink_pad'
    }

Parameters:

`element` (Gst.Element) –
No description available

### GstCheck.check_teardown_sink_pad

    def GstCheck.check_teardown_sink_pad (element):
        #python wrapper for 'gst_check_teardown_sink_pad'

Parameters:

`element` (Gst.Element) –
No description available

### gst_check_teardown_src_pad

    gst_check_teardown_src_pad (GstElement * element)

Parameters:

`element` –
No description available

### GstCheck.prototype.check_teardown_src_pad

    function GstCheck.prototype.check_teardown_src_pad(element: Gst.Element): {
        // javascript wrapper for 'gst_check_teardown_src_pad'
    }

Parameters:

`element` (Gst.Element) –
No description available

### GstCheck.check_teardown_src_pad

    def GstCheck.check_teardown_src_pad (element):
        #python wrapper for 'gst_check_teardown_src_pad'

Parameters:

`element` (Gst.Element) –
No description available

## Function Macros

### ASSERT_BUFFER_REFCOUNT

    #define ASSERT_BUFFER_REFCOUNT(buffer, name, value)             \
            ASSERT_MINI_OBJECT_REFCOUNT(buffer, name, value)

### ASSERT_CAPS_REFCOUNT

    #define ASSERT_CAPS_REFCOUNT(caps, name, value)                 \
            ASSERT_MINI_OBJECT_REFCOUNT(caps, name, value)

### ASSERT_CRITICAL

    #define ASSERT_CRITICAL(code)

### ASSERT_MINI_OBJECT_REFCOUNT

    #define ASSERT_MINI_OBJECT_REFCOUNT(miniobj, name, value)       \
    G_STMT_START {                                                  \
      int rc;                                                       \
      rc = GST_MINI_OBJECT_REFCOUNT_VALUE (miniobj);                \
      fail_unless (rc == value,                                     \
                   name " (%p) refcount is %d instead of %d", miniobj, rc, value); \
    } G_STMT_END

### ASSERT_OBJECT_REFCOUNT

    #define ASSERT_OBJECT_REFCOUNT(object, name, value)             \
    G_STMT_START {                                                  \
      int rc;                                                       \
      rc = GST_OBJECT_REFCOUNT_VALUE (object);                      \
      fail_unless (rc == value,                                     \
          "%s (%p) refcount is %d instead of %d",                   \
          name, object, rc, value);                                 \
    } G_STMT_END

### ASSERT_OBJECT_REFCOUNT_BETWEEN

    #define ASSERT_OBJECT_REFCOUNT_BETWEEN(object, name, lower, upper)      \
    G_STMT_START {                                                          \
      int rc = GST_OBJECT_REFCOUNT_VALUE (object);                          \
      int lo = lower;                                                       \
      int hi = upper;                                                       \
                                                                            \
      fail_unless (rc >= lo,                                                \
          "%s (%p) refcount %d is smaller than %d",                         \
          name, object, rc, lo);                                            \
      fail_unless (rc <= hi,                                                \
          "%s (%p) refcount %d is bigger than %d",                          \
          name, object, rc, hi);                                            \
    } G_STMT_END

### ASSERT_SET_STATE

    #define ASSERT_SET_STATE(element, state, ret)                   \
    fail_unless (gst_element_set_state (GST_ELEMENT(element),       \
      state) == ret,                                                \
      "could not change state to " #state);

### ASSERT_WARNING

    #define ASSERT_WARNING(code)                                    \
    G_STMT_START {                                                  \
      _gst_check_expecting_log = TRUE;                              \
      _gst_check_raised_warning = FALSE;                            \
      code;                                                         \
      if (!_gst_check_raised_warning)                               \
        _ck_assert_failed (__FILE__, __LINE__,                      \
            "Expected g_warning, got nothing", NULL);               \
      _gst_check_expecting_log = FALSE;                             \
    } G_STMT_END

### GST_CHECK_MAIN

    #define GST_CHECK_MAIN(name)                                    \
    int main (int argc, char **argv)                                \
    {                                                               \
      Suite *s;                                                     \
      gst_check_init (&argc, &argv);                                \
      s = name ## _suite ();                                        \
      return gst_check_run_suite (s, # name, __FILE__);             \
    }

### GST_START_TEST

    #define GST_START_TEST(__testname) \
    static void __testname (int G_GNUC_UNUSED __i__) \
    {\
      GST_DEBUG ("test start"); \
      GST_DO_CHECK_TEST_ENVIRONMENT; \
      tcase_fn_start (""# __testname, __FILE__, __LINE__);

wrapper for checks START_TEST

Parameters:

`__testname` –

test function name

### MAIN_INIT

    #define MAIN_INIT()                     \
    G_STMT_START {                          \
      g_mutex_init (&mutex);                \
      g_cond_init (&start_cond);            \
      g_cond_init (&sync_cond);             \
      _gst_check_threads_running = TRUE;    \
    } G_STMT_END;

### MAIN_START_THREADS

    #define MAIN_START_THREADS(count, function, data)               \
    MAIN_INIT();                                                    \
    MAIN_START_THREAD_FUNCTIONS(count, function, data);             \
    MAIN_SYNCHRONIZE();

### MAIN_START_THREAD_FUNCTION

    #define MAIN_START_THREAD_FUNCTION(i, function, data)           \
    G_STMT_START {                                                  \
        GThread *thread = NULL;                                     \
        GST_DEBUG ("MAIN: creating thread %d", i);                  \
        g_mutex_lock (&mutex);                                      \
        thread = g_thread_try_new ("gst-check",                     \
            (GThreadFunc) function, data, NULL);                    \
        /* wait for thread to signal us that it's ready */          \
        GST_DEBUG ("MAIN: waiting for thread %d", i);               \
        g_cond_wait (&start_cond, &mutex);                          \
        g_mutex_unlock (&mutex);                                    \
                                                                    \
        thread_list = g_list_append (thread_list, thread);          \
    } G_STMT_END;

### MAIN_START_THREAD_FUNCTIONS

    #define MAIN_START_THREAD_FUNCTIONS(count, function, data)      \
    G_STMT_START {                                                  \
      int i;                                                        \
      for (i = 0; i < count; ++i) {                                 \
        MAIN_START_THREAD_FUNCTION (i, function, data);             \
      }                                                             \
    } G_STMT_END;

### MAIN_STOP_THREADS

    #define MAIN_STOP_THREADS()                                     \
    G_STMT_START {                                                  \
      _gst_check_threads_running = FALSE;                           \
                                                                    \
      /* join all threads */                                        \
      GST_DEBUG ("MAIN: joining");                                  \
      g_list_foreach (thread_list, (GFunc) g_thread_join, NULL);    \
      g_list_free (thread_list);                                    \
      thread_list = NULL;                                           \
      g_mutex_clear (&mutex);                                       \
      g_cond_clear (&start_cond);                                   \
      g_cond_clear (&sync_cond);                                    \
      GST_DEBUG ("MAIN: joined");                                   \
    } G_STMT_END;

### MAIN_SYNCHRONIZE

    #define MAIN_SYNCHRONIZE()              \
    G_STMT_START {                          \
      GST_DEBUG ("MAIN: synchronizing");    \
      g_cond_broadcast (&sync_cond);        \
      GST_DEBUG ("MAIN: synchronized");     \
    } G_STMT_END;

### THREAD_START

    #define THREAD_START()                                          \
    THREAD_STARTED();                                               \
    THREAD_SYNCHRONIZE();

### THREAD_STARTED

    #define THREAD_STARTED()                                        \
    G_STMT_START {                                                  \
      /* signal main thread that we started */                      \
      GST_DEBUG ("THREAD %p: started", g_thread_self ());           \
      g_mutex_lock (&mutex);                                        \
      g_cond_signal (&start_cond);                                  \
    } G_STMT_END;

### THREAD_SWITCH

    #define THREAD_SWITCH()                                         \
    G_STMT_START {                                                  \
      g_thread_yield ();                                            \
    } G_STMT_END;

### THREAD_SYNCHRONIZE

    #define THREAD_SYNCHRONIZE()                                    \
    G_STMT_START {                                                  \
      /* synchronize everyone */                                    \
      GST_DEBUG ("THREAD %p: syncing", g_thread_self ());           \
      fail_if (g_mutex_trylock (&mutex),                            \
          "bug in unit test, mutex should be locked at this point");\
      g_cond_wait (&sync_cond, &mutex);                             \
      GST_DEBUG ("THREAD %p: synced", g_thread_self ());            \
      g_mutex_unlock (&mutex);                                      \
    } G_STMT_END;

### THREAD_TEST_RUNNING

    #define THREAD_TEST_RUNNING()   (!!_gst_check_threads_running)

### assert_equals_float

    #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.

Parameters:

`a` –

a gdouble or gfloat value or expression

`b` –

a gdouble or gfloat value or expression

### assert_equals_int

    #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.

Parameters:

`a` –

a gint value or expression

`b` –

a gint value or expression

### assert_equals_int64

    #define assert_equals_int64(a, b) fail_unless_equals_int64(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.

Parameters:

`a` –

a gint64 value or expression

`b` –

a gint64 value or expression

### assert_equals_int64_hex

    #define assert_equals_int64_hex(a,b) fail_unless_equals_int64_hex(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 in hexadecimal format. This macro is for use in unit tests.

Parameters:

`a` –

a gint64 value or expression

`b` –

a gint64 value or expression

Since : 1.2

### assert_equals_int_hex

    #define assert_equals_int_hex(a, b) fail_unless_equals_int_hex(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 in hexadecimal format. This macro is for use in unit tests.

Parameters:

`a` –

a gint value or expression

`b` –

a gint value or expression

Since : 1.2

### assert_equals_pointer

    #define assert_equals_pointer(a, b) fail_unless_equals_pointer(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.

Parameters:

`a` –

a pointer value or expression

`b` –

a pointer value or expression

Since : 1.2

### assert_equals_string

    #define assert_equals_string(a, b) fail_unless_equals_string(a, b)

This macro checks that a and b are equal (as per g_strcmp0) 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.

Parameters:

`a` –

a string literal or expression

`b` –

a string literal or expression

### assert_equals_uint64

    #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.

Parameters:

`a` –

a guint64 value or expression

`b` –

a guint64 value or expression

### assert_equals_uint64_hex

    #define assert_equals_uint64_hex(a,b) fail_unless_equals_uint64_hex(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 in hexadecimal format. This macro is for use in unit tests.

Parameters:

`a` –

a guint64 value or expression

`b` –

a guint64 value or expression

Since : 1.2

### assert_message_error

    #define assert_message_error(m, d, c) fail_unless_message_error(m, d, c)

### fail_unless_equals_clocktime

    #define fail_unless_equals_clocktime(a, b)                              \
    G_STMT_START {                                                          \
      GstClockTime first = a;                                                        \
      GstClockTime second = b;                                                       \
      fail_unless(first == second,                                          \
        "'" #a "' (%" GST_TIME_FORMAT") is not equal to '" #b"' (%" GST_TIME_FORMAT")", \
          GST_TIME_ARGS (first), GST_TIME_ARGS (second));       \
    } G_STMT_END;

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.

Parameters:

`a` –

a GstClockTime value or expression

`b` –

a GstClockTime value or expression

### fail_unless_equals_float

    #define fail_unless_equals_float(a, b)                            \
    G_STMT_START {                                                    \
      double first = a;                                               \
      double second = b;                                              \
      /* This will only work for 'normal' values and values around 0, \
       * which should be good enough for our purposes here */         \
      fail_unless(fabs (first - second) < 0.0000001,                  \
        "'" #a "' (%g) is not equal to '" #b "' (%g)", first, second);\
    } G_STMT_END;

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.

Parameters:

`a` –

a gdouble or gfloat value or expression

`b` –

a gdouble or gfloat value or expression

### fail_unless_equals_int

    #define fail_unless_equals_int(a, b)                                    \
    G_STMT_START {                                                          \
      int first = a;                                                        \
      int second = b;                                                       \
      fail_unless(first == second,                                          \
        "'" #a "' (%d) is not equal to '" #b"' (%d)", first, second);       \
    } G_STMT_END;

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.

Parameters:

`a` –

a gint value or expression

`b` –

a gint value or expression

### fail_unless_equals_int64

    #define fail_unless_equals_int64(a, b)                                  \
    G_STMT_START {                                                          \
      gint64 first = a;                                                     \
      gint64 second = b;                                                    \
      fail_unless(first == second,                                          \
        "'" #a "' (%" G_GINT64_FORMAT") is not equal to '" #b"' (%"         \
        G_GINT64_FORMAT")", first, second);                                 \
    } G_STMT_END;

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.

Parameters:

`a` –

a gint64 value or expression

`b` –

a gint64 value or expression

### fail_unless_equals_int64_hex

    #define fail_unless_equals_int64_hex(a, b)                              \
    G_STMT_START {								\
      gint64 first = a;							\
      gint64 second = b;							\
      fail_unless(first == second,						\
        "'" #a "' (0x%016x) is not equal to '" #b"' (0x%016x)", first, second);\
    } G_STMT_END;

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 in hexadecimal format. This macro is for use in unit tests.

Parameters:

`a` –

a gint64 value or expression

`b` –

a gint64 value or expression

Since : 1.2

### fail_unless_equals_int_hex

    #define fail_unless_equals_int_hex(a, b)                                \
    G_STMT_START {								\
      int first = a;							\
      int second = b;							\
      fail_unless(first == second,						\
        "'" #a "' (0x%08x) is not equal to '" #b"' (0x%08x)", first, second);\
    } G_STMT_END;

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 in hexadecimal format. This macro is for use in unit tests.

Parameters:

`a` –

a gint value or expression

`b` –

a gint value or expression

Since : 1.2

### fail_unless_equals_pointer

    #define fail_unless_equals_pointer(a, b)                          \
    G_STMT_START {                                                    \
      gpointer first = a;                                             \
      gpointer second = b;                                            \
      fail_unless(first == second,                                    \
        "'" #a "' (%p) is not equal to '" #b "' (%p)", first, second);\
    } G_STMT_END;

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.

Parameters:

`a` –

a pointer value or expression

`b` –

a pointer value or expression

Since : 1.2

### fail_unless_equals_string

    #define fail_unless_equals_string(a, b)                             \
    G_STMT_START {                                                      \
      const gchar * first = a;                                          \
      const gchar * second = b;                                         \
      fail_unless(g_strcmp0 (first, second) == 0,                          \
        "'" #a "' (%s) is not equal to '" #b"' (%s)", first, second);   \
    } G_STMT_END;

This macro checks that a and b are equal (as per g_strcmp0) 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.

Parameters:

`a` –

a string literal or expression

`b` –

a string literal or expression

### fail_unless_equals_uint64

    #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;

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.

Parameters:

`a` –

a guint64 value or expression

`b` –

a guint64 value or expression

### fail_unless_equals_uint64_hex

    #define fail_unless_equals_uint64_hex(a, b)                             \
    G_STMT_START {								\
      guint64 first = a;							\
      guint64 second = b;							\
      fail_unless(first == second,						\
        "'" #a "' (0x%016x) is not equal to '" #b"' (0x%016x)", first, second);\
    } G_STMT_END;

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 in hexadecimal format. This macro is for use in unit tests.

Parameters:

`a` –

a gint64 value or expression

`b` –

a gint64 value or expression

Since : 1.2

### fail_unless_message_error

    #define fail_unless_message_error(msg, domain, code)            \
    gst_check_message_error (msg, GST_MESSAGE_ERROR,                \
      GST_ ## domain ## _ERROR, GST_ ## domain ## _ERROR_ ## code)

### tcase_skip_broken_loop_test

    #define tcase_skip_broken_loop_test(chain,test_func,a,b)        \
      tcase_skip_broken_test (chain, test_func)

### tcase_skip_broken_test

    #define tcase_skip_broken_test(chain,test_func) \
    G_STMT_START {                                                  \
      const char *env = g_getenv ("GST_CHECKS");                    \
                                                                    \
      if (env != NULL && g_pattern_match_simple (env, G_STRINGIFY (test_func))) {   \
        tcase_add_test(chain,test_func);                            \
      } else {                                                      \
        g_printerr ("FIXME: skipping test %s because it's broken\n", G_STRINGIFY (test_func)); \
      } \
    } G_STMT_END

## Constants

### CK_DLL_EXP

    #define CK_DLL_EXP GST_CHECK_API

### GST_CAT_DEFAULT

    #define GST_CAT_DEFAULT check_debug

Default gstreamer core debug log category. Please define your own.

### GST_DO_CHECK_TEST_ENVIRONMENT

    #define GST_DO_CHECK_TEST_ENVIRONMENT \
    G_STMT_START {                        \
      if (g_getenv (GST_CHECK_TEST_ENVIRONMENT_BEACON) == NULL) \
        fail ("Test environment not set up correctly! Expected environment " \
           "variable '%s' to be set.", GST_CHECK_TEST_ENVIRONMENT_BEACON); \
    } G_STMT_END

### GST_END_TEST

    #define GST_END_TEST GST_LOG ("cleaning up tasks"); \
                         gst_task_cleanup_all (); \
                         END_TEST

wrapper for checks END_TEST

### _tcase_add_test

    #define _tcase_add_test __gst_tcase_add_test

## Callbacks

### GstCheckLogFilterFunc

    gboolean
    (*GstCheckLogFilterFunc) (const gchar* log_domain,
                              GLogLevelFlags log_level,
                              const gchar* message,
                              gpointer user_data)

A function that is called for messages matching the filter added by gst_check_add_log_filter.

Parameters:

`log_domain` –

the log domain of the message

`log_level` –

the log level of the message

`message` –

the message that has occurred

`user_data` –

user data

Returns –

TRUE if message should be discarded by GstCheck.

Since : 1.12

### GstCheck.CheckLogFilterFunc

    function GstCheck.CheckLogFilterFunc(log_domain: String, log_level: GLib.LogLevelFlags, message: String, user_data: Object): {
        // javascript wrapper for 'GstCheckLogFilterFunc'
    }

A function that is called for messages matching the filter added by gst_check_add_log_filter.

Parameters:

`log_domain` (String) –

the log domain of the message

`log_level` (GLib.LogLevelFlags) –

the log level of the message

`message` (String) –

the message that has occurred

`user_data` (Object) –

user data

Returns (Number) –

TRUE if message should be discarded by GstCheck.

Since : 1.12

### GstCheck.CheckLogFilterFunc

    def GstCheck.CheckLogFilterFunc (log_domain, log_level, message, *user_data):
        #python wrapper for 'GstCheckLogFilterFunc'

A function that is called for messages matching the filter added by gst_check_add_log_filter.

Parameters:

`log_domain` (str) –

the log domain of the message

`log_level` (GLib.LogLevelFlags) –

the log level of the message

`message` (str) –

the message that has occurred

`user_data` (variadic) –

user data

Returns (bool) –

TRUE if message should be discarded by GstCheck.

Since : 1.12

The results of the search are