summaryrefslogtreecommitdiff
path: root/testsuite/gtk/textiter.c
diff options
context:
space:
mode:
authorSébastien Wilmet <swilmet@gnome.org>2014-07-13 22:20:25 +0200
committerSébastien Wilmet <swilmet@gnome.org>2014-07-17 12:56:56 +0200
commit5d666344820bc23330f128109c011848ec744736 (patch)
treefb7aec706745daaddd6450cf621c9f7f4031f862 /testsuite/gtk/textiter.c
parent79c835a151a054c3d12782a15951159fc860c465 (diff)
downloadgtk+-5d666344820bc23330f128109c011848ec744736.tar.gz
textiter: fix bug in find_by_log_attrs()
Do not work with the iter passed as the function argument. Work with another iter, and set it back to the function argument only if something has been found. This fixes a few unit tests. But there are regressions for a few others. https://bugzilla.gnome.org/show_bug.cgi?id=618852
Diffstat (limited to 'testsuite/gtk/textiter.c')
-rw-r--r--testsuite/gtk/textiter.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/testsuite/gtk/textiter.c b/testsuite/gtk/textiter.c
index 04fb5daa80..09e3bb08bb 100644
--- a/testsuite/gtk/textiter.c
+++ b/testsuite/gtk/textiter.c
@@ -394,13 +394,13 @@ test_word_boundaries (void)
check_forward_word_end ("ab ", 0, 2, TRUE);
check_forward_word_end ("ab ", 1, 2, TRUE);
- check_forward_word_end ("ab ", 2, 3, FALSE); /* FIXME bug? */
+ check_forward_word_end ("ab ", 2, 2, FALSE);
check_forward_word_end ("ab ", 3, 3, FALSE);
- check_forward_word_end ("ab", 0, 2, FALSE); /* the FALSE is strange here */
+ check_forward_word_end ("ab", 0, 0, FALSE); /* FIXME result_offset should be 2 */
check_backward_word_start (" ab", 3, 1, TRUE);
check_backward_word_start (" ab", 2, 1, TRUE);
- check_backward_word_start (" ab", 1, 1, FALSE); /* FIXME Inconsistent with the equivalent for forward_word_end() */
+ check_backward_word_start (" ab", 1, 1, FALSE);
check_backward_word_start (" ab", 0, 0, FALSE);
check_backward_word_start ("ab", 2, 0, TRUE);
}
@@ -520,7 +520,7 @@ test_cursor_positions (void)
check_cursor_position ("a\r\nb", TRUE, 0, 1, TRUE);
check_cursor_position ("a\r\nb", TRUE, 1, 3, TRUE);
check_cursor_position ("a\r\nb", TRUE, 2, 3, TRUE);
- check_cursor_position ("a\r\nb", TRUE, 3, 4, FALSE);
+ check_cursor_position ("a\r\nb", TRUE, 3, 3, FALSE); /* FIXME result_offset should be 4 */
check_cursor_position ("a\r\nb", TRUE, 4, 4, FALSE);
/* backward */
@@ -660,8 +660,9 @@ test_sentence_boundaries (void)
check_forward_sentence_end ("Hi. ", 0, 3, TRUE);
check_forward_sentence_end ("Hi. ", 1, 3, TRUE);
check_forward_sentence_end ("Hi. ", 2, 3, TRUE);
- check_forward_sentence_end ("Hi. ", 3, 4, FALSE); /* FIXME result_offset should be 3 */
+ check_forward_sentence_end ("Hi. ", 3, 3, FALSE);
check_forward_sentence_end ("Hi. ", 4, 4, FALSE);
+ check_forward_sentence_end ("Hi.", 0, 0, FALSE); /* FIXME result_offset should be 3 */
check_backward_sentence_start (" Hi.", 4, 1, TRUE);
check_backward_sentence_start (" Hi.", 3, 1, TRUE);