From b81ea2b7f2f45052eda8e40fd616a44d28d5698e Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 4 May 2023 17:18:45 -0600 Subject: ci/run-tests.sh: use --print-errorlogs for meson, hopefully to make build logs easier to read ... without downloading the artifacts for the error logs. --- ci/run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run-tests.sh b/ci/run-tests.sh index 9676e749..38e019f1 100755 --- a/ci/run-tests.sh +++ b/ci/run-tests.sh @@ -28,7 +28,7 @@ gdbus call --session \ echo "Now running the tests:" -meson test -C _build +meson test -C _build --print-errorlogs echo "Telling the mock session to logout so the a11y daemons will exit" -- cgit v1.2.1 From bbab63476098a28a18ad2ae693c856b7ec2c7e83 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 7 Sep 2022 18:17:00 -0500 Subject: atk_test_util.c: make run_app() a private function --- tests/at-spi2-atk/atk_test_util.c | 2 +- tests/at-spi2-atk/atk_test_util.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/at-spi2-atk/atk_test_util.c b/tests/at-spi2-atk/atk_test_util.c index 1f80d459..d67c985c 100644 --- a/tests/at-spi2-atk/atk_test_util.c +++ b/tests/at-spi2-atk/atk_test_util.c @@ -37,7 +37,7 @@ clean_exit_on_fail () signal (SIGABRT, assert_clean_exit); } -void +static void run_app (const char *file_name) { child_pid = fork (); diff --git a/tests/at-spi2-atk/atk_test_util.h b/tests/at-spi2-atk/atk_test_util.h index 6fc3ecf5..d08d23fb 100644 --- a/tests/at-spi2-atk/atk_test_util.h +++ b/tests/at-spi2-atk/atk_test_util.h @@ -35,7 +35,6 @@ extern pid_t child_pid; -void run_app (const char *file_name); AtspiAccessible *get_root_obj (const char *file_name); void terminate_app (void); void clean_exit_on_fail (); -- cgit v1.2.1 From 657f1fe9344f8d59bfdbc35515041395632cb8fa Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 7 Sep 2022 19:07:21 -0500 Subject: test-application.c: Claim a dbus name passed by the caller We pass argc/argv on to atk_bridge_adaptor_init() so it can pick up the --atspi-dbus-name option. We will use this from the calling program to wait reliably for the test app to be ready. The name org.a11y.Atspi2Atk.TestApplication is just arbitrary. --- tests/at-spi2-atk/atk_test_util.c | 2 ++ tests/at-spi2-atk/test-application.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/at-spi2-atk/atk_test_util.c b/tests/at-spi2-atk/atk_test_util.c index d67c985c..9cbd5062 100644 --- a/tests/at-spi2-atk/atk_test_util.c +++ b/tests/at-spi2-atk/atk_test_util.c @@ -47,6 +47,8 @@ run_app (const char *file_name) TESTS_BUILD_DIR "/app-test", "--test-data-file", file_name, + "--atspi-dbus-name", + "org.a11y.Atspi2Atk.TestApplication", NULL); _exit (EXIT_SUCCESS); } diff --git a/tests/at-spi2-atk/test-application.c b/tests/at-spi2-atk/test-application.c index e28926b0..56ce4a18 100644 --- a/tests/at-spi2-atk/test-application.c +++ b/tests/at-spi2-atk/test-application.c @@ -118,7 +118,8 @@ main (int argc, char *argv[]) setup_atk_util (); test_init (tdata_path); - atk_bridge_adaptor_init (NULL, NULL); + + atk_bridge_adaptor_init (&argc, &argv); mainloop = g_main_loop_new (NULL, FALSE); g_unix_signal_add (SIGTERM, sigterm_received_cb, mainloop); -- cgit v1.2.1 From 5cec37c70da29509ad7a339f38d9de399a76b810 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 7 Sep 2022 19:21:05 -0500 Subject: Replace all the teardown functions with a single one For the at-spi2-atk tests, we'll move to having a test fixture that consists of a launched test app with its claimed dbus name. The teardown step will terminate the test app. In this commit, terminate_app() is renamed to fixture_teardown(). It does not use its arguments yet, because it only uses global variables from atk_test_util.c, but it will soon. --- tests/at-spi2-atk/atk_test_accessible.c | 76 ++++++++++++++---------------- tests/at-spi2-atk/atk_test_action.c | 20 +++----- tests/at-spi2-atk/atk_test_collection.c | 14 ++---- tests/at-spi2-atk/atk_test_component.c | 24 ++++------ tests/at-spi2-atk/atk_test_document.c | 14 ++---- tests/at-spi2-atk/atk_test_editable_text.c | 20 +++----- tests/at-spi2-atk/atk_test_hyperlink.c | 34 ++++++------- tests/at-spi2-atk/atk_test_hypertext.c | 12 ++--- tests/at-spi2-atk/atk_test_image.c | 18 +++---- tests/at-spi2-atk/atk_test_selection.c | 24 ++++------ tests/at-spi2-atk/atk_test_state_set.c | 26 ++++------ tests/at-spi2-atk/atk_test_table.c | 60 +++++++++++------------ tests/at-spi2-atk/atk_test_table_cell.c | 22 ++++----- tests/at-spi2-atk/atk_test_text.c | 46 ++++++++---------- tests/at-spi2-atk/atk_test_util.c | 2 +- tests/at-spi2-atk/atk_test_util.h | 2 +- tests/at-spi2-atk/atk_test_value.c | 20 +++----- 17 files changed, 172 insertions(+), 262 deletions(-) diff --git a/tests/at-spi2-atk/atk_test_accessible.c b/tests/at-spi2-atk/atk_test_accessible.c index 74579c9b..97065310 100644 --- a/tests/at-spi2-atk/atk_test_accessible.c +++ b/tests/at-spi2-atk/atk_test_accessible.c @@ -25,12 +25,6 @@ #define DATA_FILE TESTS_DATA_DIR "/test-accessible.xml" -static void -teardown_accessible_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - static void atk_test_accessible_get_name (gpointer fixture, gconstpointer user_data) { @@ -388,73 +382,73 @@ 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 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, teardown_accessible_test); + 0, NULL, NULL, 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 18990c64..32b2ce10 100644 --- a/tests/at-spi2-atk/atk_test_action.c +++ b/tests/at-spi2-atk/atk_test_action.c @@ -25,12 +25,6 @@ #define DATA_FILE TESTS_DATA_DIR "/test-action.xml" -static void -teardown_action_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - static void atk_test_action_sample_get_interface (gpointer fixture, gconstpointer user_data) { @@ -104,17 +98,17 @@ 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, teardown_action_test); + 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, teardown_action_test); + 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, teardown_action_test); + 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, teardown_action_test); + 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, teardown_action_test); + 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, teardown_action_test); + 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, teardown_action_test); + 0, NULL, NULL, 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 184a0663..c5837857 100644 --- a/tests/at-spi2-atk/atk_test_collection.c +++ b/tests/at-spi2-atk/atk_test_collection.c @@ -25,12 +25,6 @@ #define DATA_FILE TESTS_DATA_DIR "/test-collection.xml" -static void -teardown_collection_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - static void atk_test_collection_get_collection_iface (gpointer fixture, gconstpointer user_data) { @@ -156,11 +150,11 @@ 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, teardown_collection_test); + 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, teardown_collection_test); + 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, teardown_collection_test); + 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, teardown_collection_test); + 0, NULL, NULL, 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 82c6bebe..a4e78b1e 100644 --- a/tests/at-spi2-atk/atk_test_component.c +++ b/tests/at-spi2-atk/atk_test_component.c @@ -25,12 +25,6 @@ #define DATA_FILE TESTS_DATA_DIR "/test-component.xml" -static void -teardown_component_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - static void atk_test_component_sample (gpointer fixture, gconstpointer user_data) { @@ -163,21 +157,21 @@ void atk_test_component (void) { g_test_add_vtable (ATK_TEST_PATH_COMP "/atk_test_component_sample", - 0, NULL, NULL, atk_test_component_sample, teardown_component_test); + 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, teardown_component_test); + 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, teardown_component_test); + 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, teardown_component_test); + 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, teardown_component_test); + 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, teardown_component_test); + 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, teardown_component_test); + 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, teardown_component_test); + 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, teardown_component_test); + 0, NULL, NULL, 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 b0224803..7e020709 100644 --- a/tests/at-spi2-atk/atk_test_document.c +++ b/tests/at-spi2-atk/atk_test_document.c @@ -25,12 +25,6 @@ #define DATA_FILE TESTS_DATA_DIR "/test-document.xml" -static void -teardown_document_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - static void atk_test_document_get_document_iface (gpointer fixture, gconstpointer user_data) { @@ -100,11 +94,11 @@ 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, teardown_document_test); + 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, teardown_document_test); + 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, teardown_document_test); + 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, teardown_document_test); + 0, NULL, NULL, 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 9758bf1c..ddb5b365 100644 --- a/tests/at-spi2-atk/atk_test_editable_text.c +++ b/tests/at-spi2-atk/atk_test_editable_text.c @@ -25,12 +25,6 @@ #define DATA_FILE TESTS_DATA_DIR "/test-editable-text.xml" -static void -teardown_editable_text_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - static void atk_test_editable_text_get_editable_text_iface (gpointer fixture, gconstpointer user_data) { @@ -110,19 +104,19 @@ 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, teardown_editable_text_test); + 0, NULL, NULL, 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, teardown_editable_text_test); + 0, NULL, NULL, 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, teardown_editable_text_test); + 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, teardown_editable_text_test); + 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, teardown_editable_text_test); + 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, teardown_editable_text_test); + 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, teardown_editable_text_test); + 0, NULL, NULL, 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 c3293fce..a78ddf71 100644 --- a/tests/at-spi2-atk/atk_test_hyperlink.c +++ b/tests/at-spi2-atk/atk_test_hyperlink.c @@ -139,27 +139,21 @@ atk_test_hyperlink_is_valid (gpointer fixture, gconstpointer user_data) g_assert (atspi_hyperlink_is_valid (obj, NULL)); } -static void -teardown_hyperlink_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - 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, teardown_hyperlink_test); - g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_uri", - 0, NULL, NULL, atk_test_hyperlink_get_uri, teardown_hyperlink_test); - g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_object", - 0, NULL, NULL, atk_test_hyperlink_get_object, teardown_hyperlink_test); - g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_index_range", - 0, NULL, NULL, atk_test_hyperlink_get_index_range, teardown_hyperlink_test); - g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_start_index", - 0, NULL, NULL, atk_test_hyperlink_get_start_index, teardown_hyperlink_test); - g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_end_index", - 0, NULL, NULL, atk_test_hyperlink_get_end_index, teardown_hyperlink_test); - g_test_add_vtable (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_is_valid", - 0, NULL, NULL, atk_test_hyperlink_is_valid, teardown_hyperlink_test); + 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); } diff --git a/tests/at-spi2-atk/atk_test_hypertext.c b/tests/at-spi2-atk/atk_test_hypertext.c index 68b8fe55..3571ada1 100644 --- a/tests/at-spi2-atk/atk_test_hypertext.c +++ b/tests/at-spi2-atk/atk_test_hypertext.c @@ -77,19 +77,13 @@ atk_test_hypertext_get_link_index (gpointer fixture, gconstpointer user_data) g_assert_cmpint (cnt, ==, 1); } -static void -teardown_hypertext_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - 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, teardown_hypertext_test); + 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, teardown_hypertext_test); + 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, teardown_hypertext_test); + 0, NULL, NULL, 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 ff42c4cd..24e60746 100644 --- a/tests/at-spi2-atk/atk_test_image.c +++ b/tests/at-spi2-atk/atk_test_image.c @@ -25,12 +25,6 @@ #define DATA_FILE TESTS_DATA_DIR "/test-image.xml" -static void -teardown_image_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - static void atk_test_image_sample_get_interface (gpointer fixture, gconstpointer user_data) { @@ -114,15 +108,15 @@ 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, teardown_image_test); + 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, teardown_image_test); + 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, teardown_image_test); + 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, teardown_image_test); + 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, teardown_image_test); + 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, teardown_image_test); + 0, NULL, NULL, 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 3c2b2b3e..4717f00a 100644 --- a/tests/at-spi2-atk/atk_test_selection.c +++ b/tests/at-spi2-atk/atk_test_selection.c @@ -25,12 +25,6 @@ #define DATA_FILE TESTS_DATA_DIR "/test-selection.xml" -static void -teardown_selection_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - static void atk_test_selection_sample_get_interface (gpointer fixture, gconstpointer user_data) { @@ -176,21 +170,21 @@ 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, teardown_selection_test); + 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, teardown_selection_test); + 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, teardown_selection_test); + 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, teardown_selection_test); + 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, teardown_selection_test); + 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, teardown_selection_test); + 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, teardown_selection_test); + 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, teardown_selection_test); + 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, teardown_selection_test); + 0, NULL, NULL, 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 06f86dbb..3ba26411 100644 --- a/tests/at-spi2-atk/atk_test_state_set.c +++ b/tests/at-spi2-atk/atk_test_state_set.c @@ -25,12 +25,6 @@ #define DATA_FILE TESTS_DATA_DIR "/test-accessible.xml" -static void -teardown_state_set_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - static void atk_test_accessible_get_state_set (gpointer fixture, gconstpointer user_data) { @@ -217,23 +211,23 @@ 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, teardown_state_set_test); + 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, teardown_state_set_test); + 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, teardown_state_set_test); + 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, teardown_state_set_test); + 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, teardown_state_set_test); + 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, teardown_state_set_test); + 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, teardown_state_set_test); + 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, teardown_state_set_test); + 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, teardown_state_set_test); + 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, teardown_state_set_test); + 0, NULL, NULL, 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 8a673bcc..f4416c45 100644 --- a/tests/at-spi2-atk/atk_test_table.c +++ b/tests/at-spi2-atk/atk_test_table.c @@ -413,65 +413,59 @@ atk_test_table_is_selected (gpointer fixture, gconstpointer user_data) g_assert_false (atspi_table_is_selected (obj, 1, 0, NULL)); } -static void -teardown_table_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); - g_test_add_vtable (ATK_TEST_PATH_TABLE "/atk_test_table_get_row_description", - 0, NULL, NULL, atk_test_table_get_row_description, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 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, teardown_table_test); + 0, NULL, NULL, 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 efb35eab..d5425208 100644 --- a/tests/at-spi2-atk/atk_test_table_cell.c +++ b/tests/at-spi2-atk/atk_test_table_cell.c @@ -178,33 +178,27 @@ atk_test_table_cell_get_table (gpointer fixture, gconstpointer user_data) g_assert (child == tab); } -static void -teardown_table_cell_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - 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, teardown_table_cell_test); + 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, teardown_table_cell_test); + 0, NULL, NULL, 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, teardown_table_cell_test); + 0, NULL, NULL, 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, teardown_table_cell_test); + 0, NULL, NULL, 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, teardown_table_cell_test); + 0, NULL, NULL, 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, teardown_table_cell_test); + 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, teardown_table_cell_test); + 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, teardown_table_cell_test); + 0, NULL, NULL, 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 085380c1..35ab07f5 100644 --- a/tests/at-spi2-atk/atk_test_text.c +++ b/tests/at-spi2-atk/atk_test_text.c @@ -431,53 +431,47 @@ atk_test_text_get_bounded_ranges (gpointer fixture, gconstpointer user_data) g_array_free (array, TRUE); } -static void -teardown_text_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 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, teardown_text_test); + 0, NULL, NULL, 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 9cbd5062..547c9213 100644 --- a/tests/at-spi2-atk/atk_test_util.c +++ b/tests/at-spi2-atk/atk_test_util.c @@ -125,7 +125,7 @@ get_root_obj (const char *file_name) } void -terminate_app (void) +fixture_teardown (gpointer 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 d08d23fb..fd900e05 100644 --- a/tests/at-spi2-atk/atk_test_util.h +++ b/tests/at-spi2-atk/atk_test_util.h @@ -36,7 +36,7 @@ extern pid_t child_pid; AtspiAccessible *get_root_obj (const char *file_name); -void terminate_app (void); +void fixture_teardown (gpointer fixture, gconstpointer user_data); void clean_exit_on_fail (); #endif /* _ATK_TEST_UTIL_H */ diff --git a/tests/at-spi2-atk/atk_test_value.c b/tests/at-spi2-atk/atk_test_value.c index d592d903..6e9e34c9 100644 --- a/tests/at-spi2-atk/atk_test_value.c +++ b/tests/at-spi2-atk/atk_test_value.c @@ -108,27 +108,21 @@ atk_test_value_get_text (gpointer fixture, gconstpointer user_data) g_free (text); } -static void -teardown_value_test (gpointer fixture, gconstpointer user_data) -{ - terminate_app (); -} - 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, teardown_value_test); + 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, teardown_value_test); + 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, teardown_value_test); + 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, teardown_value_test); + 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, teardown_value_test); + 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, teardown_value_test); + 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, teardown_value_test); + 0, NULL, NULL, atk_test_value_get_text, fixture_teardown); } -- cgit v1.2.1 From f9270d7504b5ac0488bb381933a516b2e74e097f Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 7 Sep 2022 20:50:20 -0500 Subject: Make child_pid static to atk_test_util.c The one test that used that value can now use fixture->child_pid instead. --- tests/at-spi2-atk/atk_test_accessible.c | 2 +- tests/at-spi2-atk/atk_test_util.c | 2 +- tests/at-spi2-atk/atk_test_util.h | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/at-spi2-atk/atk_test_accessible.c b/tests/at-spi2-atk/atk_test_accessible.c index 97065310..cabff4cf 100644 --- a/tests/at-spi2-atk/atk_test_accessible.c +++ b/tests/at-spi2-atk/atk_test_accessible.c @@ -375,7 +375,7 @@ atk_test_accessible_get_process_id (gpointer fixture, gconstpointer user_data) { AtspiAccessible *obj = get_root_obj (DATA_FILE); guint proc_id = atspi_accessible_get_process_id (obj, NULL); - g_assert_cmpint (proc_id, ==, child_pid); + g_assert_cmpint (proc_id, ==, fixture->child_pid); } void diff --git a/tests/at-spi2-atk/atk_test_util.c b/tests/at-spi2-atk/atk_test_util.c index 547c9213..73c2f762 100644 --- a/tests/at-spi2-atk/atk_test_util.c +++ b/tests/at-spi2-atk/atk_test_util.c @@ -23,7 +23,7 @@ #include "atk_test_util.h" #include -pid_t child_pid; +static pid_t child_pid; static void assert_clean_exit (int sig) diff --git a/tests/at-spi2-atk/atk_test_util.h b/tests/at-spi2-atk/atk_test_util.h index fd900e05..2af8f8b1 100644 --- a/tests/at-spi2-atk/atk_test_util.h +++ b/tests/at-spi2-atk/atk_test_util.h @@ -33,8 +33,6 @@ #include #include -extern pid_t child_pid; - AtspiAccessible *get_root_obj (const char *file_name); void fixture_teardown (gpointer fixture, gconstpointer user_data); void clean_exit_on_fail (); -- cgit v1.2.1 From 74968d2ced63e0ed12890a12ec41255c24bcc2a0 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 7 Sep 2022 20:51:35 -0500 Subject: Make get_root_obj() static All the tests use the TestAppFixture instead. --- tests/at-spi2-atk/atk_test_util.c | 2 +- tests/at-spi2-atk/atk_test_util.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/at-spi2-atk/atk_test_util.c b/tests/at-spi2-atk/atk_test_util.c index 73c2f762..3f63ba06 100644 --- a/tests/at-spi2-atk/atk_test_util.c +++ b/tests/at-spi2-atk/atk_test_util.c @@ -88,7 +88,7 @@ try_get_root_obj (AtspiAccessible *obj) return NULL; } -AtspiAccessible * +static AtspiAccessible * get_root_obj (const char *file_name) { int tries = 0; diff --git a/tests/at-spi2-atk/atk_test_util.h b/tests/at-spi2-atk/atk_test_util.h index 2af8f8b1..94859856 100644 --- a/tests/at-spi2-atk/atk_test_util.h +++ b/tests/at-spi2-atk/atk_test_util.h @@ -33,8 +33,8 @@ #include #include -AtspiAccessible *get_root_obj (const char *file_name); -void fixture_teardown (gpointer fixture, gconstpointer user_data); +void fixture_setup (TestAppFixture *fixture, gconstpointer user_data); +void fixture_teardown (TestAppFixture *fixture, gconstpointer user_data); void clean_exit_on_fail (); #endif /* _ATK_TEST_UTIL_H */ -- cgit v1.2.1 From 54996d2e517185f1d36deb8a47edb86a14dc09f6 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 7 Sep 2022 20:48:09 -0500 Subject: Switch all at-spi2-atk tests to g_test_add() with a TestAppFixture --- tests/at-spi2-atk/README | 2 +- tests/at-spi2-atk/atk_test_accessible.c | 280 ++++++++++++++--------------- tests/at-spi2-atk/atk_test_action.c | 56 +++--- tests/at-spi2-atk/atk_test_collection.c | 32 ++-- tests/at-spi2-atk/atk_test_component.c | 72 ++++---- tests/at-spi2-atk/atk_test_document.c | 36 ++-- tests/at-spi2-atk/atk_test_editable_text.c | 56 +++--- tests/at-spi2-atk/atk_test_hyperlink.c | 56 +++--- tests/at-spi2-atk/atk_test_hypertext.c | 24 +-- tests/at-spi2-atk/atk_test_image.c | 48 ++--- tests/at-spi2-atk/atk_test_selection.c | 72 ++++---- tests/at-spi2-atk/atk_test_state_set.c | 78 ++++---- tests/at-spi2-atk/atk_test_table.c | 208 ++++++++++----------- tests/at-spi2-atk/atk_test_table_cell.c | 64 +++---- tests/at-spi2-atk/atk_test_text.c | 160 ++++++++--------- tests/at-spi2-atk/atk_test_util.c | 12 +- tests/at-spi2-atk/atk_test_util.h | 9 + 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 #include +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); } -- cgit v1.2.1 From 11710e04c901d3202e8263e9a1766c7dd7ed23e2 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 7 Sep 2022 20:58:46 -0500 Subject: Don't use a Unix signal handler to kill the test-application if the parent test program aborts This is super sketchy; moreover, we can rely on the test runner to kill child processes. --- tests/at-spi2-atk/atk_suite.c | 2 -- tests/at-spi2-atk/atk_test_util.c | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/tests/at-spi2-atk/atk_suite.c b/tests/at-spi2-atk/atk_suite.c index f70e8cb8..02f85917 100644 --- a/tests/at-spi2-atk/atk_suite.c +++ b/tests/at-spi2-atk/atk_suite.c @@ -55,8 +55,6 @@ main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); - clean_exit_on_fail (); - atk_suite_build (); return g_test_run (); diff --git a/tests/at-spi2-atk/atk_test_util.c b/tests/at-spi2-atk/atk_test_util.c index a56b7913..b22aa3f6 100644 --- a/tests/at-spi2-atk/atk_test_util.c +++ b/tests/at-spi2-atk/atk_test_util.c @@ -25,18 +25,6 @@ static pid_t child_pid; -static void -assert_clean_exit (int sig) -{ - kill (child_pid, SIGTERM); -} - -void -clean_exit_on_fail () -{ - signal (SIGABRT, assert_clean_exit); -} - static void run_app (const char *file_name) { -- cgit v1.2.1 From e2bb6b5593418f334ddf5d1e3404c434bedb403f Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 7 Sep 2022 21:06:47 -0500 Subject: Don't use a global variable for child_pid Keep it in the TestAppFixture at all times. --- tests/at-spi2-atk/atk_test_util.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/tests/at-spi2-atk/atk_test_util.c b/tests/at-spi2-atk/atk_test_util.c index b22aa3f6..57f7098f 100644 --- a/tests/at-spi2-atk/atk_test_util.c +++ b/tests/at-spi2-atk/atk_test_util.c @@ -23,12 +23,10 @@ #include "atk_test_util.h" #include -static pid_t child_pid; - -static void +static pid_t run_app (const char *file_name) { - child_pid = fork (); + pid_t child_pid = fork (); if (child_pid == 0) { execlp (TESTS_BUILD_DIR "/app-test", @@ -42,6 +40,8 @@ run_app (const char *file_name) } if (child_pid) fprintf (stderr, "child_pid %d\n", child_pid); + + return child_pid; } static AtspiAccessible * @@ -76,16 +76,18 @@ try_get_root_obj (AtspiAccessible *obj) return NULL; } -static AtspiAccessible * -get_root_obj (const char *file_name) +static void +get_root_obj (const char *file_name, AtspiAccessible **out_root_obj, pid_t *out_child_pid) { int tries = 0; AtspiAccessible *child; struct timespec timeout = { .tv_sec = 0, .tv_nsec = 10 * 1000000 }; AtspiAccessible *obj = NULL; + pid_t child_pid; fprintf (stderr, "run_app: %s\n", file_name); - run_app (file_name); + child_pid = run_app (file_name); + *out_child_pid = child_pid; obj = atspi_get_desktop (0); @@ -94,7 +96,10 @@ get_root_obj (const char *file_name) { child = try_get_root_obj (obj); if (child) - return child; + { + *out_root_obj = child; + return; + } nanosleep (&timeout, NULL); } @@ -109,14 +114,18 @@ get_root_obj (const char *file_name) } g_test_fail (); kill (child_pid, SIGTERM); - return NULL; + *out_root_obj = NULL; } void fixture_setup (TestAppFixture *fixture, gconstpointer user_data) { const char *file_name = user_data; - AtspiAccessible *root_obj = get_root_obj (file_name); + pid_t child_pid; + AtspiAccessible *root_obj; + + get_root_obj (file_name, &root_obj, &child_pid); + g_assert (root_obj != NULL); fixture->child_pid = child_pid; fixture->root_obj = root_obj; @@ -131,7 +140,7 @@ fixture_teardown (TestAppFixture *fixture, gconstpointer user_data) struct timespec timeout = { .tv_sec = 0, .tv_nsec = 10 * 1000000 }; AtspiAccessible *obj = NULL; - kill (child_pid, SIGTERM); + kill (fixture->child_pid, SIGTERM); obj = atspi_get_desktop (0); -- cgit v1.2.1 From 06027ba5226ae4f57f9786a65ec6c98469828b46 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 29 Sep 2022 14:40:49 -0500 Subject: Wait for the test-application startup using an atspi listener This should be more robust than just waiting and sleeping. * test-application now claims a different DBus name for each run, to disambiguate. * atk_bridge_adaptor_cleanup() - release the dbus name if there was one --- atk-adaptor/bridge.c | 22 ++++- atk/atkutil.c | 1 + atspi/atspi-misc.c | 2 + tests/at-spi2-atk/atk_suite.c | 18 +++- tests/at-spi2-atk/atk_test_util.c | 187 ++++++++++++++++++++++++----------- tests/at-spi2-atk/atk_test_util.h | 15 ++- tests/at-spi2-atk/test-application.c | 6 ++ 7 files changed, 191 insertions(+), 60 deletions(-) diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c index a2b1de83..462ec0a3 100644 --- a/atk-adaptor/bridge.c +++ b/atk-adaptor/bridge.c @@ -686,7 +686,7 @@ new_connection_cb (DBusServer *server, DBusConnection *con, void *data) spi_global_app_data->direct_connections = g_list_append (spi_global_app_data->direct_connections, con); } -gchar *atspi_dbus_name = NULL; +static gchar *atspi_dbus_name = NULL; static gboolean atspi_no_register = FALSE; static GOptionEntry atspi_option_entries[] = { @@ -1222,6 +1222,26 @@ atk_bridge_adaptor_cleanup (void) { dbus_connection_remove_filter (spi_global_app_data->bus, signal_filter, NULL); droute_context_unregister (spi_global_app_data->droute, spi_global_app_data->bus); + + if (atspi_dbus_name != NULL) + { + DBusError error; + int result; + + dbus_error_init (&error); + result = dbus_bus_release_name (spi_global_app_data->bus, atspi_dbus_name, &error); + if (result == -1) + { + g_warning ("atk-bridge: could not release dbus name: %s", error.message); + } + else + { + g_print ("bridge: released name, result %d\n", result); + } + + dbus_error_free (&error); + } + dbus_connection_close (spi_global_app_data->bus); dbus_connection_unref (spi_global_app_data->bus); spi_global_app_data->bus = NULL; diff --git a/atk/atkutil.c b/atk/atkutil.c index db957c7a..cf5eb3b5 100644 --- a/atk/atkutil.c +++ b/atk/atkutil.c @@ -488,6 +488,7 @@ atk_get_root (void) { AtkUtilClass *klass = g_type_class_ref (ATK_TYPE_UTIL); AtkObject *retval; + if (klass->get_root) { retval = klass->get_root (); diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index 9e68049d..01bd1634 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -246,6 +246,8 @@ get_application (const char *bus_name) DBusMessage *message; DBusPendingCall *pending = NULL; + g_print ("get_application %s\n", bus_name); + if (!app_hash) { app_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_object_unref); diff --git a/tests/at-spi2-atk/atk_suite.c b/tests/at-spi2-atk/atk_suite.c index 02f85917..7132c148 100644 --- a/tests/at-spi2-atk/atk_suite.c +++ b/tests/at-spi2-atk/atk_suite.c @@ -53,9 +53,25 @@ atk_suite_build (void) int main (int argc, char **argv) { + int init_result; + g_test_init (&argc, &argv, NULL); + init_result = atspi_init (); + if (init_result != 0) + { + g_error ("Could not initialize atspi, code %d", init_result); + } + + fixture_listener_init (); + atk_suite_build (); - return g_test_run (); + int result = g_test_run (); + g_assert_cmpint (result, ==, 0); + + int leaked = atspi_exit (); + g_assert_cmpint (leaked, ==, 0); + + return 0; } diff --git a/tests/at-spi2-atk/atk_test_util.c b/tests/at-spi2-atk/atk_test_util.c index 57f7098f..2af00135 100644 --- a/tests/at-spi2-atk/atk_test_util.c +++ b/tests/at-spi2-atk/atk_test_util.c @@ -23,8 +23,11 @@ #include "atk_test_util.h" #include +static AtspiEventListener *fixture_listener = NULL; +static TestAppFixture *current_fixture = NULL; + static pid_t -run_app (const char *file_name) +run_app (const char *file_name, const char *name_to_claim) { pid_t child_pid = fork (); if (child_pid == 0) @@ -34,12 +37,10 @@ run_app (const char *file_name) "--test-data-file", file_name, "--atspi-dbus-name", - "org.a11y.Atspi2Atk.TestApplication", + name_to_claim, NULL); _exit (EXIT_SUCCESS); } - if (child_pid) - fprintf (stderr, "child_pid %d\n", child_pid); return child_pid; } @@ -47,113 +48,185 @@ run_app (const char *file_name) static AtspiAccessible * try_get_root_obj (AtspiAccessible *obj) { + GError *error = NULL; gchar *name; int i; - gint child_count = atspi_accessible_get_child_count (obj, NULL); - if (child_count < 1) + gint child_count = atspi_accessible_get_child_count (obj, &error); + if (child_count < 0) { + if (error) + { + g_print (" get_child_count: %s\n", error->message); + g_error_free (error); + } + else + { + g_print (" get_child_count=%d with no error\n", child_count); + } + return NULL; + } + else if (child_count < 1) + { + g_print (" child_count == %d, bailing out\n", child_count); return NULL; } for (i = 0; i < child_count; i++) { - AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, i, NULL); + AtspiAccessible *child = atspi_accessible_get_child_at_index (obj, i, &error); if (!child) - continue; - if ((name = atspi_accessible_get_name (child, NULL)) != NULL) + { + if (error) + { + g_print (" getting child_at_index: %s\n", error->message); + g_error_free (error); + } + else + { + g_print (" getting child_at_index returned NULL child with no error\n"); + } + continue; + } + if ((name = atspi_accessible_get_name (child, &error)) != NULL) { if (!strcmp (name, "root_object")) { g_free (name); return child; } + g_print (" name=%s\n", name); g_free (name); } + else + { + if (error) + { + g_print ("try_get_root_obj getting child name: %s\n", error->message); + g_error_free (error); + } + else + { + g_print (" get_name returned NULL name with no error\n"); + } + } g_object_unref (child); } return NULL; } +/* Callback from AtspiEventListener. We monitor children-changed on the root, so we can know + * when the helper test-application has launched and registered. + */ static void -get_root_obj (const char *file_name, AtspiAccessible **out_root_obj, pid_t *out_child_pid) +listener_event_cb (AtspiEvent *event, void *user_data) { - int tries = 0; - AtspiAccessible *child; - struct timespec timeout = { .tv_sec = 0, .tv_nsec = 10 * 1000000 }; - AtspiAccessible *obj = NULL; - pid_t child_pid; + TestAppFixture *fixture = current_fixture; - fprintf (stderr, "run_app: %s\n", file_name); - child_pid = run_app (file_name); - *out_child_pid = child_pid; + if (atspi_accessible_get_role (event->source, NULL) == ATSPI_ROLE_DESKTOP_FRAME && strstr (event->type, "add")) + { + AtspiAccessible *obj = atspi_get_desktop (0); - obj = atspi_get_desktop (0); + fixture->root_obj = try_get_root_obj (obj); - /* Wait for application to start, up to 100 times 10ms. */ - while (++tries <= 100) - { - child = try_get_root_obj (obj); - if (child) + if (fixture->root_obj) { - *out_root_obj = child; - return; + fixture->state = FIXTURE_STATE_CHILD_ACQUIRED; + atspi_event_quit (); } - - nanosleep (&timeout, NULL); } +} + +/* Sets up the atspi event listener for the test-application helpers. + * + * We get notified when the test-application registers its root object by listening + * to the children-changed signal. + */ +void +fixture_listener_init (void) +{ + GError *error = NULL; - if (atspi_accessible_get_child_count (obj, NULL) < 1) + fixture_listener = atspi_event_listener_new (listener_event_cb, NULL, NULL); + if (!atspi_event_listener_register (fixture_listener, "object:children-changed", &error)) { - g_test_message ("Fail, test application not found\n"); + g_error ("Could not register event listener for children-changed: %s\n", error->message); } - else +} + +void +fixture_listener_destroy (void) +{ + GError *error = NULL; + + if (!atspi_event_listener_deregister (fixture_listener, "object:children-changed", &error)) { - g_test_message ("test object not found\n"); + g_error ("Could not deregister event listener: %s", error->message); } - g_test_fail (); - kill (child_pid, SIGTERM); - *out_root_obj = NULL; + + g_object_unref (fixture_listener); + fixture_listener = NULL; +} + +static gboolean +wait_for_test_app_timeout_cb (gpointer user_data) +{ + TestAppFixture *fixture = user_data; + + fixture->test_app_timed_out = TRUE; + atspi_event_quit (); + + return FALSE; } +/* Each of the helper programs with the test fixtures claims a different DBus name, + * to make them non-ambiguous when they get restarted all the time. This is the serial + * number that gets appended to each name. + */ +static guint fixture_serial = 0; + void fixture_setup (TestAppFixture *fixture, gconstpointer user_data) { const char *file_name = user_data; - pid_t child_pid; - AtspiAccessible *root_obj; - get_root_obj (file_name, &root_obj, &child_pid); - g_assert (root_obj != NULL); + fixture->state = FIXTURE_STATE_WAITING_FOR_CHILD; + fixture->name_to_claim = g_strdup_printf ("org.a11y.Atspi2Atk.TestApplication_%u", fixture_serial); + fixture_serial += 1; + + fixture->child_pid = run_app (file_name, fixture->name_to_claim); + + fixture->test_app_timed_out = FALSE; + fixture->wait_for_test_app_timeout = g_timeout_add (500, wait_for_test_app_timeout_cb, fixture); /* 500 msec */ + + current_fixture = fixture; + atspi_event_main (); - fixture->child_pid = child_pid; - fixture->root_obj = root_obj; + g_source_remove (fixture->wait_for_test_app_timeout); + fixture->wait_for_test_app_timeout = 0; + + if (fixture->test_app_timed_out) + { + g_print ("test app timed out before registering its root object"); + g_test_fail (); + } } void fixture_teardown (TestAppFixture *fixture, gconstpointer user_data) { - int tries = 0; - - AtspiAccessible *child; - struct timespec timeout = { .tv_sec = 0, .tv_nsec = 10 * 1000000 }; - AtspiAccessible *obj = NULL; + current_fixture = NULL; kill (fixture->child_pid, SIGTERM); + fixture->child_pid = -1; - obj = atspi_get_desktop (0); - - /* Wait for application to stop, up to 100 times 10ms. */ - while (++tries <= 100) + if (fixture->root_obj) { - child = try_get_root_obj (obj); - if (child == NULL) - return; - - nanosleep (&timeout, NULL); + g_object_unref (fixture->root_obj); + fixture->root_obj = NULL; } - g_test_message ("Fail, test application still running\n"); - g_test_fail (); + g_free (fixture->name_to_claim); + fixture->name_to_claim = NULL; } diff --git a/tests/at-spi2-atk/atk_test_util.h b/tests/at-spi2-atk/atk_test_util.h index 6f4f2ab6..c664f777 100644 --- a/tests/at-spi2-atk/atk_test_util.h +++ b/tests/at-spi2-atk/atk_test_util.h @@ -33,8 +33,20 @@ #include #include +typedef enum +{ + FIXTURE_STATE_WAITING_FOR_CHILD, + FIXTURE_STATE_CHILD_ACQUIRED, +} FixtureState; + typedef struct { + FixtureState state; + + char *name_to_claim; + + guint wait_for_test_app_timeout; + gboolean test_app_timed_out; pid_t child_pid; AtspiAccessible *root_obj; @@ -42,8 +54,9 @@ typedef struct extern pid_t child_pid; +void fixture_listener_init (void); +void fixture_listener_destroy (void); void fixture_setup (TestAppFixture *fixture, gconstpointer user_data); void fixture_teardown (TestAppFixture *fixture, gconstpointer user_data); -void clean_exit_on_fail (); #endif /* _ATK_TEST_UTIL_H */ diff --git a/tests/at-spi2-atk/test-application.c b/tests/at-spi2-atk/test-application.c index 56ce4a18..b8a8da01 100644 --- a/tests/at-spi2-atk/test-application.c +++ b/tests/at-spi2-atk/test-application.c @@ -100,6 +100,7 @@ static gboolean sigterm_received_cb (gpointer user_data) { GMainLoop *mainloop = user_data; + g_print ("test application received SIGTERM\n"); g_main_loop_quit (mainloop); return G_SOURCE_REMOVE; } @@ -125,5 +126,10 @@ main (int argc, char *argv[]) g_unix_signal_add (SIGTERM, sigterm_received_cb, mainloop); g_main_loop_run (mainloop); + g_print ("test application exited main loop; terminating after cleanup\n"); + + atk_bridge_adaptor_cleanup (); + + g_print ("test application %d exiting!\n", getpid ()); return 0; } -- cgit v1.2.1 From 487b90e5fea0c008e5e2d3772e2c907bac0d4cbf Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 5 May 2023 12:53:53 -0600 Subject: Fix misnamed test path --- tests/at-spi2-atk/atk_test_document.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/at-spi2-atk/atk_test_document.c b/tests/at-spi2-atk/atk_test_document.c index 6f750e63..d9f0f9a1 100644 --- a/tests/at-spi2-atk/atk_test_document.c +++ b/tests/at-spi2-atk/atk_test_document.c @@ -93,12 +93,12 @@ atk_test_document_get_attributes (TestAppFixture *fixture, gconstpointer user_da void atk_test_document (void) { - g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_document_get_document_iface", + g_test_add (ATK_TEST_PATH_DOC "/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", + g_test_add (ATK_TEST_PATH_DOC "/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", + g_test_add (ATK_TEST_PATH_DOC "/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", + g_test_add (ATK_TEST_PATH_DOC "/atk_test_document_get_attributes", TestAppFixture, DATA_FILE, fixture_setup, atk_test_document_get_attributes, fixture_teardown); } -- cgit v1.2.1 From f025a646dbe218f4c674c8563982cc9ef293a301 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 5 May 2023 13:15:37 -0600 Subject: Make at-spi2-atk test names more legible by not using concatenation with macros --- tests/at-spi2-atk/atk_suite.h | 16 ------- tests/at-spi2-atk/atk_test_accessible.c | 70 +++++++++++++++--------------- tests/at-spi2-atk/atk_test_action.c | 14 +++--- tests/at-spi2-atk/atk_test_collection.c | 8 ++-- tests/at-spi2-atk/atk_test_component.c | 18 ++++---- tests/at-spi2-atk/atk_test_document.c | 8 ++-- tests/at-spi2-atk/atk_test_editable_text.c | 14 +++--- tests/at-spi2-atk/atk_test_hyperlink.c | 14 +++--- tests/at-spi2-atk/atk_test_hypertext.c | 6 +-- tests/at-spi2-atk/atk_test_image.c | 12 ++--- tests/at-spi2-atk/atk_test_selection.c | 18 ++++---- tests/at-spi2-atk/atk_test_state_set.c | 20 ++++----- tests/at-spi2-atk/atk_test_table.c | 52 +++++++++++----------- tests/at-spi2-atk/atk_test_table_cell.c | 16 +++---- tests/at-spi2-atk/atk_test_text.c | 40 ++++++++--------- tests/at-spi2-atk/atk_test_value.c | 14 +++--- 16 files changed, 162 insertions(+), 178 deletions(-) diff --git a/tests/at-spi2-atk/atk_suite.h b/tests/at-spi2-atk/atk_suite.h index 0ae2e6f1..abcfce43 100644 --- a/tests/at-spi2-atk/atk_suite.h +++ b/tests/at-spi2-atk/atk_suite.h @@ -25,22 +25,6 @@ #include -#define ATK_TEST_PATH_ACCESSIBLE (const char *) "/Accessible" -#define ATK_TEST_PATH_ACTION (const char *) "/Action" -#define ATK_TEST_PATH_COMP (const char *) "/Component" -#define ATK_TEST_PATH_COLLECTION (const char *) "/Collection" -#define ATK_TEST_PATH_DOC (const char *) "/Document" -#define ATK_TEST_PATH_EDIT_TEXT (const char *) "/Editable_Text" -#define ATK_TEST_PATH_HYPERLINK (const char *) "/Hyperlink" -#define ATK_TEST_PATH_HYPERTEXT (const char *) "/Hypertext" -#define ATK_TEST_PATH_IMAGE (const char *) "/Image" -#define ATK_TEST_PATH_SELECTION (const char *) "/Selection" -#define ATK_TEST_PATH_STATE_SET (const char *) "/State_Set" -#define ATK_TEST_PATH_TABLE (const char *) "/Table" -#define ATK_TEST_PATH_TABLE_CELL (const char *) "/Table_Cell" -#define ATK_TEST_PATH_TEXT (const char *) "/Text" -#define ATK_TEST_PATH_VALUE (const char *) "/Value" - void atk_test_accessible (void); void atk_test_action (void); void atk_test_component (void); diff --git a/tests/at-spi2-atk/atk_test_accessible.c b/tests/at-spi2-atk/atk_test_accessible.c index cc7593b5..b8a9665a 100644 --- a/tests/at-spi2-atk/atk_test_accessible.c +++ b/tests/at-spi2-atk/atk_test_accessible.c @@ -381,74 +381,74 @@ atk_test_accessible_get_process_id (TestAppFixture *fixture, gconstpointer user_ void atk_test_accessible (void) { - g_test_add (ATK_TEST_PATH_ACCESSIBLE "/atk_test_accessible_get_name", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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 f520f646..b079a8e0 100644 --- a/tests/at-spi2-atk/atk_test_action.c +++ b/tests/at-spi2-atk/atk_test_action.c @@ -97,18 +97,18 @@ atk_test_action_do_action (TestAppFixture *fixture, gconstpointer user_data) void atk_test_action (void) { - g_test_add (ATK_TEST_PATH_ACTION "/atk_test_action_sample_get_interface", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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 ee099d07..5fd4d911 100644 --- a/tests/at-spi2-atk/atk_test_collection.c +++ b/tests/at-spi2-atk/atk_test_collection.c @@ -149,12 +149,12 @@ atk_test_collection_get_matches_from (TestAppFixture *fixture, gconstpointer use void atk_test_collection (void) { - g_test_add (ATK_TEST_PATH_COLLECTION "/atk_test_collection_get_collection_iface", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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 8aebf035..2bdb6f20 100644 --- a/tests/at-spi2-atk/atk_test_component.c +++ b/tests/at-spi2-atk/atk_test_component.c @@ -156,22 +156,22 @@ atk_test_component_set_extents (TestAppFixture *fixture, gconstpointer user_data void atk_test_component (void) { - g_test_add (ATK_TEST_PATH_COMP "/atk_test_component_sample", + g_test_add ("/component/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", + g_test_add ("/component/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", + g_test_add ("/component/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", + g_test_add ("/component/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", + g_test_add ("/component/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", + g_test_add ("/component/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", + g_test_add ("/component/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", + g_test_add ("/component/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", + g_test_add ("/component/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 d9f0f9a1..fd83cb8d 100644 --- a/tests/at-spi2-atk/atk_test_document.c +++ b/tests/at-spi2-atk/atk_test_document.c @@ -93,12 +93,12 @@ atk_test_document_get_attributes (TestAppFixture *fixture, gconstpointer user_da void atk_test_document (void) { - g_test_add (ATK_TEST_PATH_DOC "/atk_test_document_get_document_iface", + g_test_add ("/document/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_DOC "/atk_test_document_get_locale", + g_test_add ("/document/atk_test_document_get_locale", TestAppFixture, DATA_FILE, fixture_setup, atk_test_document_get_locale, fixture_teardown); - g_test_add (ATK_TEST_PATH_DOC "/atk_test_document_get_attribute_value", + g_test_add ("/document/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_DOC "/atk_test_document_get_attributes", + g_test_add ("/document/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 a0ad323d..dc78594f 100644 --- a/tests/at-spi2-atk/atk_test_editable_text.c +++ b/tests/at-spi2-atk/atk_test_editable_text.c @@ -103,20 +103,20 @@ atk_test_editable_text_paste_text (TestAppFixture *fixture, gconstpointer user_d void atk_test_editable_text (void) { - g_test_add (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_get_editable_text_iface", + g_test_add ("/editable_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 (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_set_attributes", + g_test_add ("/editable_text/atk_test_editable_text_set_attributes", TestAppFixture, DATA_FILE, fixture_setup, atk_test_editable_text_set_attributes, fixture_teardown); #endif - g_test_add (ATK_TEST_PATH_EDIT_TEXT "/atk_test_editable_text_insert_text", + g_test_add ("/editable_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", + g_test_add ("/editable_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", + g_test_add ("/editable_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", + g_test_add ("/editable_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", + g_test_add ("/editable_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 78bfeedd..81bec14d 100644 --- a/tests/at-spi2-atk/atk_test_hyperlink.c +++ b/tests/at-spi2-atk/atk_test_hyperlink.c @@ -142,18 +142,18 @@ atk_test_hyperlink_is_valid (TestAppFixture *fixture, gconstpointer user_data) void atk_test_hyperlink (void) { - g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hyperlink_get_n_anchors", + g_test_add ("/hyperlink/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", + g_test_add ("/hyperlink/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", + g_test_add ("/hyperlink/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", + g_test_add ("/hyperlink/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", + g_test_add ("/hyperlink/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", + g_test_add ("/hyperlink/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", + g_test_add ("/hyperlink/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 e4fd862d..b193c8d4 100644 --- a/tests/at-spi2-atk/atk_test_hypertext.c +++ b/tests/at-spi2-atk/atk_test_hypertext.c @@ -80,10 +80,10 @@ atk_test_hypertext_get_link_index (TestAppFixture *fixture, gconstpointer user_d void atk_test_hypertext (void) { - g_test_add (ATK_TEST_PATH_HYPERTEXT "/atk_test_hypertext_get_n_links", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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 f4bc4d06..eb8b2484 100644 --- a/tests/at-spi2-atk/atk_test_image.c +++ b/tests/at-spi2-atk/atk_test_image.c @@ -107,16 +107,16 @@ atk_test_image_get_image_locale (TestAppFixture *fixture, gconstpointer user_dat void atk_test_image (void) { - g_test_add (ATK_TEST_PATH_IMAGE "/atk_test_image_sample_get_interface", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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 c706b0d9..e9e4f16d 100644 --- a/tests/at-spi2-atk/atk_test_selection.c +++ b/tests/at-spi2-atk/atk_test_selection.c @@ -169,22 +169,22 @@ atk_test_selection_clear_selection (TestAppFixture *fixture, gconstpointer user_ void atk_test_selection (void) { - g_test_add (ATK_TEST_PATH_SELECTION "/atk_test_selection_sample_get_interface", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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 d32fa875..373d9ed2 100644 --- a/tests/at-spi2-atk/atk_test_state_set.c +++ b/tests/at-spi2-atk/atk_test_state_set.c @@ -210,24 +210,24 @@ atk_test_state_set_remove (TestAppFixture *fixture, gconstpointer user_data) void atk_test_state_set (void) { - g_test_add (ATK_TEST_PATH_STATE_SET "/atk_test_accessible_get_state_set", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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 6365298d..17a9ec8c 100644 --- a/tests/at-spi2-atk/atk_test_table.c +++ b/tests/at-spi2-atk/atk_test_table.c @@ -416,56 +416,56 @@ atk_test_table_is_selected (TestAppFixture *fixture, gconstpointer user_data) void atk_test_table (void) { - g_test_add (ATK_TEST_PATH_TABLE "/atk_test_table_get_caption", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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 d30b8044..463f1a16 100644 --- a/tests/at-spi2-atk/atk_test_table_cell.c +++ b/tests/at-spi2-atk/atk_test_table_cell.c @@ -181,24 +181,24 @@ atk_test_table_cell_get_table (TestAppFixture *fixture, gconstpointer user_data) void atk_test_table_cell (void) { - g_test_add (ATK_TEST_PATH_TABLE_CELL "/atk_test_accessible_get_table_cell", + g_test_add ("/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", + g_test_add ("/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 (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_column_header_cells", + g_test_add ("/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 (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_span", + g_test_add ("/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 (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_header_cells", + g_test_add ("/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 (ATK_TEST_PATH_TABLE_CELL "/atk_test_table_cell_get_row_column_span", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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 c8e41ef6..a5fb7f83 100644 --- a/tests/at-spi2-atk/atk_test_text.c +++ b/tests/at-spi2-atk/atk_test_text.c @@ -434,44 +434,44 @@ atk_test_text_get_bounded_ranges (TestAppFixture *fixture, gconstpointer user_da void atk_test_text (void) { - g_test_add (ATK_TEST_PATH_TEXT "/atk_test_text_get_character_count", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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_value.c b/tests/at-spi2-atk/atk_test_value.c index 14f45e04..db2cef24 100644 --- a/tests/at-spi2-atk/atk_test_value.c +++ b/tests/at-spi2-atk/atk_test_value.c @@ -111,18 +111,18 @@ atk_test_value_get_text (TestAppFixture *fixture, gconstpointer user_data) void atk_test_value (void) { - g_test_add (ATK_TEST_PATH_VALUE "/atk_test_value_get_value_iface", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/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", + g_test_add ("/value/atk_test_value_get_text", TestAppFixture, DATA_FILE, fixture_setup, atk_test_value_get_text, fixture_teardown); } -- cgit v1.2.1 From 2edd4053169499c842796efada3f3f207dc5ea59 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 5 May 2023 20:01:12 -0600 Subject: CI: disable p2p for the test run for now, otherwise it errors out With the changes to use an AtspiEventListener in tests/at-spi2-atk, at some point atspi-misc.c tries to connect to a socket from one of the test-application processes that is already dead. With -Ddisable_p2p=true, the tests work fine. --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f4514eb2..babf175d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,7 +51,8 @@ opensuse-x86_64: variables: MESON_EXTRA_FLAGS: "--buildtype=debug" # -Dwerror=true script: - - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build . + # See https://gitlab.gnome.org/GNOME/at-spi2-core/-/merge_requests/137 for the reason for disable_p2p + - meson setup ${MESON_EXTRA_FLAGS} -Ddisable_p2p=true --prefix /usr _build . - meson compile -C _build - meson install -C _build - mkdir /tmp/test+dir+with+funny+chars @@ -149,7 +150,8 @@ coverage: CFLAGS: "-coverage -ftest-coverage -fprofile-arcs" script: - source ./ci/env.sh - - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build . + # See https://gitlab.gnome.org/GNOME/at-spi2-core/-/merge_requests/137 for the reason for disable_p2p + - meson setup ${MESON_EXTRA_FLAGS} -Ddisable_p2p=true --prefix /usr _build . - meson compile -C _build - meson install -C _build - xvfb-run --auto-servernum dbus-run-session -- ci/run-registryd-tests.sh -- cgit v1.2.1 From e160239b7be6bced6f82fdd862c354a9d4847151 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 9 May 2023 11:23:10 -0600 Subject: atspi-misc.c: Remove debug g_print --- atspi/atspi-misc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index 01bd1634..9e68049d 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -246,8 +246,6 @@ get_application (const char *bus_name) DBusMessage *message; DBusPendingCall *pending = NULL; - g_print ("get_application %s\n", bus_name); - if (!app_hash) { app_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_object_unref); -- cgit v1.2.1 From abdc258b5751cf9b669bffb629d025b614f2177d Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 9 May 2023 11:23:22 -0600 Subject: Assert that an interface object is not null --- tests/at-spi2-atk/atk_test_table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/at-spi2-atk/atk_test_table.c b/tests/at-spi2-atk/atk_test_table.c index 17a9ec8c..0e4643e0 100644 --- a/tests/at-spi2-atk/atk_test_table.c +++ b/tests/at-spi2-atk/atk_test_table.c @@ -311,6 +311,7 @@ atk_test_table_is_row_selected (TestAppFixture *fixture, gconstpointer user_data AtspiAccessible *child = atspi_accessible_get_child_at_index (_obj, 0, NULL); g_assert (child); AtspiTable *obj = atspi_accessible_get_table_iface (child); + g_assert (obj); g_assert_true (atspi_table_is_row_selected (obj, 0, NULL)); g_assert_false (atspi_table_is_row_selected (obj, 1, NULL)); } -- cgit v1.2.1