[gtksourceview] tests: make snippet testsuite use g_test
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] tests: make snippet testsuite use g_test
- Date: Sun, 3 Apr 2022 17:40:02 +0000 (UTC)
commit 2f31c5e5ac48c93fcc597e9f1872ed36e7526882
Author: Christian Hergert <chergert redhat com>
Date: Sun Apr 3 10:31:31 2022 -0700
tests: make snippet testsuite use g_test
tests/test-snippets.c | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/tests/test-snippets.c b/tests/test-snippets.c
index 14d68201..a37febc1 100644
--- a/tests/test-snippets.c
+++ b/tests/test-snippets.c
@@ -27,18 +27,14 @@ static const gchar *search_path[] = {
NULL
};
-gint
-main (gint argc,
- gchar *argv[])
+static void
+test_simple (void)
{
GtkSourceSnippetManager *mgr;
GtkSourceSnippet *snippet;
const gchar **groups;
- gtk_init ();
- gtk_source_init ();
-
- mgr = gtk_source_snippet_manager_get_default ();
+ mgr = g_object_new (GTK_SOURCE_TYPE_SNIPPET_MANAGER, NULL);
gtk_source_snippet_manager_set_search_path (mgr, search_path);
/* Update if you add new groups to data/snippets/ */
@@ -52,7 +48,23 @@ main (gint argc,
g_assert_nonnull (snippet);
g_assert_finalize_object (snippet);
+ g_assert_finalize_object (mgr);
+}
+
+gint
+main (gint argc,
+ gchar *argv[])
+{
+ int ret;
+
+ gtk_init ();
+ gtk_source_init ();
+ g_test_init (&argc, &argv, NULL);
+
+ g_test_add_func ("/SourceView/Snippets/parse-bundle", test_simple);
+ ret = g_test_run ();
+
gtk_source_finalize ();
- return 0;
+ return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]