[gspell/wip/unit-tests] inline-checker-text-buffer: add a unit test mode
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gspell/wip/unit-tests] inline-checker-text-buffer: add a unit test mode
- Date: Thu, 4 Feb 2016 11:38:17 +0000 (UTC)
commit 533f8388d72b3f6b268280ea75564adef6b95ac0
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Feb 4 12:24:57 2016 +0100
inline-checker-text-buffer: add a unit test mode
gspell/gspell-inline-checker-text-buffer.c | 14 ++++++++++++++
gspell/gspell-inline-checker-text-buffer.h | 5 +++++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/gspell/gspell-inline-checker-text-buffer.c b/gspell/gspell-inline-checker-text-buffer.c
index 93bc4ac..5dc20aa 100644
--- a/gspell/gspell-inline-checker-text-buffer.c
+++ b/gspell/gspell-inline-checker-text-buffer.c
@@ -49,6 +49,11 @@ struct _GspellInlineCheckerTextBuffer
GspellTextRegion *scan_region;
guint timeout_id;
+
+ /* If the unit test mode is enabled, there is no timeouts, and the whole
+ * buffer is scanned synchronously.
+ */
+ guint unit_test_mode : 1;
};
enum
@@ -1204,4 +1209,13 @@ _gspell_inline_checker_text_buffer_detach_view (GspellInlineCheckerTextBuffer *s
spell->views = g_slist_remove (spell->views, view);
}
+void
+_gspell_inline_checker_text_buffer_set_unit_test_mode (GspellInlineCheckerTextBuffer *spell,
+ gboolean unit_test_mode)
+{
+ g_return_if_fail (GSPELL_IS_INLINE_CHECKER_TEXT_BUFFER (spell));
+
+ spell->unit_test_mode = unit_test_mode != FALSE;
+}
+
/* ex:set ts=8 noet: */
diff --git a/gspell/gspell-inline-checker-text-buffer.h b/gspell/gspell-inline-checker-text-buffer.h
index 1a0308c..e45f4ac 100644
--- a/gspell/gspell-inline-checker-text-buffer.h
+++ b/gspell/gspell-inline-checker-text-buffer.h
@@ -46,6 +46,11 @@ G_GNUC_INTERNAL
void _gspell_inline_checker_text_buffer_detach_view (GspellInlineCheckerTextBuffer *spell,
GtkTextView *view);
+G_GNUC_INTERNAL
+void _gspell_inline_checker_text_buffer_set_unit_test_mode
+ (GspellInlineCheckerTextBuffer *spell,
+ gboolean unit_test_mode);
+
#endif /* __GSPELL_INLINE_CHECKER_TEXT_BUFFER_H__ */
/* ex:set ts=8 noet: */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]