]> Pileus Git - ~andy/gtk/blob - tests/a11y/util.c
Change FSF Address
[~andy/gtk] / tests / a11y / util.c
1 /*
2  * Copyright (C) 2011 Red Hat Inc.
3  *
4  * Author:
5  *      Matthias Clasen <mclasen@redhat.com>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #include <gtk/gtk.h>
22
23 static void
24 test_toolkit_name (void)
25 {
26   const gchar *s;
27
28   s = atk_get_toolkit_name ();
29   g_assert_cmpstr (s, ==, "gtk");
30 }
31
32 static void
33 test_toolkit_version (void)
34 {
35   const gchar *s;
36
37   s = atk_get_toolkit_version ();
38   g_assert_cmpstr (s, ==, GTK_VERSION);
39 }
40
41 static void
42 test_root (void)
43 {
44   AtkObject *obj;
45
46   obj = atk_get_root ();
47
48   g_assert (atk_object_get_role (obj) == ATK_ROLE_APPLICATION);
49   g_assert (atk_object_get_parent (obj) == NULL);
50 }
51
52 int
53 main (int argc, char *argv[])
54 {
55   gtk_test_init (&argc, &argv, NULL);
56
57   g_test_add_func ("/util/toolkit-name", test_toolkit_name);
58   g_test_add_func ("/util/toolkit-version", test_toolkit_version);
59   g_test_add_func ("/util/root", test_root);
60
61   return g_test_run ();
62 }