[at-spi2-core: 6/10] atk_test_selection_get_selected_child: let the compiler know that the counter won't go past the limi




commit 67b922ca086119306e85bfa31137f41bc6e357d9
Author: Federico Mena Quintero <federico gnome org>
Date:   Mon Jul 4 18:25:53 2022 -0500

    atk_test_selection_get_selected_child: let the compiler know that the counter won't go past the limit
    
    The selected_count of children must be equal to the number of objects
    in test-selection.xml that are marked as selected.  We know that
    number, but the compiler doesn't - so, put in an assertion to let it
    know that the counter won't go past the length of the number of
    available children.
    
    Caught by the static-scan job.

 tests/at-spi2-atk/atk_test_selection.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/tests/at-spi2-atk/atk_test_selection.c b/tests/at-spi2-atk/atk_test_selection.c
index 9c316453..12a87cf5 100644
--- a/tests/at-spi2-atk/atk_test_selection.c
+++ b/tests/at-spi2-atk/atk_test_selection.c
@@ -66,6 +66,7 @@ atk_test_selection_get_selected_child (gpointer fixture, gconstpointer user_data
   AtspiAccessible *o = NULL;
   int i=0;
   int selected_count = atspi_selection_get_n_selected_children (iface, NULL);
+  g_assert_cmpint (selected_count, ==, 3);
   for (i=0; i<selected_count; i++) {
     o = atspi_selection_get_selected_child (iface, i, NULL);
     g_assert_cmpstr (atspi_accessible_get_name (o, NULL), ==, valid_names[i]);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]