diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/at-spi2-atk/README | 2 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_accessible.c | 280 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_action.c | 56 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_collection.c | 32 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_component.c | 72 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_document.c | 36 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_editable_text.c | 56 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_hyperlink.c | 56 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_hypertext.c | 24 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_image.c | 48 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_selection.c | 72 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_state_set.c | 78 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_table.c | 208 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_table_cell.c | 64 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_text.c | 160 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_util.c | 12 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_util.h | 9 | ||||
-rw-r--r-- | tests/at-spi2-atk/atk_test_value.c | 56 |
18 files changed, 670 insertions, 651 deletions
diff --git a/tests/at-spi2-atk/README b/tests/at-spi2-atk/README index 011e655c..3244f2af 100644 --- a/tests/at-spi2-atk/README +++ b/tests/at-spi2-atk/README @@ -185,7 +185,7 @@ AVAILABLE TESTS: -text_get_text_attributes -text_get_attribute_run -text_get_get_text_attribute_value - -text_get_defualt_attributes + -text_get_default_attributes -text_set_caret_offset -text_get_string_at_offset -text_get_character_at_offset diff --git a/tests/at-spi2-atk/atk_test_accessible.c b/tests/at-spi2-atk/atk_test_accessible.c index cabff4cf..cc7593b5 100644 --- a/tests/at-spi2-atk/atk_test_accessible.c +++ b/tests/at-spi2-atk/atk_test_accessible.c @@ -26,57 +26,57 @@ #define DATA_FILE TESTS_DATA_DIR "/test-accessible.xml" static void -atk_test_accessible_get_name (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_name (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); } static void -atk_test_accessible_get_description (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_description (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_description (obj, NULL), ==, "Root of the accessible tree"); } static void -atk_test_accessible_get_child_count (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_child_count (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; gint child_c = atspi_accessible_get_child_count (obj, NULL); g_assert_cmpint (3, ==, child_c); } static void -atk_test_accessible_get_parent (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_parent (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiAccessible *parent = atspi_accessible_get_parent (child, NULL); g_assert (parent == obj); } static void -atk_test_accessible_get_child_at_index (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_child_at_index (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); g_assert_cmpstr (atspi_accessible_get_name (child, NULL), ==, "obj2"); } static void -atk_test_accessible_get_index_in_parent (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_index_in_parent (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 2, NULL); int index = atspi_accessible_get_index_in_parent (child, NULL); g_assert_cmpint (index, ==, 2); } static void -atk_test_accessible_get_relation_set_1 (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_relation_set_1 (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child1 = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiAccessible *child = atspi_accessible_get_child_at_index (child1, 0, NULL); GArray *rel_set = atspi_accessible_get_relation_set (child, NULL); @@ -84,9 +84,9 @@ atk_test_accessible_get_relation_set_1 (gpointer fixture, gconstpointer user_dat } static void -atk_test_accessible_get_relation_set_2 (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_relation_set_2 (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *obj2 = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiAccessible *obj2_1 = atspi_accessible_get_child_at_index (obj2, 0, NULL); GArray *rel_set = atspi_accessible_get_relation_set (obj2_1, NULL); @@ -102,33 +102,33 @@ atk_test_accessible_get_relation_set_2 (gpointer fixture, gconstpointer user_dat } static void -atk_test_accessible_get_role (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_role (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiRole root_role = atspi_accessible_get_role (obj, NULL); g_assert_cmpint (root_role, ==, ATSPI_ROLE_ACCELERATOR_LABEL); } static void -atk_test_accessible_get_role_name (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_role_name (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; gchar *root_role_name = atspi_accessible_get_role_name (obj, NULL); g_assert_cmpstr (root_role_name, ==, "accelerator label"); } static void -atk_test_accessible_get_localized_role_name (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_localized_role_name (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; gchar *root_role_name = atspi_accessible_get_localized_role_name (obj, NULL); g_assert_cmpstr (root_role_name, ==, "accelerator label"); } static void -atk_test_accessible_get_state_set (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_state_set (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiStateSet *states = atspi_accessible_get_state_set (child); GArray *states_arr = atspi_state_set_get_states (states); @@ -148,9 +148,9 @@ atk_test_accessible_get_state_set (gpointer fixture, gconstpointer user_data) } static void -atk_test_accessible_get_attributes (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_attributes (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; GHashTable *attr_hash_tab = atspi_accessible_get_attributes (obj, NULL); GHashTableIter iter; gpointer key, value; @@ -178,9 +178,9 @@ atk_test_accessible_get_attributes (gpointer fixture, gconstpointer user_data) } static void -atk_test_accessible_get_attributes_as_array (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_attributes_as_array (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; GArray *attr_arr = atspi_accessible_get_attributes_as_array (obj, NULL); int i; g_assert_cmpint (attr_arr->len, ==, 2); @@ -193,139 +193,139 @@ atk_test_accessible_get_attributes_as_array (gpointer fixture, gconstpointer use } static void -atk_test_accessible_get_toolkit_name (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_toolkit_name (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; gchar *toolkit_name = atspi_accessible_get_toolkit_name (obj, NULL); g_assert_cmpstr (toolkit_name, ==, "atspitesting-toolkit"); } static void -atk_test_accessible_get_toolkit_version (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_toolkit_version (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; gchar *toolkit_ver = atspi_accessible_get_toolkit_version (obj, NULL); /* should be empty string, because no value is setted */ g_assert_cmpstr (toolkit_ver, ==, ""); } static void -atk_test_accessible_get_atspi_version (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_atspi_version (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; gchar *atspi_version = atspi_accessible_get_atspi_version (obj, NULL); g_assert_cmpstr (atspi_version, ==, "2.1"); } static void -atk_test_accessible_get_id (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_id (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; gint app_id = atspi_accessible_get_id (obj, NULL); g_assert_cmpint (app_id, !=, -1); } static void -atk_test_accessible_get_application (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_application (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *app = atspi_accessible_get_application (obj, NULL); g_assert (app != NULL); } static void -atk_test_accessible_get_action_iface (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_action_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAction *iface = atspi_accessible_get_action_iface (obj); g_assert (iface == NULL); } static void -atk_test_accessible_get_collection_iface (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_collection_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiCollection *iface = atspi_accessible_get_collection_iface (obj); g_assert (iface != NULL); } static void -atk_test_accessible_get_component_iface (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_component_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiComponent *iface = atspi_accessible_get_component_iface (obj); g_assert (iface == NULL); } static void -atk_test_accessible_get_document_iface (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_document_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiDocument *iface = atspi_accessible_get_document_iface (obj); g_assert (iface == NULL); } static void -atk_test_accessible_get_editable_text_iface (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_editable_text_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiEditableText *iface = atspi_accessible_get_editable_text_iface (obj); g_assert (iface == NULL); } static void -atk_test_accessible_get_hypertext_iface (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_hypertext_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiHypertext *iface = atspi_accessible_get_hypertext_iface (obj); g_assert (iface == NULL); } static void -atk_test_accessible_get_image_iface (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_image_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiImage *iface = atspi_accessible_get_image_iface (obj); g_assert (iface == NULL); } static void -atk_test_accessible_get_selection_iface (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_selection_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiSelection *iface = atspi_accessible_get_selection_iface (obj); g_assert (iface == NULL); } static void -atk_test_accessible_get_table_iface (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_table_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiTable *iface = atspi_accessible_get_table_iface (obj); g_assert (iface == NULL); } static void -atk_test_accessible_get_text_iface (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_text_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiText *iface = atspi_accessible_get_text_iface (obj); g_assert (iface == NULL); } static void -atk_test_accessible_get_value_iface (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_value_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiValue *iface = atspi_accessible_get_value_iface (obj); g_assert (iface == NULL); } static void -atk_test_accessible_get_interfaces (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_interfaces (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; gchar *valid_obj_ifaces[] = { "Accessible", "Collection" }; GArray *ifaces = atspi_accessible_get_interfaces (obj); @@ -336,17 +336,17 @@ atk_test_accessible_get_interfaces (gpointer fixture, gconstpointer user_data) } static void -atk_test_accessible_get_object_locale (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_object_locale (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; const gchar *obj_locale = atspi_accessible_get_object_locale (obj, NULL); g_assert_cmpstr (obj_locale, ==, setlocale (LC_MESSAGES, NULL)); } static void -atk_test_accessible_set_cache_mask (gpointer fixture, gconstpointer user_data) +atk_test_accessible_set_cache_mask (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiCache cache_mask = ATSPI_CACHE_ROLE; atspi_accessible_set_cache_mask (obj, cache_mask); g_assert_cmpint (obj->parent.app->cache, ==, cache_mask); @@ -363,17 +363,17 @@ atk_test_check_cache_cleared (AtspiAccessible *obj) } static void -atk_test_accessible_clear_cache (gpointer fixture, gconstpointer user_data) +atk_test_accessible_clear_cache (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; atspi_accessible_clear_cache (obj); atk_test_check_cache_cleared (obj); } static void -atk_test_accessible_get_process_id (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_process_id (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; guint proc_id = atspi_accessible_get_process_id (obj, NULL); g_assert_cmpint (proc_id, ==, fixture->child_pid); } @@ -381,74 +381,74 @@ atk_test_accessible_get_process_id (gpointer fixture, gconstpointer user_data) void atk_test_accessible (void) { - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_name", - 0, NULL, NULL, atk_test_accessible_get_name, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_description", - 0, NULL, NULL, atk_test_accessible_get_description, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_child_count", - 0, NULL, NULL, atk_test_accessible_get_child_count, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_parent", - 0, NULL, NULL, atk_test_accessible_get_parent, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_child_at_index", - 0, NULL, NULL, atk_test_accessible_get_child_at_index, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_index_in_parent", - 0, NULL, NULL, atk_test_accessible_get_index_in_parent, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_relation_set_1", - 0, NULL, NULL, atk_test_accessible_get_relation_set_1, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_relation_set_2", - 0, NULL, NULL, atk_test_accessible_get_relation_set_2, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_role", - 0, NULL, NULL, atk_test_accessible_get_role, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_role_name", - 0, NULL, NULL, atk_test_accessible_get_role_name, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_localized_role_name", - 0, NULL, NULL, atk_test_accessible_get_localized_role_name, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_state_set", - 0, NULL, NULL, atk_test_accessible_get_state_set, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_attributes", - 0, NULL, NULL, atk_test_accessible_get_attributes, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_attributes_as_array", - 0, NULL, NULL, atk_test_accessible_get_attributes_as_array, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_toolkit_name", - 0, NULL, NULL, atk_test_accessible_get_toolkit_name, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_toolkit_version", - 0, NULL, NULL, atk_test_accessible_get_toolkit_version, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_atspi_version", - 0, NULL, NULL, atk_test_accessible_get_atspi_version, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_id", - 0, NULL, NULL, atk_test_accessible_get_id, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_application", - 0, NULL, NULL, atk_test_accessible_get_application, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_action_iface", - 0, NULL, NULL, atk_test_accessible_get_action_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_collection_iface", - 0, NULL, NULL, atk_test_accessible_get_collection_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_component_iface", - 0, NULL, NULL, atk_test_accessible_get_component_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_document_iface", - 0, NULL, NULL, atk_test_accessible_get_document_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_editable_text_iface", - 0, NULL, NULL, atk_test_accessible_get_editable_text_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_hypertext_iface", - 0, NULL, NULL, atk_test_accessible_get_hypertext_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_image_iface", - 0, NULL, NULL, atk_test_accessible_get_image_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_selection_iface", - 0, NULL, NULL, atk_test_accessible_get_selection_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_table_iface", - 0, NULL, NULL, atk_test_accessible_get_table_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_text_iface", - 0, NULL, NULL, atk_test_accessible_get_text_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_value_iface", - 0, NULL, NULL, atk_test_accessible_get_value_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_interfaces", - 0, NULL, NULL, atk_test_accessible_get_interfaces, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_object_locale", - 0, NULL, NULL, atk_test_accessible_get_object_locale, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_set_cache_mask", - 0, NULL, NULL, atk_test_accessible_set_cache_mask, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_clear_cache", - 0, NULL, NULL, atk_test_accessible_clear_cache, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_process_id", - 0, NULL, NULL, atk_test_accessible_get_process_id, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_name", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_name, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_description", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_description, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_child_count", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_child_count, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_parent", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_parent, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_child_at_index", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_child_at_index, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_index_in_parent", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_index_in_parent, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_relation_set_1", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_relation_set_1, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_relation_set_2", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_relation_set_2, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_role", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_role, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_role_name", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_role_name, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_localized_role_name", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_localized_role_name, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_state_set", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_state_set, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_attributes", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_attributes, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_attributes_as_array", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_attributes_as_array, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_toolkit_name", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_toolkit_name, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_toolkit_version", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_toolkit_version, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_atspi_version", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_atspi_version, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_id", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_id, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_application", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_application, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_action_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_action_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_collection_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_collection_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_component_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_component_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_document_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_document_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_editable_text_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_editable_text_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_hypertext_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_hypertext_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_image_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_image_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_selection_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_selection_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_table_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_table_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_text_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_text_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_value_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_value_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_interfaces", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_interfaces, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_object_locale", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_object_locale, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_set_cache_mask", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_set_cache_mask, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_clear_cache", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_clear_cache, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_process_id", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_process_id, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_action.c b/tests/at-spi2-atk/atk_test_action.c index 32b2ce10..f520f646 100644 --- a/tests/at-spi2-atk/atk_test_action.c +++ b/tests/at-spi2-atk/atk_test_action.c @@ -26,9 +26,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-action.xml" static void -atk_test_action_sample_get_interface (gpointer fixture, gconstpointer user_data) +atk_test_action_sample_get_interface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiAction *iface = atspi_accessible_get_action_iface (child); @@ -36,54 +36,54 @@ atk_test_action_sample_get_interface (gpointer fixture, gconstpointer user_data) } static void -atk_test_action_get_action_description (gpointer fixture, gconstpointer user_data) +atk_test_action_get_action_description (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiAction *action = atspi_accessible_get_action_iface (child); g_assert_cmpstr (atspi_action_get_action_description (action, 0, NULL), ==, "action1 description"); } static void -atk_test_action_get_action_name (gpointer fixture, gconstpointer user_data) +atk_test_action_get_action_name (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiAction *action = atspi_accessible_get_action_iface (child); g_assert_cmpstr (atspi_action_get_action_name (action, 0, NULL), ==, "action1"); } static void -atk_test_action_get_n_actions (gpointer fixture, gconstpointer user_data) +atk_test_action_get_n_actions (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiAction *action = atspi_accessible_get_action_iface (child); g_assert_cmpint (atspi_action_get_n_actions (action, NULL), ==, 2); } static void -atk_test_action_get_key_binding (gpointer fixture, gconstpointer user_data) +atk_test_action_get_key_binding (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiAction *action = atspi_accessible_get_action_iface (child); g_assert_cmpstr (atspi_action_get_key_binding (action, 0, NULL), ==, "action1 key binding"); } static void -atk_test_action_get_localized_name (gpointer fixture, gconstpointer user_data) +atk_test_action_get_localized_name (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiAction *action = atspi_accessible_get_action_iface (child); g_assert_cmpstr (atspi_action_get_localized_name (action, 0, NULL), ==, "action1"); } static void -atk_test_action_do_action (gpointer fixture, gconstpointer user_data) +atk_test_action_do_action (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiAction *action = atspi_accessible_get_action_iface (child); g_assert (action != NULL); @@ -97,18 +97,18 @@ atk_test_action_do_action (gpointer fixture, gconstpointer user_data) void atk_test_action (void) { - g_test_add_vtable (ATK_TEST_PATH_ACTION "/atk_test_action_sample_get_interface", - 0, NULL, NULL, atk_test_action_sample_get_interface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACTION "/atk_test_action_get_action_description", - 0, NULL, NULL, atk_test_action_get_action_description, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACTION "/atk_test_action_get_action_name", - 0, NULL, NULL, atk_test_action_get_action_name, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACTION "/atk_test_action_get_n_actions", - 0, NULL, NULL, atk_test_action_get_n_actions, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACTION "/atk_test_action_get_key_binding", - 0, NULL, NULL, atk_test_action_get_key_binding, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACTION "/atk_test_action_get_localized_name", - 0, NULL, NULL, atk_test_action_get_localized_name, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACTION "/atk_test_action_do_action", - 0, NULL, NULL, atk_test_action_do_action, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACTION "/atk_test_action_sample_get_interface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_action_sample_get_interface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACTION "/atk_test_action_get_action_description", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_action_get_action_description, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACTION "/atk_test_action_get_action_name", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_action_get_action_name, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACTION "/atk_test_action_get_n_actions", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_action_get_n_actions, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACTION "/atk_test_action_get_key_binding", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_action_get_key_binding, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACTION "/atk_test_action_get_localized_name", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_action_get_localized_name, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACTION "/atk_test_action_do_action", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_action_do_action, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_collection.c b/tests/at-spi2-atk/atk_test_collection.c index c5837857..ee099d07 100644 --- a/tests/at-spi2-atk/atk_test_collection.c +++ b/tests/at-spi2-atk/atk_test_collection.c @@ -26,17 +26,17 @@ #define DATA_FILE TESTS_DATA_DIR "/test-collection.xml" static void -atk_test_collection_get_collection_iface (gpointer fixture, gconstpointer user_data) +atk_test_collection_get_collection_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiCollection *iface = atspi_accessible_get_collection_iface (obj); g_assert (iface); } static void -atk_test_collection_get_matches (gpointer fixture, gconstpointer user_data) +atk_test_collection_get_matches (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiCollection *iface = atspi_accessible_get_collection_iface (obj); g_assert (iface); @@ -70,9 +70,9 @@ atk_test_collection_get_matches (gpointer fixture, gconstpointer user_data) } static void -atk_test_collection_get_matches_to (gpointer fixture, gconstpointer user_data) +atk_test_collection_get_matches_to (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiCollection *iface = atspi_accessible_get_collection_iface (obj); g_assert (iface); @@ -107,9 +107,9 @@ atk_test_collection_get_matches_to (gpointer fixture, gconstpointer user_data) } static void -atk_test_collection_get_matches_from (gpointer fixture, gconstpointer user_data) +atk_test_collection_get_matches_from (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiCollection *iface = atspi_accessible_get_collection_iface (obj); g_assert (iface); @@ -149,12 +149,12 @@ atk_test_collection_get_matches_from (gpointer fixture, gconstpointer user_data) void atk_test_collection (void) { - g_test_add_vtable (ATK_TEST_PATH_COLLECTION "/atk_test_collection_get_collection_iface", - 0, NULL, NULL, atk_test_collection_get_collection_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_COLLECTION "/atk_test_collection_get_matches", - 0, NULL, NULL, atk_test_collection_get_matches, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_COLLECTION "/atk_test_collection_get_matches_to", - 0, NULL, NULL, atk_test_collection_get_matches_to, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_COLLECTION "/atk_test_collection_get_matches_from", - 0, NULL, NULL, atk_test_collection_get_matches_from, fixture_teardown); + g_test_add (ATK_TEST_PATH_COLLECTION "/atk_test_collection_get_collection_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_collection_get_collection_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_COLLECTION "/atk_test_collection_get_matches", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_collection_get_matches, fixture_teardown); + g_test_add (ATK_TEST_PATH_COLLECTION "/atk_test_collection_get_matches_to", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_collection_get_matches_to, fixture_teardown); + g_test_add (ATK_TEST_PATH_COLLECTION "/atk_test_collection_get_matches_from", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_collection_get_matches_from, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_component.c b/tests/at-spi2-atk/atk_test_component.c index a4e78b1e..8aebf035 100644 --- a/tests/at-spi2-atk/atk_test_component.c +++ b/tests/at-spi2-atk/atk_test_component.c @@ -26,9 +26,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-component.xml" static void -atk_test_component_sample (gpointer fixture, gconstpointer user_data) +atk_test_component_sample (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiComponent *iface = atspi_accessible_get_component_iface (child); @@ -36,9 +36,9 @@ atk_test_component_sample (gpointer fixture, gconstpointer user_data) } static void -atk_test_component_contains (gpointer fixture, gconstpointer user_data) +atk_test_component_contains (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiComponent *iface = atspi_accessible_get_component_iface (child); g_assert (iface != NULL); @@ -48,9 +48,9 @@ atk_test_component_contains (gpointer fixture, gconstpointer user_data) } static void -atk_test_component_get_accessible_at_point (gpointer fixture, gconstpointer user_data) +atk_test_component_get_accessible_at_point (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiComponent *iface = atspi_accessible_get_component_iface (child); g_assert (iface != NULL); @@ -64,9 +64,9 @@ atk_test_component_get_accessible_at_point (gpointer fixture, gconstpointer user } static void -atk_test_component_get_extents (gpointer fixture, gconstpointer user_data) +atk_test_component_get_extents (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiComponent *iface = atspi_accessible_get_component_iface (child); g_assert (iface != NULL); @@ -80,9 +80,9 @@ atk_test_component_get_extents (gpointer fixture, gconstpointer user_data) } static void -atk_test_component_get_layer (gpointer fixture, gconstpointer user_data) +atk_test_component_get_layer (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiComponent *iface = atspi_accessible_get_component_iface (child); g_assert (iface != NULL); @@ -92,9 +92,9 @@ atk_test_component_get_layer (gpointer fixture, gconstpointer user_data) } static void -atk_test_component_get_mdi_z_order (gpointer fixture, gconstpointer user_data) +atk_test_component_get_mdi_z_order (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiComponent *iface = atspi_accessible_get_component_iface (child); g_assert (iface != NULL); @@ -104,9 +104,9 @@ atk_test_component_get_mdi_z_order (gpointer fixture, gconstpointer user_data) } static void -atk_test_component_grab_focus (gpointer fixture, gconstpointer user_data) +atk_test_component_grab_focus (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiComponent *iface = atspi_accessible_get_component_iface (child); g_assert (iface != NULL); @@ -116,9 +116,9 @@ atk_test_component_grab_focus (gpointer fixture, gconstpointer user_data) } static void -atk_test_component_get_alpha (gpointer fixture, gconstpointer user_data) +atk_test_component_get_alpha (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiComponent *iface = atspi_accessible_get_component_iface (child); g_assert (iface != NULL); @@ -128,9 +128,9 @@ atk_test_component_get_alpha (gpointer fixture, gconstpointer user_data) } static void -atk_test_component_set_extents (gpointer fixture, gconstpointer user_data) +atk_test_component_set_extents (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiComponent *iface = atspi_accessible_get_component_iface (child); g_assert (iface != NULL); @@ -156,22 +156,22 @@ atk_test_component_set_extents (gpointer fixture, gconstpointer user_data) void atk_test_component (void) { - g_test_add_vtable (ATK_TEST_PATH_COMP "/atk_test_component_sample", - 0, NULL, NULL, atk_test_component_sample, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_COMP "/atk_test_component_contains", - 0, NULL, NULL, atk_test_component_contains, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_COMP "/atk_test_component_get_accessible_at_point", - 0, NULL, NULL, atk_test_component_get_accessible_at_point, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_COMP "/atk_test_component_get_extents", - 0, NULL, NULL, atk_test_component_get_extents, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_COMP "/atk_test_component_get_layer", - 0, NULL, NULL, atk_test_component_get_layer, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_COMP "/atk_test_component_get_mdi_z_order", - 0, NULL, NULL, atk_test_component_get_mdi_z_order, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_COMP "/atk_test_component_grab_focus", - 0, NULL, NULL, atk_test_component_grab_focus, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_COMP "/atk_test_component_get_alpha", - 0, NULL, NULL, atk_test_component_get_alpha, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_COMP "/atk_test_component_set_extents", - 0, NULL, NULL, atk_test_component_set_extents, fixture_teardown); + g_test_add (ATK_TEST_PATH_COMP "/atk_test_component_sample", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_component_sample, fixture_teardown); + g_test_add (ATK_TEST_PATH_COMP "/atk_test_component_contains", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_component_contains, fixture_teardown); + g_test_add (ATK_TEST_PATH_COMP "/atk_test_component_get_accessible_at_point", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_component_get_accessible_at_point, fixture_teardown); + g_test_add (ATK_TEST_PATH_COMP "/atk_test_component_get_extents", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_component_get_extents, fixture_teardown); + g_test_add (ATK_TEST_PATH_COMP "/atk_test_component_get_layer", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_component_get_layer, fixture_teardown); + g_test_add (ATK_TEST_PATH_COMP "/atk_test_component_get_mdi_z_order", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_component_get_mdi_z_order, fixture_teardown); + g_test_add (ATK_TEST_PATH_COMP "/atk_test_component_grab_focus", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_component_grab_focus, fixture_teardown); + g_test_add (ATK_TEST_PATH_COMP "/atk_test_component_get_alpha", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_component_get_alpha, fixture_teardown); + g_test_add (ATK_TEST_PATH_COMP "/atk_test_component_set_extents", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_component_set_extents, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_document.c b/tests/at-spi2-atk/atk_test_document.c index 7e020709..6f750e63 100644 --- a/tests/at-spi2-atk/atk_test_document.c +++ b/tests/at-spi2-atk/atk_test_document.c @@ -1,6 +1,6 @@ /* - * AT-SPI - Assistive Technology Service Provider Interface - * (Gnome Accessibility Project; https://wiki.gnome.org/Accessibility) + * AT-SPI - Assistive Service Provider Interface + * (Gnome AccessibiliTestAppFixture, DATA_FILE, fixture_setup://wiki.gnome.org/Accessibility) * * Copyright (c) 2014 Samsung Electronics Co., Ltd. * @@ -26,18 +26,18 @@ #define DATA_FILE TESTS_DATA_DIR "/test-document.xml" static void -atk_test_document_get_document_iface (gpointer fixture, gconstpointer user_data) +atk_test_document_get_document_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiDocument *iface = atspi_accessible_get_document_iface (child); g_assert (iface != NULL); } static void -atk_test_document_get_locale (gpointer fixture, gconstpointer user_data) +atk_test_document_get_locale (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiDocument *iface = atspi_accessible_get_document_iface (child); g_assert (iface != NULL); @@ -46,9 +46,9 @@ atk_test_document_get_locale (gpointer fixture, gconstpointer user_data) } static void -atk_test_document_get_attribute_value (gpointer fixture, gconstpointer user_data) +atk_test_document_get_attribute_value (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiDocument *iface = atspi_accessible_get_document_iface (child); g_assert (iface != NULL); @@ -58,9 +58,9 @@ atk_test_document_get_attribute_value (gpointer fixture, gconstpointer user_data } static void -atk_test_document_get_attributes (gpointer fixture, gconstpointer user_data) +atk_test_document_get_attributes (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiDocument *iface = atspi_accessible_get_document_iface (child); g_assert (iface != NULL); @@ -93,12 +93,12 @@ atk_test_document_get_attributes (gpointer fixture, gconstpointer user_data) void atk_test_document (void) { - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_document_iface", - 0, NULL, NULL, atk_test_document_get_document_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_locale", - 0, NULL, NULL, atk_test_document_get_locale, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_attribute_value", - 0, NULL, NULL, atk_test_document_get_attribute_value, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_attributes", - 0, NULL, NULL, atk_test_document_get_attributes, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_document_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_document_get_document_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_locale", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_document_get_locale, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_attribute_value", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_document_get_attribute_value, fixture_teardown); + g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_attributes", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_document_get_attributes, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_editable_text.c b/tests/at-spi2-atk/atk_test_editable_text.c index ddb5b365..a0ad323d 100644 --- a/tests/at-spi2-atk/atk_test_editable_text.c +++ b/tests/at-spi2-atk/atk_test_editable_text.c @@ -26,9 +26,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-editable-text.xml" static void -atk_test_editable_text_get_editable_text_iface (gpointer fixture, gconstpointer user_data) +atk_test_editable_text_get_editable_text_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiEditableText *iface = atspi_accessible_get_editable_text_iface (child); g_assert (iface != NULL); @@ -37,9 +37,9 @@ atk_test_editable_text_get_editable_text_iface (gpointer fixture, gconstpointer #if 0 /* Function is in docs but not implemented */ static void -atk_test_editable_text_set_attributes (gpointer fixture, gconstpointer user_data) +atk_test_editable_text_set_attributes (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiEditableText *iface = atspi_accessible_get_editable_text_iface (child); g_assert (iface != NULL); @@ -49,9 +49,9 @@ atk_test_editable_text_set_attributes (gpointer fixture, gconstpointer user_dat #endif static void -atk_test_editable_text_insert_text (gpointer fixture, gconstpointer user_data) +atk_test_editable_text_insert_text (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiEditableText *iface = atspi_accessible_get_editable_text_iface (child); g_assert (iface != NULL); @@ -59,9 +59,9 @@ atk_test_editable_text_insert_text (gpointer fixture, gconstpointer user_data) } static void -atk_test_editable_text_copy_text (gpointer fixture, gconstpointer user_data) +atk_test_editable_text_copy_text (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiEditableText *iface = atspi_accessible_get_editable_text_iface (child); g_assert (iface != NULL); @@ -69,9 +69,9 @@ atk_test_editable_text_copy_text (gpointer fixture, gconstpointer user_data) } static void -atk_test_editable_text_cut_text (gpointer fixture, gconstpointer user_data) +atk_test_editable_text_cut_text (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiEditableText *iface = atspi_accessible_get_editable_text_iface (child); g_assert (iface != NULL); @@ -79,9 +79,9 @@ atk_test_editable_text_cut_text (gpointer fixture, gconstpointer user_data) } static void -atk_test_editable_text_delete_text (gpointer fixture, gconstpointer user_data) +atk_test_editable_text_delete_text (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiEditableText *iface = atspi_accessible_get_editable_text_iface (child); g_assert (iface != NULL); @@ -90,9 +90,9 @@ atk_test_editable_text_delete_text (gpointer fixture, gconstpointer user_data) } static void -atk_test_editable_text_paste_text (gpointer fixture, gconstpointer user_data) +atk_test_editable_text_paste_text (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiEditableText *iface = atspi_accessible_get_editable_text_iface (child); g_assert (iface != NULL); @@ -103,20 +103,20 @@ atk_test_editable_text_paste_text (gpointer fixture, gconstpointer user_data) void atk_test_editable_text (void) { - g_test_add_vtable (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_get_editable_text_iface", - 0, NULL, NULL, atk_test_editable_text_get_editable_text_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_get_editable_text_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_editable_text_get_editable_text_iface, fixture_teardown); #if 0 - g_test_add_vtable (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_set_attributes", - 0, NULL, NULL, atk_test_editable_text_set_attributes, fixture_teardown); + g_test_add (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_set_attributes", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_editable_text_set_attributes, fixture_teardown); #endif - g_test_add_vtable (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_insert_text", - 0, NULL, NULL, atk_test_editable_text_insert_text, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_copy_text", - 0, NULL, NULL, atk_test_editable_text_copy_text, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_cut_text", - 0, NULL, NULL, atk_test_editable_text_cut_text, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_delete_text", - 0, NULL, NULL, atk_test_editable_text_delete_text, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_paste_text", - 0, NULL, NULL, atk_test_editable_text_paste_text, fixture_teardown); + g_test_add (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_insert_text", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_editable_text_insert_text, fixture_teardown); + g_test_add (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_copy_text", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_editable_text_copy_text, fixture_teardown); + g_test_add (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_cut_text", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_editable_text_cut_text, fixture_teardown); + g_test_add (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_delete_text", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_editable_text_delete_text, fixture_teardown); + g_test_add (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_paste_text", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_editable_text_paste_text, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_hyperlink.c b/tests/at-spi2-atk/atk_test_hyperlink.c index a78ddf71..78bfeedd 100644 --- a/tests/at-spi2-atk/atk_test_hyperlink.c +++ b/tests/at-spi2-atk/atk_test_hyperlink.c @@ -24,9 +24,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-hypertext.xml" static void -atk_test_hyperlink_get_n_anchors (gpointer fixture, gconstpointer user_data) +atk_test_hyperlink_get_n_anchors (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -39,9 +39,9 @@ atk_test_hyperlink_get_n_anchors (gpointer fixture, gconstpointer user_data) } static void -atk_test_hyperlink_get_uri (gpointer fixture, gconstpointer user_data) +atk_test_hyperlink_get_uri (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -55,9 +55,9 @@ atk_test_hyperlink_get_uri (gpointer fixture, gconstpointer user_data) } static void -atk_test_hyperlink_get_object (gpointer fixture, gconstpointer user_data) +atk_test_hyperlink_get_object (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -75,9 +75,9 @@ atk_test_hyperlink_get_object (gpointer fixture, gconstpointer user_data) } static void -atk_test_hyperlink_get_index_range (gpointer fixture, gconstpointer user_data) +atk_test_hyperlink_get_index_range (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -96,9 +96,9 @@ atk_test_hyperlink_get_index_range (gpointer fixture, gconstpointer user_data) } static void -atk_test_hyperlink_get_start_index (gpointer fixture, gconstpointer user_data) +atk_test_hyperlink_get_start_index (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -111,9 +111,9 @@ atk_test_hyperlink_get_start_index (gpointer fixture, gconstpointer user_data) } static void -atk_test_hyperlink_get_end_index (gpointer fixture, gconstpointer user_data) +atk_test_hyperlink_get_end_index (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -126,9 +126,9 @@ atk_test_hyperlink_get_end_index (gpointer fixture, gconstpointer user_data) } static void -atk_test_hyperlink_is_valid (gpointer fixture, gconstpointer user_data) +atk_test_hyperlink_is_valid (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -142,18 +142,18 @@ atk_test_hyperlink_is_valid (gpointer fixture, gconstpointer user_data) void atk_test_hyperlink (void) { - g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_n_anchors", - 0, NULL, NULL, atk_test_hyperlink_get_n_anchors, fixture_teardown); - g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_uri", - 0, NULL, NULL, atk_test_hyperlink_get_uri, fixture_teardown); - g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_object", - 0, NULL, NULL, atk_test_hyperlink_get_object, fixture_teardown); - g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_index_range", - 0, NULL, NULL, atk_test_hyperlink_get_index_range, fixture_teardown); - g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_start_index", - 0, NULL, NULL, atk_test_hyperlink_get_start_index, fixture_teardown); - g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_end_index", - 0, NULL, NULL, atk_test_hyperlink_get_end_index, fixture_teardown); - g_test_add_vtable(ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_is_valid", - 0, NULL, NULL, atk_test_hyperlink_is_valid, fixture_teardown); + g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_n_anchors", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_hyperlink_get_n_anchors, fixture_teardown); + g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_uri", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_hyperlink_get_uri, fixture_teardown); + g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_object", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_hyperlink_get_object, fixture_teardown); + g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_index_range", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_hyperlink_get_index_range, fixture_teardown); + g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_start_index", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_hyperlink_get_start_index, fixture_teardown); + g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_end_index", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_hyperlink_get_end_index, fixture_teardown); + g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_is_valid", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_hyperlink_is_valid, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_hypertext.c b/tests/at-spi2-atk/atk_test_hypertext.c index 3571ada1..e4fd862d 100644 --- a/tests/at-spi2-atk/atk_test_hypertext.c +++ b/tests/at-spi2-atk/atk_test_hypertext.c @@ -24,9 +24,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-hypertext.xml" static void -atk_test_hypertext_get_n_links (gpointer fixture, gconstpointer user_data) +atk_test_hypertext_get_n_links (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -37,9 +37,9 @@ atk_test_hypertext_get_n_links (gpointer fixture, gconstpointer user_data) } static void -atk_test_hypertext_get_link (gpointer fixture, gconstpointer user_data) +atk_test_hypertext_get_link (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -61,9 +61,9 @@ atk_test_hypertext_get_link (gpointer fixture, gconstpointer user_data) } static void -atk_test_hypertext_get_link_index (gpointer fixture, gconstpointer user_data) +atk_test_hypertext_get_link_index (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -80,10 +80,10 @@ atk_test_hypertext_get_link_index (gpointer fixture, gconstpointer user_data) void atk_test_hypertext (void) { - g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hypertext_get_n_links", - 0, NULL, NULL, atk_test_hypertext_get_n_links, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hypertext_get_links", - 0, NULL, NULL, atk_test_hypertext_get_link, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hypertext_get_link_index", - 0, NULL, NULL, atk_test_hypertext_get_link_index, fixture_teardown); + g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hypertext_get_n_links", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_hypertext_get_n_links, fixture_teardown); + g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hypertext_get_links", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_hypertext_get_link, fixture_teardown); + g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hypertext_get_link_index", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_hypertext_get_link_index, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_image.c b/tests/at-spi2-atk/atk_test_image.c index 24e60746..f4bc4d06 100644 --- a/tests/at-spi2-atk/atk_test_image.c +++ b/tests/at-spi2-atk/atk_test_image.c @@ -26,9 +26,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-image.xml" static void -atk_test_image_sample_get_interface (gpointer fixture, gconstpointer user_data) +atk_test_image_sample_get_interface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiImage *iface = atspi_accessible_get_image_iface (child); @@ -36,9 +36,9 @@ atk_test_image_sample_get_interface (gpointer fixture, gconstpointer user_data) } static void -atk_test_image_get_image_description (gpointer fixture, gconstpointer user_data) +atk_test_image_get_image_description (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiImage *image = atspi_accessible_get_image_iface (child); gchar *desc = atspi_image_get_image_description (image, NULL); @@ -48,9 +48,9 @@ atk_test_image_get_image_description (gpointer fixture, gconstpointer user_data) } static void -atk_test_image_get_image_size (gpointer fixture, gconstpointer user_data) +atk_test_image_get_image_size (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiImage *image = atspi_accessible_get_image_iface (child); AtspiPoint *p = atspi_image_get_image_size (image, NULL); @@ -62,9 +62,9 @@ atk_test_image_get_image_size (gpointer fixture, gconstpointer user_data) } static void -atk_test_image_get_image_position (gpointer fixture, gconstpointer user_data) +atk_test_image_get_image_position (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiImage *image = atspi_accessible_get_image_iface (child); AtspiPoint *p = atspi_image_get_image_position (image, ATSPI_COORD_TYPE_SCREEN, NULL); @@ -75,9 +75,9 @@ atk_test_image_get_image_position (gpointer fixture, gconstpointer user_data) } static void -atk_test_image_get_image_extents (gpointer fixture, gconstpointer user_data) +atk_test_image_get_image_extents (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiImage *image = atspi_accessible_get_image_iface (child); AtspiRect *r = atspi_image_get_image_extents (image, ATSPI_COORD_TYPE_SCREEN, NULL); @@ -92,9 +92,9 @@ atk_test_image_get_image_extents (gpointer fixture, gconstpointer user_data) } static void -atk_test_image_get_image_locale (gpointer fixture, gconstpointer user_data) +atk_test_image_get_image_locale (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 1, NULL); AtspiImage *image = atspi_accessible_get_image_iface (child); gchar *locale = atspi_image_get_image_locale (image, NULL); @@ -107,16 +107,16 @@ atk_test_image_get_image_locale (gpointer fixture, gconstpointer user_data) void atk_test_image (void) { - g_test_add_vtable (ATK_TEST_PATH_IMAGE "/atk_test_image_sample_get_interface", - 0, NULL, NULL, atk_test_image_sample_get_interface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_IMAGE "/atk_test_image_get_image_description", - 0, NULL, NULL, atk_test_image_get_image_description, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_IMAGE "/atk_test_image_get_image_size", - 0, NULL, NULL, atk_test_image_get_image_size, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_IMAGE "/atk_test_image_get_image_position", - 0, NULL, NULL, atk_test_image_get_image_position, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_IMAGE "/atk_test_image_get_image_extents", - 0, NULL, NULL, atk_test_image_get_image_extents, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_IMAGE "/atk_test_image_get_image_locale", - 0, NULL, NULL, atk_test_image_get_image_locale, fixture_teardown); + g_test_add (ATK_TEST_PATH_IMAGE "/atk_test_image_sample_get_interface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_image_sample_get_interface, fixture_teardown); + g_test_add (ATK_TEST_PATH_IMAGE "/atk_test_image_get_image_description", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_image_get_image_description, fixture_teardown); + g_test_add (ATK_TEST_PATH_IMAGE "/atk_test_image_get_image_size", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_image_get_image_size, fixture_teardown); + g_test_add (ATK_TEST_PATH_IMAGE "/atk_test_image_get_image_position", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_image_get_image_position, fixture_teardown); + g_test_add (ATK_TEST_PATH_IMAGE "/atk_test_image_get_image_extents", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_image_get_image_extents, fixture_teardown); + g_test_add (ATK_TEST_PATH_IMAGE "/atk_test_image_get_image_locale", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_image_get_image_locale, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_selection.c b/tests/at-spi2-atk/atk_test_selection.c index 4717f00a..c706b0d9 100644 --- a/tests/at-spi2-atk/atk_test_selection.c +++ b/tests/at-spi2-atk/atk_test_selection.c @@ -26,9 +26,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-selection.xml" static void -atk_test_selection_sample_get_interface (gpointer fixture, gconstpointer user_data) +atk_test_selection_sample_get_interface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiSelection *iface = atspi_accessible_get_selection_iface (child); @@ -36,9 +36,9 @@ atk_test_selection_sample_get_interface (gpointer fixture, gconstpointer user_da } static void -atk_test_selection_get_n_selected_children (gpointer fixture, gconstpointer user_data) +atk_test_selection_get_n_selected_children (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiSelection *iface = atspi_accessible_get_selection_iface (child); @@ -48,9 +48,9 @@ atk_test_selection_get_n_selected_children (gpointer fixture, gconstpointer user } static void -atk_test_selection_get_selected_child (gpointer fixture, gconstpointer user_data) +atk_test_selection_get_selected_child (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiSelection *iface = atspi_accessible_get_selection_iface (child); @@ -69,9 +69,9 @@ atk_test_selection_get_selected_child (gpointer fixture, gconstpointer user_data } static void -atk_test_selection_select_child (gpointer fixture, gconstpointer user_data) +atk_test_selection_select_child (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiSelection *iface = atspi_accessible_get_selection_iface (child); @@ -85,9 +85,9 @@ atk_test_selection_select_child (gpointer fixture, gconstpointer user_data) } static void -atk_test_selection_deselect_selected (gpointer fixture, gconstpointer user_data) +atk_test_selection_deselect_selected (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiSelection *iface = atspi_accessible_get_selection_iface (child); @@ -104,9 +104,9 @@ atk_test_selection_deselect_selected (gpointer fixture, gconstpointer user_data) } static void -atk_test_selection_deselect_child (gpointer fixture, gconstpointer user_data) +atk_test_selection_deselect_child (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiSelection *iface = atspi_accessible_get_selection_iface (child); @@ -123,9 +123,9 @@ atk_test_selection_deselect_child (gpointer fixture, gconstpointer user_data) } static void -atk_test_selection_is_child_selected (gpointer fixture, gconstpointer user_data) +atk_test_selection_is_child_selected (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiSelection *iface = atspi_accessible_get_selection_iface (child); @@ -139,9 +139,9 @@ atk_test_selection_is_child_selected (gpointer fixture, gconstpointer user_data) } static void -atk_test_selection_select_all (gpointer fixture, gconstpointer user_data) +atk_test_selection_select_all (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiSelection *iface = atspi_accessible_get_selection_iface (child); @@ -153,9 +153,9 @@ atk_test_selection_select_all (gpointer fixture, gconstpointer user_data) } static void -atk_test_selection_clear_selection (gpointer fixture, gconstpointer user_data) +atk_test_selection_clear_selection (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; g_assert_cmpstr (atspi_accessible_get_name (obj, NULL), ==, "root_object"); AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiSelection *iface = atspi_accessible_get_selection_iface (child); @@ -169,22 +169,22 @@ atk_test_selection_clear_selection (gpointer fixture, gconstpointer user_data) void atk_test_selection (void) { - g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_sample_get_interface", - 0, NULL, NULL, atk_test_selection_sample_get_interface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_get_n_selected_children", - 0, NULL, NULL, atk_test_selection_get_n_selected_children, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_get_selected_child", - 0, NULL, NULL, atk_test_selection_get_selected_child, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_select_child", - 0, NULL, NULL, atk_test_selection_select_child, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_deselect_selected", - 0, NULL, NULL, atk_test_selection_deselect_selected, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_deselect_child", - 0, NULL, NULL, atk_test_selection_deselect_child, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_is_child_selected", - 0, NULL, NULL, atk_test_selection_is_child_selected, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_select_all", - 0, NULL, NULL, atk_test_selection_select_all, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_SELECTION "/atk_test_selection_clear_selection", - 0, NULL, NULL, atk_test_selection_clear_selection, fixture_teardown); + g_test_add (ATK_TEST_PATH_SELECTION "/atk_test_selection_sample_get_interface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_sample_get_interface, fixture_teardown); + g_test_add (ATK_TEST_PATH_SELECTION "/atk_test_selection_get_n_selected_children", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_get_n_selected_children, fixture_teardown); + g_test_add (ATK_TEST_PATH_SELECTION "/atk_test_selection_get_selected_child", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_get_selected_child, fixture_teardown); + g_test_add (ATK_TEST_PATH_SELECTION "/atk_test_selection_select_child", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_select_child, fixture_teardown); + g_test_add (ATK_TEST_PATH_SELECTION "/atk_test_selection_deselect_selected", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_deselect_selected, fixture_teardown); + g_test_add (ATK_TEST_PATH_SELECTION "/atk_test_selection_deselect_child", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_deselect_child, fixture_teardown); + g_test_add (ATK_TEST_PATH_SELECTION "/atk_test_selection_is_child_selected", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_is_child_selected, fixture_teardown); + g_test_add (ATK_TEST_PATH_SELECTION "/atk_test_selection_select_all", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_select_all, fixture_teardown); + g_test_add (ATK_TEST_PATH_SELECTION "/atk_test_selection_clear_selection", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_selection_clear_selection, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_state_set.c b/tests/at-spi2-atk/atk_test_state_set.c index 3ba26411..d32fa875 100644 --- a/tests/at-spi2-atk/atk_test_state_set.c +++ b/tests/at-spi2-atk/atk_test_state_set.c @@ -26,9 +26,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-accessible.xml" static void -atk_test_accessible_get_state_set (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_state_set (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiStateSet *states = atspi_accessible_get_state_set (child); GArray *states_arr = atspi_state_set_get_states (states); @@ -48,7 +48,7 @@ atk_test_accessible_get_state_set (gpointer fixture, gconstpointer user_data) } static void -atk_test_state_set_new (gpointer fixture, gconstpointer user_data) +atk_test_state_set_new (TestAppFixture *fixture, gconstpointer user_data) { GArray *states_arr = g_array_new (FALSE, FALSE, sizeof (AtspiStateType)); @@ -66,9 +66,9 @@ atk_test_state_set_new (gpointer fixture, gconstpointer user_data) } static void -atk_test_state_set_set_by_name (gpointer fixture, gconstpointer user_data) +atk_test_state_set_set_by_name (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiStateSet *states = atspi_accessible_get_state_set (child); GArray *states_arr = atspi_state_set_get_states (states); @@ -86,9 +86,9 @@ atk_test_state_set_set_by_name (gpointer fixture, gconstpointer user_data) } static void -atk_test_state_set_add (gpointer fixture, gconstpointer user_data) +atk_test_state_set_add (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiStateSet *states = atspi_accessible_get_state_set (child); @@ -100,9 +100,9 @@ atk_test_state_set_add (gpointer fixture, gconstpointer user_data) } static void -atk_test_state_set_compare (gpointer fixture, gconstpointer user_data) +atk_test_state_set_compare (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiStateSet *states = atspi_accessible_get_state_set (child); GArray *states_arr = g_array_new (FALSE, FALSE, sizeof (AtspiStateType)); @@ -126,9 +126,9 @@ atk_test_state_set_compare (gpointer fixture, gconstpointer user_data) } static void -atk_test_state_set_contains (gpointer fixture, gconstpointer user_data) +atk_test_state_set_contains (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiStateSet *states = atspi_accessible_get_state_set (child); @@ -137,9 +137,9 @@ atk_test_state_set_contains (gpointer fixture, gconstpointer user_data) } static void -atk_test_state_set_equals (gpointer fixture, gconstpointer user_data) +atk_test_state_set_equals (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiStateSet *states = atspi_accessible_get_state_set (child); GArray *states_arr = g_array_new (FALSE, FALSE, sizeof (AtspiStateType)); @@ -158,9 +158,9 @@ atk_test_state_set_equals (gpointer fixture, gconstpointer user_data) } static void -atk_test_state_set_get_states (gpointer fixture, gconstpointer user_data) +atk_test_state_set_get_states (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiStateSet *states = atspi_accessible_get_state_set (child); GArray *states_arr = atspi_state_set_get_states (states); @@ -178,9 +178,9 @@ atk_test_state_set_get_states (gpointer fixture, gconstpointer user_data) } static void -atk_test_state_set_is_empty (gpointer fixture, gconstpointer user_data) +atk_test_state_set_is_empty (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiStateSet *states = atspi_accessible_get_state_set (child); AtspiStateSet *root_states = atspi_accessible_get_state_set (obj); @@ -190,9 +190,9 @@ atk_test_state_set_is_empty (gpointer fixture, gconstpointer user_data) } static void -atk_test_state_set_remove (gpointer fixture, gconstpointer user_data) +atk_test_state_set_remove (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *obj = get_root_obj (DATA_FILE); + AtspiAccessible *obj = fixture->root_obj; AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, 0, NULL); AtspiStateSet *states = atspi_accessible_get_state_set (child); GArray *states_arr = atspi_state_set_get_states (states); @@ -210,24 +210,24 @@ atk_test_state_set_remove (gpointer fixture, gconstpointer user_data) void atk_test_state_set (void) { - g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_accessible_get_state_set", - 0, NULL, NULL, atk_test_accessible_get_state_set, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_new", - 0, NULL, NULL, atk_test_state_set_new, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_set_by_name", - 0, NULL, NULL, atk_test_state_set_set_by_name, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_add", - 0, NULL, NULL, atk_test_state_set_add, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_compare", - 0, NULL, NULL, atk_test_state_set_compare, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_contains", - 0, NULL, NULL, atk_test_state_set_contains, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_equals", - 0, NULL, NULL, atk_test_state_set_equals, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_get_states", - 0, NULL, NULL, atk_test_state_set_get_states, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_is_empty", - 0, NULL, NULL, atk_test_state_set_is_empty, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_remove", - 0, NULL, NULL, atk_test_state_set_remove, fixture_teardown); + g_test_add (ATK_TEST_PATH_STATE_SET "/atk_test_accessible_get_state_set", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_state_set, fixture_teardown); + g_test_add (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_new", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_state_set_new, fixture_teardown); + g_test_add (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_set_by_name", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_state_set_set_by_name, fixture_teardown); + g_test_add (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_add", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_state_set_add, fixture_teardown); + g_test_add (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_compare", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_state_set_compare, fixture_teardown); + g_test_add (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_contains", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_state_set_contains, fixture_teardown); + g_test_add (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_equals", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_state_set_equals, fixture_teardown); + g_test_add (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_get_states", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_state_set_get_states, fixture_teardown); + g_test_add (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_is_empty", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_state_set_is_empty, fixture_teardown); + g_test_add (ATK_TEST_PATH_STATE_SET "/atk_test_state_set_remove", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_state_set_remove, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_table.c b/tests/at-spi2-atk/atk_test_table.c index f4416c45..6365298d 100644 --- a/tests/at-spi2-atk/atk_test_table.c +++ b/tests/at-spi2-atk/atk_test_table.c @@ -24,9 +24,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-table.xml" static void -atk_test_table_get_caption (gpointer fixture, gconstpointer user_data) +atk_test_table_get_caption (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -37,9 +37,9 @@ atk_test_table_get_caption (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_summary (gpointer fixture, gconstpointer user_data) +atk_test_table_get_summary (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -50,9 +50,9 @@ atk_test_table_get_summary (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_n_columns (gpointer fixture, gconstpointer user_data) +atk_test_table_get_n_columns (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -62,9 +62,9 @@ atk_test_table_get_n_columns (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_n_rows (gpointer fixture, gconstpointer user_data) +atk_test_table_get_n_rows (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -74,9 +74,9 @@ atk_test_table_get_n_rows (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_accessible_at (gpointer fixture, gconstpointer user_data) +atk_test_table_get_accessible_at (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -91,9 +91,9 @@ atk_test_table_get_accessible_at (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_index_at (gpointer fixture, gconstpointer user_data) +atk_test_table_get_index_at (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -110,9 +110,9 @@ atk_test_table_get_index_at (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_row_at_index (gpointer fixture, gconstpointer user_data) +atk_test_table_get_row_at_index (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -132,9 +132,9 @@ atk_test_table_get_row_at_index (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_column_at_index (gpointer fixture, gconstpointer user_data) +atk_test_table_get_column_at_index (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -151,9 +151,9 @@ atk_test_table_get_column_at_index (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_row_description (gpointer fixture, gconstpointer user_data) +atk_test_table_get_row_description (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -169,9 +169,9 @@ atk_test_table_get_row_description (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_column_description (gpointer fixture, gconstpointer user_data) +atk_test_table_get_column_description (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -187,9 +187,9 @@ atk_test_table_get_column_description (gpointer fixture, gconstpointer user_data } static void -atk_test_table_get_row_extent_at (gpointer fixture, gconstpointer user_data) +atk_test_table_get_row_extent_at (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -199,9 +199,9 @@ atk_test_table_get_row_extent_at (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_column_extent_at (gpointer fixture, gconstpointer user_data) +atk_test_table_get_column_extent_at (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -211,9 +211,9 @@ atk_test_table_get_column_extent_at (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_row_header (gpointer fixture, gconstpointer user_data) +atk_test_table_get_row_header (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -227,9 +227,9 @@ atk_test_table_get_row_header (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_column_header (gpointer fixture, gconstpointer user_data) +atk_test_table_get_column_header (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -246,9 +246,9 @@ atk_test_table_get_column_header (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_n_selected_rows (gpointer fixture, gconstpointer user_data) +atk_test_table_get_n_selected_rows (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -258,9 +258,9 @@ atk_test_table_get_n_selected_rows (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_selected_rows (gpointer fixture, gconstpointer user_data) +atk_test_table_get_selected_rows (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -274,9 +274,9 @@ atk_test_table_get_selected_rows (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_selected_columns (gpointer fixture, gconstpointer user_data) +atk_test_table_get_selected_columns (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -290,9 +290,9 @@ atk_test_table_get_selected_columns (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_get_n_selected_columns (gpointer fixture, gconstpointer user_data) +atk_test_table_get_n_selected_columns (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -304,9 +304,9 @@ atk_test_table_get_n_selected_columns (gpointer fixture, gconstpointer user_data } static void -atk_test_table_is_row_selected (gpointer fixture, gconstpointer user_data) +atk_test_table_is_row_selected (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -316,9 +316,9 @@ atk_test_table_is_row_selected (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_is_column_selected (gpointer fixture, gconstpointer user_data) +atk_test_table_is_column_selected (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -328,9 +328,9 @@ atk_test_table_is_column_selected (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_add_row_selection (gpointer fixture, gconstpointer user_data) +atk_test_table_add_row_selection (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -341,9 +341,9 @@ atk_test_table_add_row_selection (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_add_column_selection (gpointer fixture, gconstpointer user_data) +atk_test_table_add_column_selection (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -354,9 +354,9 @@ atk_test_table_add_column_selection (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_remove_row_selection (gpointer fixture, gconstpointer user_data) +atk_test_table_remove_row_selection (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -367,9 +367,9 @@ atk_test_table_remove_row_selection (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_remove_column_selection (gpointer fixture, gconstpointer user_data) +atk_test_table_remove_column_selection (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -380,9 +380,9 @@ atk_test_table_remove_column_selection (gpointer fixture, gconstpointer user_dat } static void -atk_test_table_get_row_column_extents_at_index (gpointer fixture, gconstpointer user_data) +atk_test_table_get_row_column_extents_at_index (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -402,9 +402,9 @@ atk_test_table_get_row_column_extents_at_index (gpointer fixture, gconstpointer } static void -atk_test_table_is_selected (gpointer fixture, gconstpointer user_data) +atk_test_table_is_selected (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -416,56 +416,56 @@ atk_test_table_is_selected (gpointer fixture, gconstpointer user_data) void atk_test_table (void) { - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_caption", - 0, NULL, NULL, atk_test_table_get_caption, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_summary", - 0, NULL, NULL, atk_test_table_get_summary, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_columns", - 0, NULL, NULL, atk_test_table_get_n_columns, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_rows", - 0, NULL, NULL, atk_test_table_get_n_rows, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_accessible_at", - 0, NULL, NULL, atk_test_table_get_accessible_at, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_index_at", - 0, NULL, NULL, atk_test_table_get_index_at, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_at_index", - 0, NULL, NULL, atk_test_table_get_row_at_index, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_at_index", - 0, NULL, NULL, atk_test_table_get_column_at_index, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_description", - 0, NULL, NULL, atk_test_table_get_row_description, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_description", - 0, NULL, NULL, atk_test_table_get_column_description, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_extent_at", - 0, NULL, NULL, atk_test_table_get_row_extent_at, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_extent_at", - 0, NULL, NULL, atk_test_table_get_column_extent_at, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_header", - 0, NULL, NULL, atk_test_table_get_row_header, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_header", - 0, NULL, NULL, atk_test_table_get_column_header, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_selected_rows", - 0, NULL, NULL, atk_test_table_get_n_selected_rows, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_selected_rows", - 0, NULL, NULL, atk_test_table_get_selected_rows, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_selected_columns", - 0, NULL, NULL, atk_test_table_get_selected_columns, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_selected_columns", - 0, NULL, NULL, atk_test_table_get_n_selected_columns, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_is_row_selected", - 0, NULL, NULL, atk_test_table_is_row_selected, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_is_column_selected", - 0, NULL, NULL, atk_test_table_is_column_selected, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_add_row_selection", - 0, NULL, NULL, atk_test_table_add_row_selection, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_add_column_selection", - 0, NULL, NULL, atk_test_table_add_column_selection, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_remove_row_selection", - 0, NULL, NULL, atk_test_table_remove_row_selection, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_remove_column_selection", - 0, NULL, NULL, atk_test_table_remove_column_selection, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_column_extents_at_index", - 0, NULL, NULL, atk_test_table_get_row_column_extents_at_index, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_is_selected", - 0, NULL, NULL, atk_test_table_is_selected, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_caption", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_caption, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_summary", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_summary, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_columns", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_n_columns, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_rows", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_n_rows, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_accessible_at", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_accessible_at, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_index_at", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_index_at, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_at_index", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_row_at_index, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_at_index", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_column_at_index, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_description", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_row_description, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_description", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_column_description, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_extent_at", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_row_extent_at, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_extent_at", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_column_extent_at, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_header", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_row_header, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_column_header", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_column_header, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_selected_rows", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_n_selected_rows, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_selected_rows", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_selected_rows, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_selected_columns", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_selected_columns, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_n_selected_columns", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_n_selected_columns, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_is_row_selected", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_is_row_selected, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_is_column_selected", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_is_column_selected, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_add_row_selection", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_add_row_selection, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_add_column_selection", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_add_column_selection, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_remove_row_selection", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_remove_row_selection, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_remove_column_selection", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_remove_column_selection, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_column_extents_at_index", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_get_row_column_extents_at_index, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_is_selected", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_is_selected, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_table_cell.c b/tests/at-spi2-atk/atk_test_table_cell.c index d5425208..d30b8044 100644 --- a/tests/at-spi2-atk/atk_test_table_cell.c +++ b/tests/at-spi2-atk/atk_test_table_cell.c @@ -24,9 +24,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-table.xml" static void -atk_test_accessible_get_table_cell (gpointer fixture, gconstpointer user_data) +atk_test_accessible_get_table_cell (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -37,9 +37,9 @@ atk_test_accessible_get_table_cell (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_cell_get_column_span (gpointer fixture, gconstpointer user_data) +atk_test_table_cell_get_column_span (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -59,9 +59,9 @@ atk_test_table_cell_get_column_span (gpointer fixture, gconstpointer user_data) /* static void -atk_test_table_cell_get_column_header_cells (gpointer fixture, gconstpointer user_data) +atk_test_table_cell_get_column_header_cells (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -76,9 +76,9 @@ atk_test_table_cell_get_column_header_cells (gpointer fixture, gconstpointer use */ static void -atk_test_table_cell_get_row_span (gpointer fixture, gconstpointer user_data) +atk_test_table_cell_get_row_span (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -98,9 +98,9 @@ atk_test_table_cell_get_row_span (gpointer fixture, gconstpointer user_data) /* static void -atk_test_table_cell_get_row_header_cells (gpointer fixture, gconstpointer user_data) +atk_test_table_cell_get_row_header_cells (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -115,9 +115,9 @@ atk_test_table_cell_get_row_header_cells (gpointer fixture, gconstpointer user_d */ static void -atk_test_table_cell_get_row_column_span (gpointer fixture, gconstpointer user_data) +atk_test_table_cell_get_row_column_span (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -140,9 +140,9 @@ atk_test_table_cell_get_row_column_span (gpointer fixture, gconstpointer user_da } static void -atk_test_table_cell_get_position (gpointer fixture, gconstpointer user_data) +atk_test_table_cell_get_position (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -162,9 +162,9 @@ atk_test_table_cell_get_position (gpointer fixture, gconstpointer user_data) } static void -atk_test_table_cell_get_table (gpointer fixture, gconstpointer user_data) +atk_test_table_cell_get_table (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -181,24 +181,24 @@ atk_test_table_cell_get_table (gpointer fixture, gconstpointer user_data) void atk_test_table_cell (void) { - g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_accessible_get_table_cell", - 0, NULL, NULL, atk_test_accessible_get_table_cell, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_column_span", - 0, NULL, NULL, atk_test_table_cell_get_column_span, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE_CELL "/atk_test_accessible_get_table_cell", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_accessible_get_table_cell, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_column_span", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_cell_get_column_span, fixture_teardown); /* - g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_column_header_cells", - 0, NULL, NULL, atk_test_table_cell_get_column_header_cells, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_column_header_cells", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_cell_get_column_header_cells, fixture_teardown); */ - g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_span", - 0, NULL, NULL, atk_test_table_cell_get_row_span, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_span", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_cell_get_row_span, fixture_teardown); /* - g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_header_cells", - 0, NULL, NULL, atk_test_table_cell_get_row_header_cells, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_header_cells", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_cell_get_row_header_cells, fixture_teardown); */ - g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_column_span", - 0, NULL, NULL, atk_test_table_cell_get_row_column_span, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_position", - 0, NULL, NULL, atk_test_table_cell_get_position, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_table", - 0, NULL, NULL, atk_test_table_cell_get_table, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_column_span", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_cell_get_row_column_span, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_position", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_cell_get_position, fixture_teardown); + g_test_add (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_table", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_table_cell_get_table, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_text.c b/tests/at-spi2-atk/atk_test_text.c index 35ab07f5..c8e41ef6 100644 --- a/tests/at-spi2-atk/atk_test_text.c +++ b/tests/at-spi2-atk/atk_test_text.c @@ -36,9 +36,9 @@ GHRunc_find (gpointer key, gpointer value, gpointer user_data) } static void -atk_test_text_get_character_count (gpointer fixture, gconstpointer user_data) +atk_test_text_get_character_count (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -49,9 +49,9 @@ atk_test_text_get_character_count (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_get_text (gpointer fixture, gconstpointer user_data) +atk_test_text_get_text (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -63,9 +63,9 @@ atk_test_text_get_text (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_get_caret_offset (gpointer fixture, gconstpointer user_data) +atk_test_text_get_caret_offset (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -76,9 +76,9 @@ atk_test_text_get_caret_offset (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_set_caret_offset (gpointer fixture, gconstpointer user_data) +atk_test_text_set_caret_offset (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -90,9 +90,9 @@ atk_test_text_set_caret_offset (gpointer fixture, gconstpointer user_data) g_assert_cmpint (pos, ==, 5); } static void -atk_test_text_get_character_at_offset (gpointer fixture, gconstpointer user_data) +atk_test_text_get_character_at_offset (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -103,9 +103,9 @@ atk_test_text_get_character_at_offset (gpointer fixture, gconstpointer user_data } static void -atk_test_text_get_character_extents (gpointer fixture, gconstpointer user_data) +atk_test_text_get_character_extents (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -121,9 +121,9 @@ atk_test_text_get_character_extents (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_get_range_extents (gpointer fixture, gconstpointer user_data) +atk_test_text_get_range_extents (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -140,9 +140,9 @@ atk_test_text_get_range_extents (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_add_selection (gpointer fixture, gconstpointer user_data) +atk_test_text_add_selection (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -152,9 +152,9 @@ atk_test_text_add_selection (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_get_n_selections (gpointer fixture, gconstpointer user_data) +atk_test_text_get_n_selections (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -170,9 +170,9 @@ atk_test_text_get_n_selections (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_get_selection (gpointer fixture, gconstpointer user_data) +atk_test_text_get_selection (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -195,9 +195,9 @@ atk_test_text_get_selection (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_set_selection (gpointer fixture, gconstpointer user_data) +atk_test_text_set_selection (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -222,9 +222,9 @@ atk_test_text_set_selection (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_remove_selection (gpointer fixture, gconstpointer user_data) +atk_test_text_remove_selection (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -248,9 +248,9 @@ atk_test_text_remove_selection (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_get_offset_at_point (gpointer fixture, gconstpointer user_data) +atk_test_text_get_offset_at_point (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -261,9 +261,9 @@ atk_test_text_get_offset_at_point (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_get_text_attribute_value (gpointer fixture, gconstpointer user_data) +atk_test_text_get_text_attribute_value (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -284,9 +284,9 @@ atk_test_text_get_text_attribute_value (gpointer fixture, gconstpointer user_dat } static void -atk_test_text_get_attribute_run (gpointer fixture, gconstpointer user_data) +atk_test_text_get_attribute_run (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -306,9 +306,9 @@ atk_test_text_get_attribute_run (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_get_defualt_attributes (gpointer fixture, gconstpointer user_data) +atk_test_text_get_default_attributes (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -324,9 +324,9 @@ atk_test_text_get_defualt_attributes (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_get_text_attributes (gpointer fixture, gconstpointer user_data) +atk_test_text_get_text_attributes (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -346,9 +346,9 @@ atk_test_text_get_text_attributes (gpointer fixture, gconstpointer user_data) } static void -atk_test_text_get_string_at_offset_s1 (gpointer fixture, gconstpointer user_data) +atk_test_text_get_string_at_offset_s1 (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -371,9 +371,9 @@ atk_test_text_get_string_at_offset_s1 (gpointer fixture, gconstpointer user_data g_free (range); } static void -atk_test_text_get_string_at_offset_s2 (gpointer fixture, gconstpointer user_data) +atk_test_text_get_string_at_offset_s2 (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 1, NULL); g_assert (child); @@ -405,9 +405,9 @@ atk_test_text_get_string_at_offset_s2 (gpointer fixture, gconstpointer user_data } static void -atk_test_text_get_bounded_ranges (gpointer fixture, gconstpointer user_data) +atk_test_text_get_bounded_ranges (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -434,44 +434,44 @@ atk_test_text_get_bounded_ranges (gpointer fixture, gconstpointer user_data) void atk_test_text (void) { - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_character_count", - 0, NULL, NULL, atk_test_text_get_character_count, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_text", - 0, NULL, NULL, atk_test_text_get_text, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_caret_offset", - 0, NULL, NULL, atk_test_text_get_caret_offset, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_text_attributes", - 0, NULL, NULL, atk_test_text_get_text_attributes, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_attribute_run", - 0, NULL, NULL, atk_test_text_get_attribute_run, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_text_attribute_value", - 0, NULL, NULL, atk_test_text_get_text_attribute_value, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_defualt_attributes", - 0, NULL, NULL, atk_test_text_get_defualt_attributes, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_set_caret_offset", - 0, NULL, NULL, atk_test_text_set_caret_offset, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_string_at_offset_s1", - 0, NULL, NULL, atk_test_text_get_string_at_offset_s1, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_string_at_offset_s2", - 0, NULL, NULL, atk_test_text_get_string_at_offset_s2, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_character_at_offset", - 0, NULL, NULL, atk_test_text_get_character_at_offset, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_character_extents", - 0, NULL, NULL, atk_test_text_get_character_extents, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_offset_at_point", - 0, NULL, NULL, atk_test_text_get_offset_at_point, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_range_extents", - 0, NULL, NULL, atk_test_text_get_range_extents, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_bounded_ranges", - 0, NULL, NULL, atk_test_text_get_bounded_ranges, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_n_selections", - 0, NULL, NULL, atk_test_text_get_n_selections, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_get_selection", - 0, NULL, NULL, atk_test_text_get_selection, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_add_selection", - 0, NULL, NULL, atk_test_text_add_selection, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_remove_selection", - 0, NULL, NULL, atk_test_text_remove_selection, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_TEXT "/atk_test_text_set_selection", - 0, NULL, NULL, atk_test_text_set_selection, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_character_count", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_character_count, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_text", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_text, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_caret_offset", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_caret_offset, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_text_attributes", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_text_attributes, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_attribute_run", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_attribute_run, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_text_attribute_value", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_text_attribute_value, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_default_attributes", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_default_attributes, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_set_caret_offset", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_set_caret_offset, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_string_at_offset_s1", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_string_at_offset_s1, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_string_at_offset_s2", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_string_at_offset_s2, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_character_at_offset", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_character_at_offset, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_character_extents", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_character_extents, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_offset_at_point", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_offset_at_point, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_range_extents", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_range_extents, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_bounded_ranges", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_bounded_ranges, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_n_selections", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_n_selections, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_selection", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_get_selection, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_add_selection", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_add_selection, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_remove_selection", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_remove_selection, fixture_teardown); + g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_set_selection", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_text_set_selection, fixture_teardown); } diff --git a/tests/at-spi2-atk/atk_test_util.c b/tests/at-spi2-atk/atk_test_util.c index 3f63ba06..a56b7913 100644 --- a/tests/at-spi2-atk/atk_test_util.c +++ b/tests/at-spi2-atk/atk_test_util.c @@ -125,7 +125,17 @@ get_root_obj (const char *file_name) } void -fixture_teardown (gpointer fixture, gconstpointer user_data) +fixture_setup (TestAppFixture *fixture, gconstpointer user_data) +{ + const char *file_name = user_data; + AtspiAccessible *root_obj = get_root_obj (file_name); + + fixture->child_pid = child_pid; + fixture->root_obj = root_obj; +} + +void +fixture_teardown (TestAppFixture *fixture, gconstpointer user_data) { int tries = 0; diff --git a/tests/at-spi2-atk/atk_test_util.h b/tests/at-spi2-atk/atk_test_util.h index 94859856..6f4f2ab6 100644 --- a/tests/at-spi2-atk/atk_test_util.h +++ b/tests/at-spi2-atk/atk_test_util.h @@ -33,6 +33,15 @@ #include <sys/wait.h> #include <unistd.h> +typedef struct +{ + pid_t child_pid; + + AtspiAccessible *root_obj; +} TestAppFixture; + +extern pid_t child_pid; + void fixture_setup (TestAppFixture *fixture, gconstpointer user_data); void fixture_teardown (TestAppFixture *fixture, gconstpointer user_data); void clean_exit_on_fail (); diff --git a/tests/at-spi2-atk/atk_test_value.c b/tests/at-spi2-atk/atk_test_value.c index 6e9e34c9..14f45e04 100644 --- a/tests/at-spi2-atk/atk_test_value.c +++ b/tests/at-spi2-atk/atk_test_value.c @@ -24,9 +24,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-value.xml" static void -atk_test_value_get_value_iface (gpointer fixture, gconstpointer user_data) +atk_test_value_get_value_iface (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -35,9 +35,9 @@ atk_test_value_get_value_iface (gpointer fixture, gconstpointer user_data) } static void -atk_test_value_get_minimum_value (gpointer fixture, gconstpointer user_data) +atk_test_value_get_minimum_value (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -47,9 +47,9 @@ atk_test_value_get_minimum_value (gpointer fixture, gconstpointer user_data) } static void -atk_test_value_get_current_value (gpointer fixture, gconstpointer user_data) +atk_test_value_get_current_value (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -59,9 +59,9 @@ atk_test_value_get_current_value (gpointer fixture, gconstpointer user_data) } static void -atk_test_value_get_maximum_value (gpointer fixture, gconstpointer user_data) +atk_test_value_get_maximum_value (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -71,9 +71,9 @@ atk_test_value_get_maximum_value (gpointer fixture, gconstpointer user_data) } static void -atk_test_value_set_current_value (gpointer fixture, gconstpointer user_data) +atk_test_value_set_current_value (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -84,9 +84,9 @@ atk_test_value_set_current_value (gpointer fixture, gconstpointer user_data) } static void -atk_test_value_get_minimum_increment (gpointer fixture, gconstpointer user_data) +atk_test_value_get_minimum_increment (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -96,9 +96,9 @@ atk_test_value_get_minimum_increment (gpointer fixture, gconstpointer user_data) } static void -atk_test_value_get_text (gpointer fixture, gconstpointer user_data) +atk_test_value_get_text (TestAppFixture *fixture, gconstpointer user_data) { - AtspiAccessible *_obj = get_root_obj (DATA_FILE); + AtspiAccessible *_obj = fixture->root_obj; g_assert (_obj); AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); @@ -111,18 +111,18 @@ atk_test_value_get_text (gpointer fixture, gconstpointer user_data) void atk_test_value (void) { - g_test_add_vtable (ATK_TEST_PATH_VALUE "/atk_test_value_get_value_iface", - 0, NULL, NULL, atk_test_value_get_value_iface, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_VALUE "/atk_test_value_get_minimum_value", - 0, NULL, NULL, atk_test_value_get_minimum_value, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_VALUE "/atk_test_value_get_current_value", - 0, NULL, NULL, atk_test_value_get_current_value, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_VALUE "/atk_test_value_get_maximum_value", - 0, NULL, NULL, atk_test_value_get_maximum_value, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_VALUE "/atk_test_value_set_current_value", - 0, NULL, NULL, atk_test_value_set_current_value, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_VALUE "/atk_test_value_get_minimum_increment", - 0, NULL, NULL, atk_test_value_get_minimum_increment, fixture_teardown); - g_test_add_vtable (ATK_TEST_PATH_VALUE "/atk_test_value_get_text", - 0, NULL, NULL, atk_test_value_get_text, fixture_teardown); + g_test_add (ATK_TEST_PATH_VALUE "/atk_test_value_get_value_iface", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_value_get_value_iface, fixture_teardown); + g_test_add (ATK_TEST_PATH_VALUE "/atk_test_value_get_minimum_value", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_value_get_minimum_value, fixture_teardown); + g_test_add (ATK_TEST_PATH_VALUE "/atk_test_value_get_current_value", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_value_get_current_value, fixture_teardown); + g_test_add (ATK_TEST_PATH_VALUE "/atk_test_value_get_maximum_value", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_value_get_maximum_value, fixture_teardown); + g_test_add (ATK_TEST_PATH_VALUE "/atk_test_value_set_current_value", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_value_set_current_value, fixture_teardown); + g_test_add (ATK_TEST_PATH_VALUE "/atk_test_value_get_minimum_increment", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_value_get_minimum_increment, fixture_teardown); + g_test_add (ATK_TEST_PATH_VALUE "/atk_test_value_get_text", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_value_get_text, fixture_teardown); } |