[gtk/prop-list] Add another expression bind test
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/prop-list] Add another expression bind test
- Date: Sun, 15 Dec 2019 16:09:09 +0000 (UTC)
commit 295ba942a51fc697d1007eb67ff0539ec26327c8
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Dec 15 11:08:13 2019 -0500
Add another expression bind test
This one binds an object expression
testsuite/gtk/expression.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
---
diff --git a/testsuite/gtk/expression.c b/testsuite/gtk/expression.c
index 652590b64b..ec3dd9cf79 100644
--- a/testsuite/gtk/expression.c
+++ b/testsuite/gtk/expression.c
@@ -657,6 +657,34 @@ test_binds (void)
g_object_unref (filter3);
}
+/* test that binds work ok with object expressions */
+static void
+test_bind_object (void)
+{
+ GtkFilter *filter;
+ GListStore *store;
+ GtkFilterListModel *model;
+ GtkExpression *expr;
+
+ filter = gtk_string_filter_new ();
+ store = g_list_store_new (G_TYPE_OBJECT);
+ model = gtk_filter_list_model_new (G_LIST_MODEL (store), NULL);
+
+ expr = gtk_object_expression_new (G_OBJECT (filter));
+
+ gtk_expression_bind (gtk_expression_ref (expr), model, NULL, "filter");
+
+ g_assert_true (gtk_filter_list_model_get_filter (model) == filter);
+
+ g_object_unref (filter);
+
+ g_assert_true (gtk_filter_list_model_get_filter (model) == filter);
+
+ gtk_expression_unref (expr);
+ g_object_unref (model);
+ g_object_unref (store);
+}
+
int
main (int argc, char *argv[])
{
@@ -677,6 +705,7 @@ main (int argc, char *argv[])
g_test_add_func ("/expression/nested-bind", test_nested_bind);
g_test_add_func ("/expression/double-bind", test_double_bind);
g_test_add_func ("/expression/binds", test_binds);
+ g_test_add_func ("/expression/bind-object", test_bind_object);
return g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]