From: billh Date: Mon, 10 Dec 2001 20:41:14 +0000 (+0000) Subject: Added some tests for Table interface to test-simple. X-Git-Tag: AT_SPI2_ATK_2_12_0~1485 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git;a=commitdiff_plain;h=f1c8adb2ae1f20dbb59173dbed38c5e8656fa27d Added some tests for Table interface to test-simple. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@164 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- diff --git a/ChangeLog b/ChangeLog index f05476a..d7bb8c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ + +2001-12-10 Bill Haneman + + * 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 * cspi/spi_text.c: audit for exception handling, diff --git a/test/test-simple.c b/test/test-simple.c index bd55cde..7f46ed4 100644 --- a/test/test-simple.c +++ b/test/test-simple.c @@ -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); }