accessible.c 570 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#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[])
{
24 25
  const GType *tp;
  guint i, n;
26 27 28

  gtk_init (&argc, &argv);

29
  tp = gtk_test_list_all_types (&n);
30

31
  for (i = 0; i < n; i++)
32
    test_type (tp[i]);
33 34

  return 0;
35
}