Each test suite is no longer a loadable module.
Split testrelation into testrelation and testrole.
/missing
/mkinstalldirs
/stamp-h1
-atkversion.h
\ No newline at end of file
+atkversion.h
+tests/testrelation
+tests/testrole
+tests/teststateset
no_undefined =
endif
-noinst_LTLIBRARIES = \
- libteststateset.la \
- libtestrelation.la
-
libatk = $(top_builddir)/atk/libatk-$(ATK_API_VERSION).la
-INCLUDES = -I$(top_srcdir) \
+AM_CPPFLAGS = -I$(top_srcdir) \
-DG_DISABLE_DEPRECATED \
$(DEP_CFLAGS)
DEPS = \
$(libatk)
-moduledir = $(libdir)/gtk-2.0/modules
+noinst_PROGRAMS = testrole \
+ testrelation \
+ teststateset
-libteststateset_la_SOURCES = teststateset.c
-libteststateset_la_LDFLAGS = \
- -rpath $(moduledir) \
- $(no_undefined) \
- -avoid-version \
- -module
-libteststateset_la_LIBADD = $(libatk) $(DEP_LIBS)
+LDADD = $(libatk) $(DEP_LIBS)
-libtestrelation_la_SOURCES = testrelation.c
-libtestrelation_la_LDFLAGS = \
- -rpath $(moduledir) \
- $(no_undefined) \
- -avoid-version \
- -module
-libtestrelation_la_LIBADD = $(libatk) $(DEP_LIBS)
+testrole_SOURCES = testrole.c
+testrelation_SOURCES = testrelation.c
+teststateset_SOURCES = teststateset.c
-The tests in this directory are grouped into shared libraries, each of
-which is a GTK_MODULE. That is, they are designed to be loaded into a running
-GTK program by specifying the GTK_MODULES environment variable.
-
teststateset
============
This module tests the interfaces in atk/atkstateset.h
testrelation
============
This module tests the interfaces in atk/atkrelation.h
+
+testrole
+========
+This module tests the methods related with roles and role names,
+defined at atk/atkobject.h
\ No newline at end of file
#include <string.h>
-static gboolean test_relation (void);
-static gboolean test_role (void);
-
static gboolean
test_relation (void)
{
}
static gboolean
-test_role (void)
-{
- AtkRole role1, role2;
- const gchar *name;
-
- name = atk_role_get_name (ATK_ROLE_PAGE_TAB);
- g_return_val_if_fail (name, FALSE);
- if (strcmp (name, "page tab") != 0)
- {
- g_print ("Unexpected name for ATK_ROLE_PAGE_TAB %s\n", name);
- return FALSE;
- }
-
- name = atk_role_get_name (ATK_ROLE_LAYERED_PANE);
- g_return_val_if_fail (name, FALSE);
- if (strcmp (name, "layered pane") != 0)
- {
- g_print ("Unexpected name for ATK_ROLE_LAYERED_PANE %s\n", name);
- return FALSE;
- }
-
- role1 = atk_role_for_name ("list item");
- if (role1 != ATK_ROLE_LIST_ITEM)
- {
- g_print ("Unexpected role for list item\n");
- return FALSE;
- }
-
- role1 = atk_role_register ("test-role");
- name = atk_role_get_name (role1);
- g_return_val_if_fail (name, FALSE);
- if (strcmp (name, "test-role") != 0)
- {
- g_print ("Unexpected name for test-role %s\n", name);
- return FALSE;
- }
- role2 = atk_role_for_name ("test-role");
- if (role1 != role2)
- {
- g_print ("Unexpected role for test-role\n");
- return FALSE;
- }
- role2 = atk_role_for_name ("TEST_ROLE");
- if (role2 != 0)
- {
- g_print ("Unexpected role for TEST_ROLE\n");
- return FALSE;
- }
- /*
- * Check that a non-existent role returns NULL
- */
- name = atk_role_get_name (ATK_ROLE_LAST_DEFINED + 2);
- if (name)
- {
- g_print ("Unexpected name for undefined role %s\n", name);
- return FALSE;
- }
- return TRUE;
-}
-
-static gboolean
test_text_attr (void)
{
AtkTextAttribute attr1, attr2;
}
int
-gtk_module_init (gint argc,
- char* argv[])
+main (gint argc,
+ char* argv[])
{
gboolean b_ret;
- g_print("Relation test module loaded\n");
+ g_print("Starting Relation test suite\n");
b_ret = test_relation ();
if (b_ret)
g_print ("Relation tests succeeded\n");
else
g_print ("Relation tests failed\n");
- b_ret = test_role ();
- if (b_ret)
- g_print ("Role tests succeeded\n");
- else
- g_print ("Role tests failed\n");
+
b_ret = test_text_attr ();
if (b_ret)
g_print ("Text Attribute tests succeeded\n");
else
g_print ("Text Attribute tests failed\n");
+
return 0;
}
--- /dev/null
+/* ATK - Accessibility Toolkit
+ * Copyright (C) 2013 Igalia, S.L.
+ *
+ * Author: Alejandro Piñeiro Iglesias <apinheiro@igalia.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 <atk/atk.h>
+#include <string.h>
+
+static gboolean
+test_role (void)
+{
+ AtkRole role1, role2;
+ const gchar *name;
+
+ name = atk_role_get_name (ATK_ROLE_PAGE_TAB);
+ g_return_val_if_fail (name, FALSE);
+ if (strcmp (name, "page tab") != 0)
+ {
+ g_print ("Unexpected name for ATK_ROLE_PAGE_TAB %s\n", name);
+ return FALSE;
+ }
+
+ name = atk_role_get_name (ATK_ROLE_LAYERED_PANE);
+ g_return_val_if_fail (name, FALSE);
+ if (strcmp (name, "layered pane") != 0)
+ {
+ g_print ("Unexpected name for ATK_ROLE_LAYERED_PANE %s\n", name);
+ return FALSE;
+ }
+
+ role1 = atk_role_for_name ("list item");
+ if (role1 != ATK_ROLE_LIST_ITEM)
+ {
+ g_print ("Unexpected role for list item\n");
+ return FALSE;
+ }
+
+ role1 = atk_role_register ("test-role");
+ name = atk_role_get_name (role1);
+ g_return_val_if_fail (name, FALSE);
+ if (strcmp (name, "test-role") != 0)
+ {
+ g_print ("Unexpected name for test-role %s\n", name);
+ return FALSE;
+ }
+ role2 = atk_role_for_name ("test-role");
+ if (role1 != role2)
+ {
+ g_print ("Unexpected role for test-role\n");
+ return FALSE;
+ }
+ role2 = atk_role_for_name ("TEST_ROLE");
+ if (role2 != 0)
+ {
+ g_print ("Unexpected role for TEST_ROLE\n");
+ return FALSE;
+ }
+ /*
+ * Check that a non-existent role returns NULL
+ */
+ name = atk_role_get_name (ATK_ROLE_LAST_DEFINED + 2);
+ if (name)
+ {
+ g_print ("Unexpected name for undefined role %s\n", name);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static void
+print_roles()
+{
+ AtkRole role;
+
+ g_print("(Role, name, localized name) defined by the ATK library:\n");
+
+ for (role = ATK_ROLE_INVALID; role < ATK_ROLE_LAST_DEFINED; role++)
+ g_print ("(%i, %s, %s)\n", role,
+ atk_role_get_name(role), atk_role_get_localized_name(role));
+}
+
+int
+main (int argc, char **argv)
+{
+ gboolean b_ret;
+
+ g_print ("Starting Role test suite\n");
+
+ print_roles();
+
+ b_ret = test_role ();
+ if (b_ret)
+ g_print ("Role tests succeeded\n");
+ else
+ g_print ("Role tests failed\n");
+
+ return 0;
+}
}
int
-gtk_module_init (gint argc, char* argv[])
+main (gint argc, char* argv[])
{
gboolean b_ret;
- g_print("State Set test module loaded\n");
+ g_print("Starting State Set test suite\n");
b_ret = test_state_set ();
if (b_ret)