Improve test coverage for property lookup models
This commit is contained in:
@@ -165,6 +165,7 @@ test_create_empty (void)
|
|||||||
GType type;
|
GType type;
|
||||||
guint n_items;
|
guint n_items;
|
||||||
char *property;
|
char *property;
|
||||||
|
GObject *object;
|
||||||
|
|
||||||
model = new_model (FALSE);
|
model = new_model (FALSE);
|
||||||
assert_model (model, "");
|
assert_model (model, "");
|
||||||
@@ -173,10 +174,12 @@ test_create_empty (void)
|
|||||||
g_assert_true (g_list_model_get_item_type (G_LIST_MODEL (model)) == GTK_TYPE_WIDGET);
|
g_assert_true (g_list_model_get_item_type (G_LIST_MODEL (model)) == GTK_TYPE_WIDGET);
|
||||||
g_object_get (model,
|
g_object_get (model,
|
||||||
"item-type", &type,
|
"item-type", &type,
|
||||||
|
"object", &object,
|
||||||
"n-items", &n_items,
|
"n-items", &n_items,
|
||||||
"property", &property,
|
"property", &property,
|
||||||
NULL);
|
NULL);
|
||||||
g_assert_true (type == GTK_TYPE_WIDGET);
|
g_assert_true (type == GTK_TYPE_WIDGET);
|
||||||
|
g_assert_null (object);
|
||||||
g_assert_true (n_items == 0);
|
g_assert_true (n_items == 0);
|
||||||
g_assert_cmpstr (property, ==, "parent");
|
g_assert_cmpstr (property, ==, "parent");
|
||||||
|
|
||||||
@@ -217,8 +220,12 @@ test_set_object (void)
|
|||||||
gtk_property_lookup_list_model_set_object (model, widget);
|
gtk_property_lookup_list_model_set_object (model, widget);
|
||||||
assert_model (model, "GtkLabel GtkGrid GtkBox GtkWindow");
|
assert_model (model, "GtkLabel GtkGrid GtkBox GtkWindow");
|
||||||
assert_changes (model, "0+4*");
|
assert_changes (model, "0+4*");
|
||||||
g_object_unref (model);
|
|
||||||
|
|
||||||
|
g_object_set (model, "object", NULL, NULL);
|
||||||
|
assert_model (model, "");
|
||||||
|
assert_changes (model, "0-4*");
|
||||||
|
|
||||||
|
g_object_unref (model);
|
||||||
destroy_widgets ();
|
destroy_widgets ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user