mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-30 15:31:34 +00:00
Add a first, trivial test for accessibles
This commit is contained in:
parent
813b2c0aff
commit
8bbab02215
@ -115,6 +115,10 @@ TEST_PROGS += treepath
|
||||
treepath_SOURCES = treepath.c
|
||||
treepath_LDADD = $(progs_ldadd)
|
||||
|
||||
TEST_PROGS += accessible
|
||||
accessible_SOURCES = accessible.c
|
||||
accessible_LDADD = $(progs_ldadd)
|
||||
|
||||
EXTRA_DIST += \
|
||||
file-chooser-test-dir/empty \
|
||||
file-chooser-test-dir/text.txt
|
||||
|
36
gtk/tests/accessible.c
Normal file
36
gtk/tests/accessible.c
Normal file
@ -0,0 +1,36 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static void
|
||||
test_type (GType t)
|
||||
{
|
||||
GtkWidget *w;
|
||||
AtkObject *a;
|
||||
|
||||
if (g_type_is_a (t, GTK_TYPE_WIDGET))
|
||||
{
|
||||
w = (GtkWidget *)g_object_new (t, NULL);
|
||||
a = gtk_widget_get_accessible (w);
|
||||
|
||||
g_assert (GTK_IS_ACCESSIBLE (a));
|
||||
g_assert (gtk_accessible_get_widget (GTK_ACCESSIBLE (a)) == w);
|
||||
|
||||
g_object_unref (w);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GType *tp;
|
||||
gint i;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
tp = g_new0 (GType, 1000);
|
||||
#undef GDK_WINDOWING_X11
|
||||
#include "../gtktypefuncs.c"
|
||||
*tp = 0;
|
||||
|
||||
for (i = 0; tp[i]; i++)
|
||||
test_type (tp[i]);
|
||||
}
|
Loading…
Reference in New Issue
Block a user