2011-06-17 03:13:38 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
static void
|
2020-03-20 12:33:21 +00:00
|
|
|
test_type (gconstpointer data)
|
2011-06-17 03:13:38 +00:00
|
|
|
{
|
2020-03-20 12:33:21 +00:00
|
|
|
GType t = *(GType *)data;
|
2011-06-17 03:13:38 +00:00
|
|
|
GtkWidget *w;
|
|
|
|
AtkObject *a;
|
|
|
|
|
2020-03-20 12:33:21 +00:00
|
|
|
w = (GtkWidget *)g_object_new (t, NULL);
|
|
|
|
if (g_type_is_a (t, G_TYPE_INITIALLY_UNOWNED))
|
|
|
|
g_object_ref_sink (w);
|
2011-06-17 03:13:38 +00:00
|
|
|
|
2020-03-20 12:33:21 +00:00
|
|
|
a = gtk_widget_get_accessible (w);
|
2011-06-17 03:13:38 +00:00
|
|
|
|
2020-03-20 12:33:21 +00:00
|
|
|
g_assert (GTK_IS_ACCESSIBLE (a));
|
|
|
|
g_assert (gtk_accessible_get_widget (GTK_ACCESSIBLE (a)) == w);
|
|
|
|
|
|
|
|
g_object_unref (w);
|
2011-06-17 03:13:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
2013-05-15 13:25:05 +00:00
|
|
|
const GType *tp;
|
|
|
|
guint i, n;
|
2011-06-17 03:13:38 +00:00
|
|
|
|
2020-03-20 12:33:21 +00:00
|
|
|
gtk_test_init (&argc, &argv, NULL);
|
|
|
|
gtk_test_register_all_types ();
|
2011-06-17 03:13:38 +00:00
|
|
|
|
2013-05-15 13:25:05 +00:00
|
|
|
tp = gtk_test_list_all_types (&n);
|
2011-06-17 03:13:38 +00:00
|
|
|
|
2013-09-03 20:51:03 +00:00
|
|
|
for (i = 0; i < n; i++)
|
2020-03-20 12:33:21 +00:00
|
|
|
{
|
|
|
|
char *testname;
|
|
|
|
|
|
|
|
if (!g_type_is_a (tp[i], GTK_TYPE_WIDGET) ||
|
|
|
|
G_TYPE_IS_ABSTRACT (tp[i]) ||
|
|
|
|
!G_TYPE_IS_INSTANTIATABLE (tp[i]))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
testname = g_strdup_printf ("/Accessible/%s", g_type_name (tp[i]));
|
|
|
|
g_test_add_data_func (testname, &tp[i], test_type);
|
|
|
|
|
|
|
|
g_free (testname);
|
|
|
|
}
|
2013-01-08 11:23:52 +00:00
|
|
|
|
2020-03-20 12:33:21 +00:00
|
|
|
return g_test_run ();
|
2011-06-17 03:13:38 +00:00
|
|
|
}
|