[gtksourceview/wip/regex-search] SearchContext: fix bug with GTask
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/regex-search] SearchContext: fix bug with GTask
- Date: Tue, 30 Jul 2013 20:23:57 +0000 (UTC)
commit 16bd5664d6ca7d94cadbafe462332e2e74de7c00
Author: Sébastien Wilmet <swilmet gnome org>
Date: Tue Jul 30 22:23:06 2013 +0200
SearchContext: fix bug with GTask
gtksourceview/gtksourcesearchcontext.c | 6 +++---
tests/test-search-context.c | 20 ++++++++++++++++----
2 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index c9b24a8..8e05cbf 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -2988,7 +2988,7 @@ gtk_source_search_context_forward_async (GtkSourceSearchContext *search,
}
clear_task (search);
- search->priv->task = g_task_new (search->priv->buffer, cancellable, callback, user_data);
+ search->priv->task = g_task_new (search, cancellable, callback, user_data);
smart_forward_search_async (search, iter, FALSE);
}
@@ -3024,7 +3024,7 @@ gtk_source_search_context_forward_finish (GtkSourceSearchContext *search,
return FALSE;
}
- g_return_val_if_fail (g_task_is_valid (result, search->priv->buffer), FALSE);
+ g_return_val_if_fail (g_task_is_valid (result, search), FALSE);
data = g_task_propagate_pointer (G_TASK (result), error);
@@ -3144,7 +3144,7 @@ gtk_source_search_context_backward_async (GtkSourceSearchContext *search,
}
clear_task (search);
- search->priv->task = g_task_new (search->priv->buffer, cancellable, callback, user_data);
+ search->priv->task = g_task_new (search, cancellable, callback, user_data);
smart_backward_search_async (search, iter, FALSE);
}
diff --git a/tests/test-search-context.c b/tests/test-search-context.c
index 72f9c36..aafc63d 100644
--- a/tests/test-search-context.c
+++ b/tests/test-search-context.c
@@ -531,7 +531,10 @@ test_forward_search (void)
check_search_results (source_buffer, context, results1, TRUE);
- g_test_trap_subprocess ("/Search/forward/subprocess/async-wrap-around", 0, 0);
+ g_test_trap_subprocess ("/Search/forward/subprocess/async-wrap-around",
+ 0,
+ G_TEST_SUBPROCESS_INHERIT_STDERR);
+
g_test_trap_assert_passed ();
/* Wrap around: FALSE */
@@ -542,7 +545,10 @@ test_forward_search (void)
check_search_results (source_buffer, context, results2, TRUE);
- g_test_trap_subprocess ("/Search/forward/subprocess/async-normal", 0, 0);
+ g_test_trap_subprocess ("/Search/forward/subprocess/async-normal",
+ 0,
+ G_TEST_SUBPROCESS_INHERIT_STDERR);
+
g_test_trap_assert_passed ();
g_object_unref (source_buffer);
@@ -642,7 +648,10 @@ test_backward_search (void)
gtk_source_search_settings_set_wrap_around (settings, TRUE);
check_search_results (source_buffer, context, results1, FALSE);
- g_test_trap_subprocess ("/Search/backward/subprocess/async-wrap-around", 0, 0);
+ g_test_trap_subprocess ("/Search/backward/subprocess/async-wrap-around",
+ 0,
+ G_TEST_SUBPROCESS_INHERIT_STDERR);
+
g_test_trap_assert_passed ();
/* Wrap around: FALSE */
@@ -650,7 +659,10 @@ test_backward_search (void)
gtk_source_search_settings_set_wrap_around (settings, FALSE);
check_search_results (source_buffer, context, results2, FALSE);
- g_test_trap_subprocess ("/Search/backward/subprocess/async-normal", 0, 0);
+ g_test_trap_subprocess ("/Search/backward/subprocess/async-normal",
+ 0,
+ G_TEST_SUBPROCESS_INHERIT_STDERR);
+
g_test_trap_assert_passed ();
g_object_unref (source_buffer);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]