a Unit Testing Framework for C and C++ - Cutter

Assertion Utilities for GObject

Assertion Utilities for GObject — Utilities to write assertions related to GObject more easily.

Description

To write assertions, you need to check equality and show expected and actual values.

The utilities help you to write assertions that are related to GObject.

Functions

gcut_object_equal ()

gboolean
gcut_object_equal (const GObject *object1,
                   const GObject *object2,
                   GEqualFunc equal_func);

Compares two GObject, object1 and object2 by equal_func . If equal_func is NULL, object1 and object2 is just only compared by memory location.

Parameters

object1

a GObject to be compared.

 

object2

a GObject to be compared.

 

equal_func

a function that compares two GObject. NULL is OK.

 

Returns

TRUE if object1 == object2 or equal_func (object1 , object2 ), FALSE otherwise.

Since: 1.0.5


gcut_object_inspect ()

gchar *
gcut_object_inspect (const GObject *object);

Inspects object 's property. The returned string should be freed when no longer needed.

Parameters

object

a GObject.

 

Returns

inspected object as a string.

Since: 1.0.5


gcut_object_inspect_custom ()

gchar *
gcut_object_inspect_custom (const GObject *object,
                            GCutInspectFunction inspect_func,
                            gpointer user_data);

Inspects object by inspect_func . The returned string should be freed when no longer needed.

Parameters

object

a GObject.

 

inspect_func

a function that inspects object .

 

user_data

user data to pass to the function.

 

Returns

inspected object as a string.

Since: 1.0.5

Types and Values