[gtk+/wip/baedert/drawing: 380/396] Fix a few testsuite failures
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/drawing: 380/396] Fix a few testsuite failures
- Date: Wed, 19 Jul 2017 11:42:20 +0000 (UTC)
commit 2ef086667078aa4c035a6f579657969a365cde78
Author: Timm Bäder <mail baedert org>
Date: Thu Jul 13 16:28:49 2017 +0200
Fix a few testsuite failures
Adjust default property values, skip GtkRange:adjustment.
gtk/gtkentry.c | 2 +-
gtk/gtkeventbox.c | 2 +-
gtk/gtkspinbutton.c | 6 +++---
testsuite/gtk/defaultvalue.c | 12 ++++++++++++
testsuite/gtk/gtkmenu.c | 4 ++++
5 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 4780920..5c3a9f1 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -7864,7 +7864,7 @@ gtk_entry_get_icon_sensitive (GtkEntry *entry,
icon_info = priv->icons[icon_pos];
if (!icon_info)
- return FALSE;
+ return TRUE; /* Default of the property */
return gtk_widget_get_sensitive (icon_info->widget);
}
diff --git a/gtk/gtkeventbox.c b/gtk/gtkeventbox.c
index ae1b533..6a6ba9f 100644
--- a/gtk/gtkeventbox.c
+++ b/gtk/gtkeventbox.c
@@ -95,7 +95,7 @@ gtk_event_box_class_init (GtkEventBoxClass *class)
g_param_spec_boolean ("visible-window",
P_("Visible Window"),
P_("Whether the event box is visible, as opposed to
invisible and only used to trap events."),
- TRUE,
+ FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
g_object_class_install_property (gobject_class,
PROP_ABOVE_CHILD,
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 2593cd8..71498d9 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -422,7 +422,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
g_param_spec_string ("text",
P_("Text"),
P_("The contents of the entry"),
- "",
+ "0", /* Default value of the default adjustment */
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
g_object_class_override_property (gobject_class,
@@ -436,8 +436,8 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
*
* The ::input signal can be used to influence the conversion of
* the users input into a double value. The signal handler is
- * expected to use gtk_entry_get_text() to retrieve the text of
- * the entry and set @new_value to the new value.
+ * expected to use gtk_spin_button_get_text() to retrieve the text of
+ * the spinbutton and set @new_value to the new value.
*
* The default conversion uses g_strtod().
*
diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c
index e54b499..698471e 100644
--- a/testsuite/gtk/defaultvalue.c
+++ b/testsuite/gtk/defaultvalue.c
@@ -331,6 +331,18 @@ G_GNUC_END_IGNORE_DEPRECATIONS
strcmp (pspec->name, "show-desktop") == 0)
continue;
+ /* GtkRange constructs an adjustment on its own if NULL is set and
+ * the property is a CONSTRUCT one, so the returned value is never NULL. */
+ if (g_type_is_a (type, GTK_TYPE_RANGE) &&
+ strcmp (pspec->name, "adjustment") == 0)
+ continue;
+
+ /* ... and GtkScrollbar wraps that property. */
+ if (g_type_is_a (type, GTK_TYPE_SCROLLBAR) &&
+ strcmp (pspec->name, "adjustment") == 0)
+ continue;
+
+
if (g_test_verbose ())
g_print ("Property %s.%s\n",
g_type_name (pspec->owner_type),
diff --git a/testsuite/gtk/gtkmenu.c b/testsuite/gtk/gtkmenu.c
index c17d50a..589576c 100644
--- a/testsuite/gtk/gtkmenu.c
+++ b/testsuite/gtk/gtkmenu.c
@@ -228,6 +228,8 @@ get_label (GtkMenuItem *item)
children = g_list_concat (children, gtk_container_get_children (children->data));
else if (GTK_IS_LABEL (children->data))
label = gtk_label_get_text (children->data);
+ else if (GTK_IS_ACCEL_LABEL (children->data))
+ label = gtk_accel_label_get_label (children->data);
children = g_list_delete_link (children, children);
}
@@ -372,6 +374,8 @@ assert_section_equality (GSList **children,
contents = gtk_bin_get_child ((*children)->data);
if (GTK_IS_LABEL (contents))
label = gtk_label_get_label (GTK_LABEL (contents));
+ else if (GTK_IS_ACCEL_LABEL (contents))
+ label = gtk_accel_label_get_label (GTK_ACCEL_LABEL (contents));
else
label = "";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]