Test Utilities with GLib support

Test Utilities with GLib support — Utilities to write tests more easily with GLib support.

Synopsis

#define             gcut_take_object                    (object)
#define             gcut_take_error                     (error)
#define             gcut_take_list                      (list, destroy_function)
#define             gcut_take_hash_table                (hash_table)
GList*              gcut_list_string_new                (const gchar *value,
                                                         ...);
void                gcut_list_string_free               (GList *list);
GHashTable*         gcut_hash_table_string_string_new   (const gchar *key,
                                                         ...);

Description

To write tests, you need to write codes that set up/tear down test environment, prepare expected and actual values and so on. Cutter provides test utilities to you write your tests more easily.

The utilities work with GLib.

Details

gcut_take_object()

#define             gcut_take_object(object)

Passes ownership of object to Cutter and returns object.

object :

Since 1.0.3


gcut_take_error()

#define             gcut_take_error(error)

Passes ownership of error to Cutter and returns a GError * that has same contents of error.

error :

Since 1.0.3


gcut_take_list()

#define             gcut_take_list(list, destroy_function)

Passes ownership of list to Cutter and returns a GList * that has same elements of list.

list :

destroy_function :

Since 1.0.3


gcut_take_hash_table()

#define             gcut_take_hash_table(hash_table)

Passes ownership of hash_table to Cutter and returns hash_table.

hash_table :

Since 1.0.4


gcut_list_string_new ()

GList*              gcut_list_string_new                (const gchar *value,
                                                         ...);

Creates a list from passed strings.

value :

... :

Returns :

Since 1.0.3


gcut_list_string_free ()

void                gcut_list_string_free               (GList *list);

Frees list and contained strings.

list :

Since 1.0.3


gcut_hash_table_string_string_new ()

GHashTable*         gcut_hash_table_string_string_new   (const gchar *key,
                                                         ...);

Creates a hash table that has string key and string value from passed key/value pairs.

key :

... :

Returns :

Since 1.0.4