[gtk/kill-containers: 27/45] testsuite: Fix listbox tests



commit b06e8b01ea25bf6f00633113d958ed52be7a4533
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 8 23:03:53 2020 -0400

    testsuite: Fix listbox tests
    
    When moving from gtk_container_forall to the widget dom
    api, we are now iterating over all children of the listbox,
    including headers, separators, etc. So, skip everything
    that is not a listboxrow, to make the tests work again.

 testsuite/gtk/listbox.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/testsuite/gtk/listbox.c b/testsuite/gtk/listbox.c
index 0c646bd5d3..88b24108eb 100644
--- a/testsuite/gtk/listbox.c
+++ b/testsuite/gtk/listbox.c
@@ -32,6 +32,9 @@ check_sorted (GtkListBox *list)
        row != NULL;
        row = gtk_widget_get_next_sibling (row))
     {
+      if (!GTK_IS_LIST_BOX_ROW (row))
+        continue;
+
       index = gtk_list_box_row_get_index (GTK_LIST_BOX_ROW (row));
       label = gtk_list_box_row_get_child (GTK_LIST_BOX_ROW (row));
       value = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (label), "data"));
@@ -292,6 +295,9 @@ check_filtered (GtkListBox *list)
        row != NULL;
        row = gtk_widget_get_next_sibling (row))
     {
+      if (!GTK_IS_LIST_BOX_ROW (row))
+        continue;
+
       if (gtk_widget_get_child_visible (row))
         count++;
     }
@@ -381,6 +387,9 @@ check_headers (GtkListBox *list)
        row != NULL;
        row = gtk_widget_get_next_sibling (row))
     {
+      if (!GTK_IS_LIST_BOX_ROW (row))
+        continue;
+
       if (gtk_list_box_row_get_header (GTK_LIST_BOX_ROW (row)) != NULL)
         count++;
     }


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