Opened 9 years ago

Closed 9 years ago

#7109 closed enhancement (fixed)

gtk+-3.18.3 (gtk+3.18.3)

Reported by: Fernando de Oliveira Owned by: Fernando de Oliveira
Priority: normal Milestone: 7.9
Component: BOOK Version: SVN
Severity: normal Keywords:
Cc:

Description

http://ftp.gnome.org/pub/gnome/sources/gtk+/3.18/gtk+-3.18.3.tar.xz

http://ftp.gnome.org/pub/gnome/sources/gtk+/3.18/gtk+-3.18.3.sha256sum

f3c76791f93f51e260b03676f83007730b9875a0a9bf5cd42442e2f14e593546

http://ftp.gnome.org/pub/gnome/sources/gtk+/3.18/gtk+-3.18.3.news

Overview of Changes in GTK+ 3.18.3
==================================

* Bug fixes:
 • 735341 Fix/improve gtk_text_buffer_get_iter_at_*() functions
 • 753992 im-quartz discard_preedit segmentation fault
 • 755654 mmc/sd drive does not appear in Nautilus
 • 756160 Crash/segfault when dragging tabs (after 2nd/3rd/4th+ drag)
 • 756385 No more content in Anjuta project wizard
 • 756449 GtkTextHandle artifacts under Wayland
 • 756496 wayland: Make it possible to use a window type hint to map as
   a subsurface
 • 756505 Entering a dot removes all other characters from input
 • 756568 Some improvements to gtkplacesview
 • 756589 Improve the heuristics for external drives
 • 756625 segfault in captured_event_cb
 • 756751 Keypad decimal point patch prevents entry of comma in german
   keypad layout
 • 756780 wayland: Fix GtkTreeView's search window
 • 756886 The GtkWindow patch here is necessary to make transparent
   terminals work...
 • 757147 gdk_pixbuf_get_from_window() doesn't honor device scale
 • 757221 Memory leak in gtk-3.0.m4
 • 757298 nautilus crashes on drag'n'drop over 'side bar'
 • 757303 Vertically align path labels in Other Locations view
 • 757324 win32: handle WM_DISPLAYCHANGE globally
 • 757358 single touch devices are not detected as touch devices
 • 757377 settings.ini is only loaded from first XDG_CONFIG_DIRS entry
 • 757544 GtkHeaderBar subclass template and <child type="title"> does
   not work

* Translation updates:
 • Basque
 • Czech
 • Icelandic
 • Norwegian bokmål
 • Slovak

Change History (3)

comment:1 by Fernando de Oliveira, 9 years ago

Owner: changed from blfs-book@… to Fernando de Oliveira
Status: newassigned

comment:2 by Fernando de Oliveira, 9 years ago

One tests fails, now:

...
/tmp/gtk+-3.18.3/testsuite/reftests/flipping-icons.ui: FAIL
...
FAIL: gtk-reftest
...

Both gtk-reftes and flipping-icons.ui are identical to previous version ones in gtk+-3.18.2.

Suspect 735341 Fix/improve gtk_text_buffer_get_iter_at_*() functions, but it might be another commit. The former changes a lot textbuffer.c:

diff -Naur ./gtk+-3.18.2/testsuite/gtk/textbuffer.c ./gtk+-3.18.3/testsuite/gtk/textbuffer.c
--- ./gtk+-3.18.2/testsuite/gtk/textbuffer.c	2015-03-02 16:34:04.000000000 -0300
+++ ./gtk+-3.18.3/testsuite/gtk/textbuffer.c	2015-11-09 10:35:37.000000000 -0300
@@ -1434,6 +1434,128 @@
   g_object_unref (buffer);
 }
 
