[gobject-introspection] tests: Convert gitestthrows to use GTest framework
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] tests: Convert gitestthrows to use GTest framework
- Date: Sun, 21 Jun 2015 20:07:28 +0000 (UTC)
commit 5d47bb3a72e12150d7862d602d5032cf920c3543
Author: Garrett Regier <garrett regier riftio com>
Date: Wed Jun 3 05:01:49 2015 -0700
tests: Convert gitestthrows to use GTest framework
Based on a patch by Simon Feltman.
tests/repository/gitestthrows.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/tests/repository/gitestthrows.c b/tests/repository/gitestthrows.c
index 39a0df8..17694bf 100644
--- a/tests/repository/gitestthrows.c
+++ b/tests/repository/gitestthrows.c
@@ -1,11 +1,9 @@
#include "girepository.h"
-#include <stdlib.h>
-
-int
-main(int argc, char **argv)
+static void
+test_invoke_gerror (void)
{
GIRepository *repo;
GITypelib *ret;
@@ -36,12 +34,20 @@ main(int argc, char **argv)
0,
&ret_arg,
&error);
- g_free(in_arg[0].v_string);
+ g_free (in_arg[0].v_string);
g_assert (invoke_return == FALSE);
g_assert (error != NULL);
g_assert (error->domain == G_FILE_ERROR);
g_assert (error->code == G_FILE_ERROR_NOENT);
+}
+
+int
+main(int argc, char **argv)
+{
+ g_test_init (&argc, &argv, NULL);
+
+ g_test_add_func ("/girepository/throws/invoke-gerror", test_invoke_gerror);
- exit(0);
+ return g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]