[gtksourceview] Begin unit tests of CompletionModel
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Begin unit tests of CompletionModel
- Date: Sun, 6 Jan 2013 21:21:45 +0000 (UTC)
commit 1d4d0a593f83351a455872a55eb05fbcdb110b09
Author: SÃbastien Wilmet <swilmet gnome org>
Date: Thu Jan 3 22:09:19 2013 +0100
Begin unit tests of CompletionModel
tests/Makefile.am | 9 ++++++++
tests/test-completion-model.c | 46 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2b4208c..d9bf382 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -48,6 +48,15 @@ test_buffer_LDADD = \
$(DEP_LIBS) \
$(TESTS_LIBS)
+UNIT_TEST_PROGS += test-completion-model
+test_completion_model_SOURCES = \
+ test-completion-model.c \
+ $(top_srcdir)/gtksourceview/gtksourcecompletionmodel.c
+test_completion_model_LDADD = \
+ $(top_builddir)/gtksourceview/libgtksourceview-3.0.la \
+ $(DEP_LIBS) \
+ $(TESTS_LIBS)
+
python_tests = \
test-completion.py \
test-widget.py
diff --git a/tests/test-completion-model.c b/tests/test-completion-model.c
new file mode 100644
index 0000000..14ac1f5
--- /dev/null
+++ b/tests/test-completion-model.c
@@ -0,0 +1,46 @@
+/*
+ * test-completion-model.c
+ * This file is part of GtkSourceView
+ *
+ * Copyright (C) 2013 - SÃbastien Wilmet <swilmet gnome org>
+ *
+ * GtkSourceView is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GtkSourceView is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <gtk/gtk.h>
+#include <gtksourceview/gtksource.h>
+#include "gtksourceview/gtksourcecompletionmodel.h"
+
+static void
+test_is_empty (void)
+{
+ GtkSourceCompletionModel *model;
+
+ model = gtk_source_completion_model_new ();
+ g_assert (gtk_source_completion_model_is_empty (model, FALSE));
+ g_assert (gtk_source_completion_model_is_empty (model, TRUE));
+
+ g_object_unref (model);
+}
+
+int
+main (int argc, char **argv)
+{
+ gtk_test_init (&argc, &argv);
+
+ g_test_add_func ("/CompletionModel/is-empty", test_is_empty);
+
+ return g_test_run ();
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]