Added some tests for Table interface to test-simple.
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 10 Dec 2001 20:41:14 +0000 (20:41 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 10 Dec 2001 20:41:14 +0000 (20:41 +0000)
git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@164 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
test/test-simple.c

index f05476a..d7bb8c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+
+2001-12-10  Bill Haneman  <bill.haneman@sun.com>
+
+       * test/test-simple.c:
+       Added test_table (GtkTreeView widget in test window to follow).
+       Un-commented test_value, will add GtkRange as well.
+
 2001-12-10  Michael Meeks  <michael@ximian.com>
 
        * cspi/spi_text.c: audit for exception handling,
index bd55cde..7f46ed4 100644 (file)
@@ -185,6 +185,32 @@ test_editable_text (AccessibleEditableText *etext)
 }
 
 static void
+test_table (AccessibleTable *table)
+{
+       char *str;
+       gint index;
+       gint rows, columns;
+
+       fprintf (stderr, "Testing table ...\n");
+
+       rows = AccessibleTable_getNRows (table);
+       g_assert (rows > 0);
+       
+       columns = AccessibleTable_getNColumns (table);
+       g_assert (columns > 0);
+       
+       index = AccessibleTable_getIndexAt (table, rows-1, columns-1);
+
+       g_assert (AccessibleTable_getRowAtIndex (table, index) == rows-1);
+
+       g_assert (AccessibleTable_getColumnAtIndex (table, index) == columns-1);
+
+       g_assert (AccessibleTable_getColumnHeader (table, 0)); /* maybe bogus assertion */
+
+       /* FIXME: lots more tests */
+}
+
+static void
 test_text (AccessibleText *text)
 {
        char *str;
@@ -205,6 +231,8 @@ test_text (AccessibleText *text)
        AccessibleText_setCaretOffset (text, 7);
        g_assert (AccessibleText_getCaretOffset (text) == 7);
 
+       AccessibleText_isSelected (text, 0, 0); /* no assertion, but see if warnings are thrown */
+       
        /* FIXME: lots more tests - selections etc. etc. */
 }
 
@@ -431,6 +459,8 @@ validate_accessible (Accessible *accessible,
                g_assert (tmp != NULL);
                if (print_tree)
                        fprintf (stderr, "Ta");
+               else
+                       test_table (tmp);
                AccessibleTable_unref (tmp);
        }
 
@@ -450,7 +480,7 @@ validate_accessible (Accessible *accessible,
                if (print_tree)
                        fprintf (stderr, "Va");
                else
-                       ; /* test_value (tmp); */
+                       test_value (tmp); 
                AccessibleValue_unref (tmp);
        }