![]() |
![]() |
![]() |
Cutter Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
Assertions with GLib supportAssertions with GLib support — Checks that your program works as you expect with GLib support. |
#define gcut_assert_equal_type (expected, actual, ...) #define cut_assert_equal_g_type (expected, actual, ...) #define gcut_assert_equal_value (expected, actual, ...) #define cut_assert_equal_g_value (expected, actual, ...) void gcut_assert_equal_list (GList *expected, GList *actual, GEqualFunc equal_function, GCutInspectFunction inspect_function, gpointer inspect_user_data); #define gcut_assert_equal_list_int (expected, actual, ...) #define cut_assert_equal_g_list_int (expected, actual, ...) #define gcut_assert_equal_list_uint (expected, actual, ...) #define gcut_assert_equal_list_string (expected, actual, ...) #define cut_assert_equal_g_list_string (expected, actual, ...) void gcut_assert_equal_list_object (GList *expected, GList *actual, ...); void gcut_assert_equal_list_object_custom (GList *expected, GList *actual, GEqualFunc equal_function, ...); #define gcut_assert_equal_list_enum (type, expected, actual, ...) #define gcut_assert_equal_list_flags (type, expected, actual, ...) void gcut_assert_equal_hash_table (GHashTable *expected, GHashTable *actual, GEqualFunc equal_function, GCutInspectFunction key_inspect_function, GCutInspectFunction value_inspect_function, gpointer inspect_user_data); void gcut_assert_equal_hash_table_string_string (GHashTable *expected, GHashTable *actual, ...); #define gcut_assert_error (error, ...) #define cut_assert_g_error (error, ...) #define gcut_assert_equal_error (expected, actual, ...) #define gcut_assert_remove_path (path, ...) #define cut_assert_remove_path (path, ...) #define gcut_assert_equal_time_val (expected, actual, ...) #define gcut_assert_equal_enum (enum_type, expected, actual, ...) #define gcut_assert_equal_flags (flags_type, expected, actual, ...) #define gcut_assert_equal_object (expected, actual, ...) #define gcut_assert_equal_object_custom (expected, actual, equal_function, ...) #define gcut_assert_equal_int64 (expected, actual, ...) #define gcut_assert_equal_uint64 (expected, actual, ...) #define gcut_assert_equal_pid (expected, actual)
#define gcut_assert_equal_type(expected, actual, ...)
Passes if expected
== actual
.
|
an expected GType. |
|
an actual GType. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.3
#define cut_assert_equal_g_type(expected, actual, ...)
cut_assert_equal_g_type
has been deprecated since version 1.0.3 and should not be used in newly-written code. Use gcut_assert_equal_type()
instead.
Passes if expected
== actual
.
|
an expected GType. |
|
an actual GType. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
#define gcut_assert_equal_value(expected, actual, ...)
Passes if expected
== actual
.
|
an expected GValue *. |
|
an actual GValue *. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.3
#define cut_assert_equal_g_value(expected, actual, ...)
cut_assert_equal_g_value
has been deprecated since version 1.0.3 and should not be used in newly-written code. Use gcut_assert_equal_value()
instead.
Passes if expected
== actual
.
|
an expected GValue *. |
|
an actual GValue *. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
void gcut_assert_equal_list (GList *expected, GList *actual, GEqualFunc equal_function, GCutInspectFunction inspect_function, gpointer inspect_user_data);
Passes if equal_function
(expected
, actual
) == CUT_TRUE
.
|
an expected list. |
|
an actual list. |
|
a function that compares each elements of
expected and actual list.
|
|
a function that inspected expected
and actual list.
|
|
a data to be passed to inspect_function .
|
Since 1.0.6
#define gcut_assert_equal_list_int(expected, actual, ...)
Passes if expected
== actual
.
|
an expected GList * of integer. |
|
an actual GList * of integer. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.3
#define cut_assert_equal_g_list_int(expected, actual, ...)
cut_assert_equal_g_list_int
has been deprecated since version 1.0.3 and should not be used in newly-written code. Use gcut_assert_equal_list_int()
instead.
Passes if expected
== actual
.
|
an expected GList * of integer. |
|
an actual GList * of integer. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 0.8
#define gcut_assert_equal_list_uint(expected, actual, ...)
Passes if expected
== actual
.
|
an expected GList * of unsigned integer. |
|
an actual GList * of unsigned integer. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.3
#define gcut_assert_equal_list_string(expected, actual, ...)
Passes if expected
== actual
.
|
an expected GList * of string. |
|
an actual GList * of string. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.3
#define cut_assert_equal_g_list_string(expected, actual, ...)
cut_assert_equal_g_list_string
has been deprecated since version 1.0.3 and should not be used in newly-written code. Use gcut_assert_equal_list_string()
instead.
Passes if expected
== actual
.
|
an expected GList * of string. |
|
an actual GList * of string. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 0.8
void gcut_assert_equal_list_object (GList *expected, GList *actual, ...);
Passes if expected
and actual
has same GObject * in
same order.
|
an expected GList * of GObject *. |
|
an actual GList * of GObject *. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.5
void gcut_assert_equal_list_object_custom (GList *expected, GList *actual, GEqualFunc equal_function, ...);
Passes if expected
and actual
has same GObject * in
same order. Each comparison of GObject * uses
equal_function
.
|
an expected GList * of GObject *. |
|
an actual GList * of GObject *. |
|
a function that compares two GObject *. (GEqualFunc) |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.5
#define gcut_assert_equal_list_enum(type, expected, actual, ...)
Passes if expected
and actual
has same enum values in
same order.
|
a GEnum type. |
|
an expected GList * of enum value. |
|
an actual GList * of enum value. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.5
#define gcut_assert_equal_list_flags(type, expected, actual, ...)
Passes if expected
and actual
has same flags values in
same order.
|
a GFlags type. |
|
an expected GList * of flags value. |
|
an actual GList * of flags value. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.5
void gcut_assert_equal_hash_table (GHashTable *expected, GHashTable *actual, GEqualFunc equal_function, GCutInspectFunction key_inspect_function, GCutInspectFunction value_inspect_function, gpointer inspect_user_data);
Passes if expected
== actual
.
|
an expected GHashTable of string. |
|
an actual GHashTable of string. |
|
a function that compares each values of
expected and actual hash table.
|
|
a function that inspected a key of
expected and actual hash table.
|
|
a function that inspected a value of
expected and actual hash table.
|
|
a data to be passed to inspect_function .
|
Since 1.0.6
void gcut_assert_equal_hash_table_string_string (GHashTable *expected, GHashTable *actual, ...);
Passes if expected
== actual
.
|
an expected GHashTable of string. |
|
an actual GHashTable of string. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.4
#define gcut_assert_error(error, ...)
Passes if error
== NULL
.
|
a target GError *. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.3
#define cut_assert_g_error(error, ...)
cut_assert_g_error
has been deprecated since version 1.0.3 and should not be used in newly-written code. Use gcut_assert_error()
instead.
Passes if error
== NULL
.
|
a target GError *. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0
#define gcut_assert_equal_error(expected, actual, ...)
Passes if expected
== actual
.
|
an expected GError *. |
|
an actual GError *. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.5
#define gcut_assert_remove_path(path, ...)
Passes if cut_utils_build_path(path
, ...) is removed successfully.
|
a first element of the path to the removed path. |
|
remaining elements in path. NULL terminated. |
Since 1.0.3
#define cut_assert_remove_path(path, ...)
cut_assert_remove_path
has been deprecated since version 1.0.3 and should not be used in newly-written code. Use gcut_assert_remove_path()
instead.
Passes if cut_utils_build_path(path
, ...) is removed successfully.
|
a first element of the path to the removed path. |
|
remaining elements in path. NULL terminated. |
Since 1.0.2
#define gcut_assert_equal_time_val(expected, actual, ...)
Passes if expected
== actual
.
|
an expected GTimeVal. |
|
an actual GTimeVal. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.4
#define gcut_assert_equal_enum(enum_type, expected, actual, ...)
Passes if expected
== actual
.
e.g.:
gcut_assert_equal_enum(GTK_TYPE_DIRECTION_TYPE, GTK_DIR_LEFT, GTK_DIR_LEFT); -> Pass gcut_assert_equal_enum(GTK_TYPE_DIRECTION_TYPE, GTK_DIR_DOWN, GTK_DIR_LEFT); -> Fail
|
a GEnum type. |
|
an expected enum value. |
|
an actual enum value. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.5
#define gcut_assert_equal_flags(flags_type, expected, actual, ...)
Passes if expected
== actual
.
e.g.:
gcut_assert_equal_flags(GTK_TYPE_DIALOG_FLAGS, GTK_DIALOG_DESTROY_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_DESTROY_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT); -> Pass gcut_assert_equal_flags(GTK_TYPE_DIALOG_FLAGS, GTK_DIALOG_DESTROY_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_DESTROY_MODAL); -> Fail
|
a GFlags type. |
|
an expected flags value. |
|
an actual flags value. |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.5
#define gcut_assert_equal_object(expected, actual, ...)
Passes if expected
== actual
. See
gcut_assert_equal_object_custom()
when you need to customize
equality check.
e.g.:
gcut_assert_equal_object(object, object); -> Pass gcut_assert_equal_object(object1, object2); -> Fail gcut_assert_equal_object(NULL, NULL); -> Pass gcut_assert_equal_object(object1, NULL); -> Fail
|
an expected object. (GObject *) |
|
an actual object. (GObject *) |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.5
#define gcut_assert_equal_object_custom(expected, actual, \ equal_function, ...)
Passes if equal_function
(expected
, actual
) == CUT_TRUE
.
e.g.:
static gboolean equal_name (gconstpointer data1, gconstpointer data2) { return g_str_equal(my_object_get_name(MY_OBJECT(data1)), my_object_get_name(MY_OBJECT(data2))); } gcut_assert_equal_object_custom(object, object, equal_name); -> Pass gcut_assert_equal_object_custom(same_name_object1, same_name_object2, equal_name); -> Pass gcut_assert_equal_object_custom(different_name_object1, different_name_object2, equal_name); -> Fail
|
an expected object. (GObject *) |
|
an actual object. (GObject *) |
|
a function that compare two object. (GEqualFunc) |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.5
#define gcut_assert_equal_int64(expected, actual, ...)
Passes if expected
== actual
.
|
an expected 64 bit integer value. (gint64) |
|
an actual 64 bit integer value. (gint64) |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.5
#define gcut_assert_equal_uint64(expected, actual, ...)
Passes if expected
== actual
.
|
an expected unsigned integer value. (guint64) |
|
an actual unsigned integer value. (guint64) |
|
optional format string, followed by parameters to insert
into the format string. (as with printf() ) This is
deprecated since 0.1.6. Use cut_set_message() instead.
|
Since 1.0.5