Add a test for AtkUtil functions

This test revealed the horrors commented on in the previous
commit.
This commit is contained in:
Matthias Clasen 2011-07-08 23:21:53 -04:00
parent 182b6f7a3c
commit a71b892c97
2 changed files with 55 additions and 0 deletions

View File

@ -8,6 +8,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/gdk \
-DGDK_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED \
-DGTK_VERSION=\"$(GTK_VERSION)\"\
$(GTK_DEBUG_FLAGS) \
$(GTK_DEP_CFLAGS)
@ -26,6 +27,8 @@ TEST_PROGS += children
TEST_PROGS += focus
TEST_PROGS += util
EXTRA_DIST += \
hello-world.ui hello-world.txt \
mnemonic.ui mnemonic.txt \

52
tests/a11y/util.c Normal file
View File

@ -0,0 +1,52 @@
/*
* Copyright (C) 2011 Red Hat Inc.
*
* Author:
* Matthias Clasen <mclasen@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <gtk/gtk.h>
static void
test_toolkit_name (void)
{
const gchar *s;
s = atk_get_toolkit_name ();
g_assert_cmpstr (s, ==, "gtk");
}
static void
test_toolkit_version (void)
{
const gchar *s;
s = atk_get_toolkit_version ();
g_assert_cmpstr (s, ==, GTK_VERSION);
}
int
main (int argc, char *argv[])
{
gtk_test_init (&argc, &argv, NULL);
g_test_add_func ("/util/toolkit-name", test_toolkit_name);
g_test_add_func ("/util/toolkit-version", test_toolkit_version);
return g_test_run ();
}