[gtk+] Add a test for AtkUtil functions



commit a71b892c974c0bfb1fb4d829dde647527011e508
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jul 8 23:21:53 2011 -0400

    Add a test for AtkUtil functions
    
    This test revealed the horrors commented on in the previous
    commit.

 tests/a11y/Makefile.am |    3 ++
 tests/a11y/util.c      |   52 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/tests/a11y/Makefile.am b/tests/a11y/Makefile.am
index 3ec5fc2..817c584 100644
--- a/tests/a11y/Makefile.am
+++ b/tests/a11y/Makefile.am
@@ -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 \
diff --git a/tests/a11y/util.c b/tests/a11y/util.c
new file mode 100644
index 0000000..7128fba
--- /dev/null
+++ b/tests/a11y/util.c
@@ -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 ();
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]