+static void
+test_get_iter (void)
+{
+  GtkTextBuffer *buffer;
+  GtkTextIter iter;
+  gint offset;
+
+  buffer = gtk_text_buffer_new (NULL);
+
+  /* ß takes 2 bytes in UTF-8 */
+  gtk_text_buffer_set_text (buffer, "ab\nßd\r\nef", -1);
+
+  /* Test get_iter_at_line() */
+  g_assert (gtk_text_buffer_get_iter_at_line (buffer, &iter, 0));
+  g_assert (gtk_text_iter_is_start (&iter));
+
+  g_assert (gtk_text_buffer_get_iter_at_line (buffer, &iter, 1));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 3);
+
+  g_assert (gtk_text_buffer_get_iter_at_line (buffer, &iter, 2));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 7);
+
+  g_assert (!gtk_text_buffer_get_iter_at_line (buffer, &iter, 3));
+  g_assert (gtk_text_iter_is_end (&iter));
+
+  /* Test get_iter_at_line_offset() */
+  g_assert (gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 0, 0));
+  g_assert (gtk_text_iter_is_start (&iter));
+
+  g_assert (gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 0, 1));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 1);
+
+  g_assert (gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 0, 2));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 2);
+
+  g_assert (!gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 0, 3));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 2);
+
+  g_assert (gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 1, 1));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 4);
+
+  g_assert (gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 2, 1));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 8);
+
+  g_assert (gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 2, 2));
+  g_assert (gtk_text_iter_is_end (&iter));
+
+  g_assert (!gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 2, 3));
+  g_assert (gtk_text_iter_is_end (&iter));
+
+  g_assert (!gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 3, 1));
+  g_assert (gtk_text_iter_is_end (&iter));
+
+  /* Test get_iter_at_line_index() */
+  g_assert (gtk_text_buffer_get_iter_at_line_index (buffer, &iter, 0, 0));
+  g_assert (gtk_text_iter_is_start (&iter));
+
+  g_assert (gtk_text_buffer_get_iter_at_line_index (buffer, &iter, 0, 1));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 1);
+
+  g_assert (gtk_text_buffer_get_iter_at_line_index (buffer, &iter, 0, 2));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 2);
+
+  g_assert (!gtk_text_buffer_get_iter_at_line_index (buffer, &iter, 0, 3));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 2);
+
+  g_assert (gtk_text_buffer_get_iter_at_line_index (buffer, &iter, 1, 0));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 3);
+
+  g_assert (gtk_text_buffer_get_iter_at_line_index (buffer, &iter, 1, 2));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 4);
+
+  g_assert (gtk_text_buffer_get_iter_at_line_index (buffer, &iter, 1, 3));
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 5);
+
+  g_assert (gtk_text_buffer_get_iter_at_line_index (buffer, &iter, 2, 2));
+  g_assert (gtk_text_iter_is_end (&iter));
+
+  g_assert (!gtk_text_buffer_get_iter_at_line_index (buffer, &iter, 2, 3));
+  g_assert (gtk_text_iter_is_end (&iter));
+
+  g_assert (!gtk_text_buffer_get_iter_at_line_index (buffer, &iter, 3, 1));
+  g_assert (gtk_text_iter_is_end (&iter));
+
+  /* Test get_iter_at_offset() */
+  gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
+  g_assert (gtk_text_iter_is_start (&iter));
+
+  gtk_text_buffer_get_iter_at_offset (buffer, &iter, 1);
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 1);
+
+  gtk_text_buffer_get_iter_at_offset (buffer, &iter, 8);
+  offset = gtk_text_iter_get_offset (&iter);
+  g_assert_cmpint (offset, ==, 8);
+  g_assert (!gtk_text_iter_is_end (&iter));
+
+  gtk_text_buffer_get_iter_at_offset (buffer, &iter, 9);
+  g_assert (gtk_text_iter_is_end (&iter));
+
+  gtk_text_buffer_get_iter_at_offset (buffer, &iter, 100);
+  g_assert (gtk_text_iter_is_end (&iter));
+
+  gtk_text_buffer_get_iter_at_offset (buffer, &iter, -1);
+  g_assert (gtk_text_iter_is_end (&iter));
+
+  g_object_unref (buffer);
+}
+
 int
 main (int argc, char** argv)
 {
@@ -1452,6 +1574,7 @@
   g_test_add_func ("/TextBuffer/Fill and Empty", test_fill_empty);
   g_test_add_func ("/TextBuffer/Tag", test_tag);
   g_test_add_func ("/TextBuffer/Clipboard", test_clipboard);
+  g_test_add_func ("/TextBuffer/Get iter", test_get_iter);
 
   return g_test_run();
 }

However, there is another modification in the testsuite:

diff -Naur ./gtk+-3.18.2/testsuite/a11y/text.c ./gtk+-3.18.3/testsuite/a11y/text.c
--- ./gtk+-3.18.2/testsuite/a11y/text.c	2014-11-26 23:54:55.000000000 -0300
+++ ./gtk+-3.18.3/testsuite/a11y/text.c	2015-11-09 10:35:06.000000000 -0300
@@ -36,6 +36,39 @@
 }
 
 static void
