Testing — Utilities for testing GTK applications
void | gtk_test_init () |
const GType * | gtk_test_list_all_types () |
void | gtk_test_register_all_types () |
void | gtk_test_widget_wait_for_draw () |
#define | gtk_test_accessible_assert_property() |
#define | gtk_test_accessible_assert_relation() |
#define | gtk_test_accessible_assert_role() |
#define | gtk_test_accessible_assert_state() |
char * | gtk_test_accessible_check_property () |
char * | gtk_test_accessible_check_relation () |
char * | gtk_test_accessible_check_state () |
gboolean | gtk_test_accessible_has_property () |
gboolean | gtk_test_accessible_has_relation () |
gboolean | gtk_test_accessible_has_role () |
gboolean | gtk_test_accessible_has_state () |
void | gtk_test_accessible_assertion_message_role () |
#include <gtk/gtk.h>
void gtk_test_init (int *argcp, char ***argvp, ...);
This function is used to initialize a GTK test program.
It will in turn call g_test_init()
and gtk_init()
to properly initialize the testing framework and graphical toolkit. It’ll also set the program’s locale to “C”. This is done to make test program environments as deterministic as possible.
Like gtk_init()
and g_test_init()
, any known arguments will be processed and stripped from argc
and argv
.
argcp | Address of the | |
argvp | Address of the | [inout][array length=argcp] |
... | currently unused |
const GType * gtk_test_list_all_types (guint *n_types);
Return the type ids that have been registered after calling gtk_test_register_all_types()
.
n_types | location to store number of types |
0-terminated array of type ids.
[array length=n_types zero-terminated=1][transfer none]
void gtk_test_register_all_types (void);
Force registration of all core GTK object types.
This allowes to refer to any of those object types via g_type_from_name()
after calling this function.
void
gtk_test_widget_wait_for_draw (GtkWidget *widget
);
Enters the main loop and waits for widget
to be “drawn”. In this context that means it waits for the frame clock of widget
to have run a full styling, layout and drawing cycle.
This function is intended to be used for syncing with actions that depend on widget
relayouting or on interaction with the display server.
widget | the widget to wait for |
#define gtk_test_accessible_assert_property(accessible,property,...)
Checks whether a GtkAccessible implementation has its accessible property set to the expected value, and raises an assertion if the condition is not satisfied.
accessible | ||
property | ||
... | the value of |
#define gtk_test_accessible_assert_relation(accessible,relation,...)
Checks whether a GtkAccessible implementation has its accessible relation set to the expected value, and raises an assertion if the condition is not satisfied.
accessible | ||
relation | ||
... | the expected value of |
#define gtk_test_accessible_assert_role(accessible,role)
Checks whether a GtkAccessible implementation has the given role
, and raises an assertion if the condition is failed.
accessible | ||
role |
#define gtk_test_accessible_assert_state(accessible,state,...)
Checks whether a GtkAccessible implementation has its accessible state set to the expected value, and raises an assertion if the condition is not satisfied.
accessible | ||
state | ||
... | the expected value of |
char * gtk_test_accessible_check_property (GtkAccessible *accessible
,GtkAccessibleProperty property
,...
);
Checks whether the accessible property
of accessible
is set to a specific value.
accessible | ||
property | ||
... | the expected value of |
the value of the accessible property.
[transfer full]
char * gtk_test_accessible_check_relation (GtkAccessible *accessible
,GtkAccessibleRelation relation
,...
);
Checks whether the accessible relation
of accessible
is set to a specific value.
accessible | ||
relation | ||
... | the expected value of |
the value of the accessible relation.
[transfer full]
char * gtk_test_accessible_check_state (GtkAccessible *accessible
,GtkAccessibleState state
,...
);
Checks whether the accessible state
of accessible
is set to a specific value.
accessible | ||
state | ||
... | the expected value of |
the value of the accessible state.
[transfer full]
gboolean gtk_test_accessible_has_property (GtkAccessible *accessible
,GtkAccessibleProperty property
);
Checks whether the GtkAccessible has property
set.
accessible | ||
property |
TRUE
if the property
is set in the accessible
gboolean gtk_test_accessible_has_relation (GtkAccessible *accessible
,GtkAccessibleRelation relation
);
Checks whether the GtkAccessible has relation
set.
accessible | ||
relation |
TRUE
if the relation
is set in the accessible
gboolean gtk_test_accessible_has_role (GtkAccessible *accessible
,GtkAccessibleRole role
);
Checks whether the “accessible-role” of the accessible is role
.
accessible | ||
role |
TRUE
if the role matches
gboolean gtk_test_accessible_has_state (GtkAccessible *accessible
,GtkAccessibleState state
);
Checks whether the GtkAccessible has state
set.
accessible | ||
state |
TRUE
if the state
is set in the accessible
void gtk_test_accessible_assertion_message_role (const char *domain
,const char *file
,int line
,const char *func
,const char *expr
,GtkAccessible *accessible
,GtkAccessibleRole expected_role
,GtkAccessibleRole actual_role
);
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/gtk4-Testing.html