diff options
Diffstat (limited to 'tests/at-spi2-atk/atk_test_image.c')
-rw-r--r-- | tests/at-spi2-atk/atk_test_image.c | 54 |
1 files changed, 24 insertions, 30 deletions
diff --git a/tests/at-spi2-atk/atk_test_image.c b/tests/at-spi2-atk/atk_test_image.c index ff42c4cd..eb8b2484 100644 --- a/tests/at-spi2-atk/atk_test_image.c +++ b/tests/at-spi2-atk/atk_test_image.c @@ -26,15 +26,9 @@ #define DATA_FILE TESTS_DATA_DIR "/test-image.xml" static void -teardown_image_test (gpointer fixture, gconstpointer user_data) +atk_test_image_sample_get_interface (TestAppFixture *fixture, gconstpointer user_data) { - terminate_app (); -} - -static void -atk_test_image_sample_get_interface (gpointer 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); @@ -42,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); @@ -54,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); @@ -68,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); @@ -81,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); @@ -98,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); @@ -113,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, teardown_image_test); - 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); - 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); - 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); - 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); - 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); + 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 ("/image/atk_test_image_get_image_description", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_image_get_image_description, fixture_teardown); + 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 ("/image/atk_test_image_get_image_position", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_image_get_image_position, fixture_teardown); + 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 ("/image/atk_test_image_get_image_locale", + TestAppFixture, DATA_FILE, fixture_setup, atk_test_image_get_image_locale, fixture_teardown); } |