+append_text (GtkWidget   *widget,
+             const gchar *text)
+{
+  if (GTK_IS_LABEL (widget))
+    {
+      gchar *tmp;
+
+      tmp = g_strconcat (gtk_label_get_text (GTK_LABEL (widget)), text, NULL);
+      gtk_label_set_text (GTK_LABEL (widget), tmp);
+      g_free (tmp);
+    }
+  else if (GTK_IS_ENTRY (widget))
+    {
+      gchar *tmp;
+
+      tmp = g_strconcat (gtk_entry_get_text (GTK_ENTRY (widget)), text, NULL);
+      gtk_entry_set_text (GTK_ENTRY (widget), tmp);
+      g_free (tmp);
+    }
+  else if (GTK_IS_TEXT_VIEW (widget))
+    {
+      GtkTextBuffer *buffer;
+      GtkTextIter end;
+
+      buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget));
+      gtk_text_buffer_get_end_iter (buffer, &end);
+      gtk_text_buffer_insert (buffer, &end, text, -1);
+    }
+  else
+    g_assert_not_reached ();
+}
+
+static void
 test_basic (GtkWidget *widget)
 {
   AtkText *atk_text;
@@ -95,10 +128,14 @@
 test_text_changed (GtkWidget *widget)
 {
   AtkText *atk_text;
-  const gchar *text = "Text goes here";
-  const gchar *text2 = "Text again";
+  const gchar *text = "Täxt goes here";
+  const gchar *text2 = "Täxt again";
   SignalData delete_data;
   SignalData insert_data;
+  gboolean cant_append = FALSE;
+
+  if (GTK_IS_LABEL (widget) || GTK_IS_ENTRY (widget))
+    cant_append = TRUE;
 
   atk_text = ATK_TEXT (gtk_widget_get_accessible (widget));
 
@@ -118,23 +155,40 @@
   g_assert_cmpint (insert_data.position, ==, 0);
   g_assert_cmpint (insert_data.length, ==, g_utf8_strlen (text, -1));
 
-  set_text (widget, text2);
+  delete_data.count = 0;
+  insert_data.count = 0;
 
-  g_assert_cmpint (delete_data.count, ==, 1);
-  g_assert_cmpint (delete_data.position, ==, 0);
-  g_assert_cmpint (delete_data.length, ==, g_utf8_strlen (text, -1));
+  append_text (widget, text2);
 
-  g_assert_cmpint (insert_data.count, ==, 2);
-  g_assert_cmpint (insert_data.position, ==, 0);
-  g_assert_cmpint (insert_data.length, ==, g_utf8_strlen (text2, -1));
+  if (cant_append)
+    {
+      g_assert_cmpint (delete_data.count, ==, 1);
+      g_assert_cmpint (delete_data.position, ==, 0);
+      g_assert_cmpint (delete_data.length, ==, g_utf8_strlen (text, -1));
+
+      g_assert_cmpint (insert_data.count, ==, 1);
+      g_assert_cmpint (insert_data.position, ==, 0);
+      g_assert_cmpint (insert_data.length, ==, g_utf8_strlen (text, -1) + g_utf8_strlen (text2, -1));
+    }
+  else
+    {
+      g_assert_cmpint (delete_data.count, ==, 0);
+
+      g_assert_cmpint (insert_data.count, ==, 1);
+      g_assert_cmpint (insert_data.position, ==, g_utf8_strlen (text, -1));
+      g_assert_cmpint (insert_data.length, ==, g_utf8_strlen (text2, -1));
+    }
+
+  delete_data.count = 0;
+  insert_data.count = 0;
 
   set_text (widget, "");
 
-  g_assert_cmpint (delete_data.count, ==, 2);
+  g_assert_cmpint (delete_data.count, ==, 1);
   g_assert_cmpint (delete_data.position, ==, 0);
-  g_assert_cmpint (delete_data.length, ==, g_utf8_strlen (text2, -1));
+  g_assert_cmpint (delete_data.length, ==, g_utf8_strlen (text, -1) + g_utf8_strlen (text2, -1));
 
-  g_assert_cmpint (insert_data.count, ==, 2);
+  g_assert_cmpint (insert_data.count, ==, 0);
 
   g_signal_handlers_disconnect_by_func (atk_text, G_CALLBACK (text_deleted), &delete_data);
   g_signal_handlers_disconnect_by_func (atk_text, G_CALLBACK (text_inserted), &insert_data);

My plan is to include:

If you wish to execute the test suite, first remove one test which fails:

rm -v testsuite/reftests/flipping-icons.ui

To test the results you...

comment:3 by Fernando de Oliveira, 9 years ago

Resolution: fixed
Status: assignedclosed

Fixed at r16632.

Note: See TracTickets for help on using tickets.