From 6e15da61065e4bab323c48e3300b59d7642f2053 Mon Sep 17 00:00:00 2001 From: billh Date: Tue, 11 Dec 2001 19:06:17 +0000 Subject: [PATCH] Added test for action in test-simple.c. Fixed bug in get_action_from_servant. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@180 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- ChangeLog | 11 ++++++++++- libspi/action.c | 2 +- test/test-simple.c | 26 +++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f115827..0b0bba2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-12-11 Bill Haneman + + * test/test-simple.c: + Add test_action. + + * libspi/action.c: + Bugfix for get_action_from_servant (). + 2001-12-11 Michael Meeks * libspi/libspi.h: remove registry.h and @@ -16,7 +24,8 @@ Replace setenv() call with putenv (). * libspi/component.c: - Bugfix in AccessibleComponent_getExtents (). + Bugfix in AccessibleComponent_getExtents (), + (from Adi Dascal). 2001-12-11 Michael Meeks diff --git a/libspi/action.c b/libspi/action.c index 3154464..48fdb5e 100644 --- a/libspi/action.c +++ b/libspi/action.c @@ -91,7 +91,7 @@ spi_action_interface_new (AtkObject *obj) static AtkAction * get_action_from_servant (PortableServer_Servant servant) { - SpiBase *object = SPI_BASE (servant); + SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant)); return ATK_ACTION (object->atko); } diff --git a/test/test-simple.c b/test/test-simple.c index b64ee96..59b41e2 100644 --- a/test/test-simple.c +++ b/test/test-simple.c @@ -122,7 +122,7 @@ create_test_window (void) widget = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_LARGE_TOOLBAR); test_window_add_and_show (GTK_CONTAINER (vbox), widget); - + widget = g_object_new (GTK_TYPE_RANGE, NULL); gtk_range_set_range (GTK_RANGE (widget), 0.0, 100.0); test_window_add_and_show (GTK_CONTAINER (vbox), widget); @@ -158,6 +158,28 @@ test_roles (void) } static void +test_action (AccessibleAction *action) +{ + gint n_actions, i; + gchar *s, *sd; + g_assert ((n_actions = AccessibleAction_getNActions (action)) >= 0); + + fprintf (stderr, "Testing actions..."); + for (i = 0; i < n_actions; ++i) + { + s = AccessibleAction_getName (action, i); + g_assert (s); + sd = AccessibleAction_getDescription (action, i); + g_assert (sd); + fprintf (stderr, "%d: %s (%s); ", i, s, sd); + SPI_freeString (s); + SPI_freeString (sd); + /* g_assert (AccessibleAction_doAction (action, i)); */ + } + fprintf (stderr, "\n"); +} + +static void test_desktop (void) { Accessible *desktop; @@ -460,6 +482,8 @@ validate_accessible (Accessible *accessible, g_assert (tmp != NULL); if (print_tree) fprintf (stderr, "At"); + else + test_action (tmp); AccessibleAction_unref (tmp); } -- 2.7.4