From: Matthias Clasen Date: Tue, 16 May 2023 15:55:40 +0000 (-0400) Subject: Improve test coverage for GtkPropertyLookupListModel X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~252^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c2676ad7856fd7f5b851ed12337ca6c48abbc370;p=gtk4.git Improve test coverage for GtkPropertyLookupListModel --- diff --git a/testsuite/gtk/propertylookuplistmodel.c b/testsuite/gtk/propertylookuplistmodel.c index ea83357bf8..a2e87d1fde 100644 --- a/testsuite/gtk/propertylookuplistmodel.c +++ b/testsuite/gtk/propertylookuplistmodel.c @@ -162,11 +162,24 @@ static void test_create_empty (void) { GtkPropertyLookupListModel *model; + GType type; + guint n_items; + char *property; model = new_model (FALSE); assert_model (model, ""); assert_changes (model, ""); + g_assert_true (g_list_model_get_item_type (G_LIST_MODEL (model)) == GTK_TYPE_WIDGET); + g_object_get (model, + "item-type", &type, + "n-items", &n_items, + "property", &property, + NULL); + g_assert_true (type == GTK_TYPE_WIDGET); + g_assert_true (n_items == 0); + g_assert_cmpstr (property, ==, "parent"); + g_object_unref (model); } @@ -193,6 +206,8 @@ test_set_object (void) model = new_model (FALSE); gtk_property_lookup_list_model_set_object (model, widget); + g_assert_true (gtk_property_lookup_list_model_get_object (model) == widget); + assert_model (model, "GtkLabel GtkGrid GtkBox GtkWindow"); assert_changes (model, "+0*"); g_object_unref (model);