2002-01-24 Mark McLoughlin <mark@skynet.ie>
authormmclouglin <mmclouglin@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 24 Jan 2002 12:41:09 +0000 (12:41 +0000)
committermmclouglin <mmclouglin@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 24 Jan 2002 12:41:09 +0000 (12:41 +0000)
        * cspi/spi_accessible.c: (Accessible_getRelationSet):
        use NULL, not CORBA_OBJECT_NIL.

        * libspi/accessible.c:
        (impl_accessibility_accessible_get_relation_set):
        allocate the sequence correctly.

        * libspi/remoteobject.h: kill spi_remote_object_new.

        * test/test-simple.c: (validate_accessible): add code
        to test relation sets, now all we need is to figure
        out how to excercise this code path :/

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@229 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
cspi/spi_accessible.c
libspi/accessible.c
libspi/remoteobject.h
test/test-simple.c

index f397960..2436876 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2002-01-24  Mark McLoughlin  <mark@skynet.ie>
+
+       * cspi/spi_accessible.c: (Accessible_getRelationSet):
+       use NULL, not CORBA_OBJECT_NIL.
+
+       * libspi/accessible.c:
+       (impl_accessibility_accessible_get_relation_set):
+       allocate the sequence correctly.
+
+       * libspi/remoteobject.h: kill spi_remote_object_new.
+
+       * test/test-simple.c: (validate_accessible): add code
+       to test relation sets, now all we need is to figure
+       out how to excercise this code path :/
+
 2002-01-18  Michael Meeks  <michael@ximian.com>
 
        * test/test-simple.c
index 034637e..433ac64 100644 (file)
@@ -406,7 +406,7 @@ Accessible_getRelationSet (Accessible *obj)
       relations[i] = cspi_object_add (CORBA_Object_duplicate (
              relation_set->_buffer[i], cspi_ev ()));
     }
-  relations[i] = CORBA_OBJECT_NIL;
+  relations[i] = NULL;
 
   CORBA_free (relation_set);
 
index ba2b4e1..20a589e 100644 (file)
@@ -334,8 +334,11 @@ impl_accessibility_accessible_get_relation_set (PortableServer_Servant servant,
   relation_set = atk_object_ref_relation_set (object);
 
   n_relations = atk_relation_set_get_n_relations (relation_set);
+
   retval = CORBA_sequence_Accessibility_Relation__alloc ();
-  CORBA_sequence_Accessibility_Relation_allocbuf (n_relations);
+  retval->_length = retval->_maximum = n_relations;
+  retval->_buffer = CORBA_sequence_Accessibility_Relation_allocbuf (n_relations);
+  CORBA_sequence_set_release (retval, CORBA_TRUE);
          
   for (i = 0; i < n_relations; ++i)
     {
@@ -346,7 +349,6 @@ impl_accessibility_accessible_get_relation_set (PortableServer_Servant servant,
          ev);
     }
   
-  printf ("SpiAccessible get_relation_set.\n");
   return retval;
 }
 
index a67597b..26f1250 100644 (file)
@@ -42,7 +42,6 @@ typedef struct {
 } SpiRemoteObjectClass;
 
 GType                    spi_remote_object_get_type       (void);
-AtkObject               *spi_remote_object_new            (GObject           *o);
 Accessibility_Accessible spi_remote_object_get_accessible (SpiRemoteObject   *o);
 
 G_END_DECLS
index 3b33e60..f0048a6 100644 (file)
@@ -459,11 +459,13 @@ validate_accessible (Accessible *accessible,
                     gboolean    has_parent,
                     gboolean    recurse_down)
 {
-       Accessible    *tmp;
-       char          *name, *descr;
-       AccessibleRole role;
-       char          *role_name;
-       GString       *item_str = g_string_new ("");
+       Accessible          *tmp;
+       char                *name, *descr;
+       AccessibleRole       role;
+       AccessibleRelation **relations;
+       char                *role_name;
+       GString             *item_str = g_string_new ("");
+       int                  i;
 
        name = Accessible_getName (accessible);
        g_assert (name != NULL);
@@ -475,7 +477,26 @@ validate_accessible (Accessible *accessible,
        g_assert (role != SPI_ROLE_INVALID);
        role_name = Accessible_getRoleName (accessible);
        g_assert (role_name != NULL);
-       
+
+       relations = Accessible_getRelationSet (accessible);
+       g_assert (relations != NULL);
+
+       for (i = 0; relations [i]; i++) {
+               AccessibleRelationType type;
+               int                    targets;
+
+               fprintf (stderr, "relation %d\n", i);
+
+               type = AccessibleRelation_getRelationType (relations [i]);
+               g_assert (type != SPI_RELATION_NULL);
+
+               targets = AccessibleRelation_getNTargets (relations [i]);
+               g_assert (targets != -1);
+
+               AccessibleRelation_unref (relations [i]);
+               relations [i] = NULL;
+       }
+       g_free (relations);
 
        if (print_tree) {
                int i;