[gtk/wip/sadiq/buildable-2080: 2/2] Add builder tests for bind-source without bind-property
- From: Mohammed Sadiq <pksadiq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/sadiq/buildable-2080: 2/2] Add builder tests for bind-source without bind-property
- Date: Sat, 10 Aug 2019 13:32:59 +0000 (UTC)
commit 039be11063d0f4a6c457d934c976fd21a49cc076
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Thu Aug 8 07:21:08 2019 +0530
Add builder tests for bind-source without bind-property
Fixes https://gitlab.gnome.org/GNOME/gtk/merge_requests/1047
testsuite/gtk/builder.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c
index 9c3b16f17e..31e6915da4 100644
--- a/testsuite/gtk/builder.c
+++ b/testsuite/gtk/builder.c
@@ -2450,14 +2450,19 @@ test_property_bindings (void)
" <property name=\"sensitive\" bind-source=\"checkbutton\" bind-property=\"active\" />"
" </object>"
" </child>"
+ " <child>"
+ " <object class=\"GtkButton\" id=\"button3\">"
+ " <property name=\"sensitive\" bind-source=\"button\" bind-flags=\"sync-create\" />"
+ " </object>"
+ " </child>"
" </object>"
" </child>"
" </object>"
"</interface>";
GtkBuilder *builder;
- GObject *checkbutton, *button, *button2, *window;
-
+ GObject *checkbutton, *button, *button2, *button3, *window;
+
builder = builder_new_from_string (buffer, -1, NULL);
checkbutton = gtk_builder_get_object (builder, "checkbutton");
@@ -2471,11 +2476,16 @@ test_property_bindings (void)
button2 = gtk_builder_get_object (builder, "button2");
g_assert (GTK_IS_BUTTON (button2));
g_assert (gtk_widget_get_sensitive (GTK_WIDGET (button2)));
-
+
+ button3 = gtk_builder_get_object (builder, "button3");
+ g_assert (GTK_IS_BUTTON (button3));
+ g_assert (!gtk_widget_get_sensitive (GTK_WIDGET (button3)));
+
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), TRUE);
g_assert (gtk_widget_get_sensitive (GTK_WIDGET (button)));
g_assert (gtk_widget_get_sensitive (GTK_WIDGET (button2)));
-
+ g_assert (gtk_widget_get_sensitive (GTK_WIDGET (button3)));
+
window = gtk_builder_get_object (builder, "window");
gtk_widget_destroy (GTK_WIDGET (window));
g_object_unref (builder);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]