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

Object inspection functions

Object inspection functions — Functions to inspect an object for debugging.

Description

In test result, we need to know detail of inspected objects for debugging. Functions of this section help us to inspect interested objects.

Functions

gcut_inspect_direct ()

void
gcut_inspect_direct (GString *string,
                     gconstpointer data,
                     gpointer user_data);

Shows data as unsigned integer.

e.g.:

1
gcut_inspect_direct(string, GUINT_TO_POINTER(100), NULL) -> "100"

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.0.6


gcut_inspect_int ()

void
gcut_inspect_int (GString *string,
                  gconstpointer data,
                  gpointer user_data);

Shows data as integer.

e.g.:

1
2
gint int_value = 100;
gcut_inspect_int(string, &int_value, NULL) -> "100"

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.0.6


gcut_inspect_uint ()

void
gcut_inspect_uint (GString *string,
                   gconstpointer data,
                   gpointer user_data);

Shows data as unsigned integer.

e.g.:

1
2
guint uint_value = 100;
gcut_inspect_uint(string, &uint_value, NULL) -> "100"

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.0.6


gcut_inspect_int64 ()

void
gcut_inspect_int64 (GString *string,
                    gconstpointer data,
                    gpointer user_data);

Shows data as 64-bit integer.

e.g.:

1
2
gint64 int64_value = 100;
gcut_inspect_int64(string, &int64_value, NULL) -> "100"

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.1.3


gcut_inspect_uint64 ()

void
gcut_inspect_uint64 (GString *string,
                     gconstpointer data,
                     gpointer user_data);

Shows data as 64-bit unsigned integer.

e.g.:

1
2
guint64 uint64_value = 100;
gcut_inspect_uint64(string, &uint64_value, NULL) -> "100"

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.1.3


gcut_inspect_size ()

void
gcut_inspect_size (GString *string,
                   gconstpointer data,
                   gpointer user_data);

Shows data as unsigned integer.

e.g.:

1
2
gsize size_value = 100;
gcut_inspect_size(string, &size_value, NULL) -> "100"

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.1.3


gcut_inspect_char ()

void
gcut_inspect_char (GString *string,
                   gconstpointer data,
                   gpointer user_data);

Shows data as character.

e.g.:

1
2
3
gcut_inspect_char(string, 'C', NULL) -> "'C'"
gcut_inspect_char(string, '\0', NULL) -> "'\0'"
gcut_inspect_char(string, '\n', NULL) -> "'\n'"

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.1.3


gcut_inspect_string ()

void
gcut_inspect_string (GString *string,
                     gconstpointer data,
                     gpointer user_data);

Shows data as string. It also accepts NULL.

e.g.:

1
gcut_inspect_string(string, "string", NULL) -> "\"string\""

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.0.6


gcut_inspect_type ()

void
gcut_inspect_type (GString *string,
                   gconstpointer data,
                   gpointer user_data);

Shows data as GType.

e.g.:

1
gcut_inspect_type(string, GTK_TYPE_WINDOW, NULL) -> "<GtkWindow>"

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.0.6


gcut_inspect_flags ()

void
gcut_inspect_flags (GString *string,
                    gconstpointer data,
                    gpointer user_data);

Shows data as value a GFlags type.

e.g.:

1
2
3
4
5
6
7
GType flags_type;
GtkWidgetFlags flags;

flags_type = GTK_TYPE_WIDGET_FLAGS;
flags = GTK_TOPLEVEL | GTK_VISIBLE;
gcut_inspect_flags(string, &flags, &flags_type);
-> #<GtkWidgetFlags: toplevel|visible (GTK_TOPLEVEL:0x10)|(GTK_VISIBLE:0x100)>

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the pointer of GFlags type.

 

Since: 1.0.6


gcut_inspect_enum ()

void
gcut_inspect_enum (GString *string,
                   gconstpointer data,
                   gpointer user_data);

Shows data as value of a GEnum type.

e.g.:

1
2
3
4
5
6
7
GType enum_type;
GtkWidgetHelpType value;

enum_type = GTK_TYPE_WIDGET_HELP_TYPE;
value = GTK_WIDGET_HELP_TOOLTIP;
gcut_inspect_enum(string, &value, &enum_type);
-> #<GtkWidgetHelpType: tooltip(GTK_WIDGET_HELP_TOOLTIP:0)>

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the pointer of GEnum type.

 

Since: 1.0.6


gcut_inspect_pointer ()

void
gcut_inspect_pointer (GString *string,
                      gconstpointer data,
                      gpointer user_data);

Shows data as a pointer.

e.g.:

1
2
memory = malloc(1);
gcut_inspect_pointer(string, memory, NULL) -> "#<0xXXXXXXX>"

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.0.6


gcut_inspect_boolean ()

void
gcut_inspect_boolean (GString *string,
                      gconstpointer data,
                      gpointer user_data);

Shows data as boolean.

e.g.:

1
2
3
4
5
6
gboolean boolean_value;

boolean_value = TRUE;
gcut_inspect_boolean(string, &boolean_value, NULL) -> "TRUE"
boolean_value = FALSE;
gcut_inspect_boolean(string, &boolean_value, NULL) -> "FALSE"

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.1.3


gcut_inspect_double ()

void
gcut_inspect_double (GString *string,
                     gconstpointer data,
                     gpointer user_data);

Shows data as double floating point number.

e.g.:

1
2
gdouble double_value = 2.9;
gcut_inspect_double(string, &double_value, NULL) -> "2.9"

Parameters

string

the output string.

 

data

the interested target.

 

user_data

the data passed by user. (ignored)

 

Since: 1.1.3

Types and Values