Testing

Testing — Utilities for testing GTK+ applications

Includes

#include <gtk/gtk.h>

Description

Functions

gtk_test_init ()

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 .

Parameters

argcp

Address of the argc parameter of the main() function. Changed if any arguments were handled.

 

argvp

Address of the argv parameter of main(). Any parameters understood by g_test_init() or gtk_init() are stripped before return.

[inout][array length=argcp]

...

currently unused

 

gtk_test_list_all_types ()

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().

Parameters

n_types

location to store number of types

 

Returns

0-terminated array of type ids.

[array length=n_types zero-terminated=1][transfer none]


gtk_test_register_all_types ()

void
gtk_test_register_all_types (void);

Force registration of all core Gtk+ and Gdk object types. This allowes to refer to any of those object types via g_type_from_name() after calling this function.


gtk_test_widget_wait_for_draw ()

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.

Parameters

widget

the widget to wait for