summaryrefslogtreecommitdiff
path: root/tests/repository
diff options
context:
space:
mode:
Diffstat (limited to 'tests/repository')
-rw-r--r--tests/repository/Makefile.am11
-rw-r--r--tests/repository/gitestrepo.c30
2 files changed, 41 insertions, 0 deletions
diff --git a/tests/repository/Makefile.am b/tests/repository/Makefile.am
new file mode 100644
index 00000000..916941fd
--- /dev/null
+++ b/tests/repository/Makefile.am
@@ -0,0 +1,11 @@
+AM_CFLAGS = $(GOBJECT_CFLAGS)
+AM_LDFLAGS = -module -avoid-version
+LIBS = $(GOBJECT_LIBS)
+
+noinst_PROGRAMS = gitestrepo
+
+gitestrepo_SOURCES = $(srcdir)/gitestrepo.c
+gitestrepo_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
+gitestrepo_LDADD = $(GIREPO_LIBS) $(top_builddir)/girepository/libgirepository.la
+
+TESTS = # gitestrepo \ No newline at end of file
diff --git a/tests/repository/gitestrepo.c b/tests/repository/gitestrepo.c
new file mode 100644
index 00000000..62dfef8e
--- /dev/null
+++ b/tests/repository/gitestrepo.c
@@ -0,0 +1,30 @@
+
+#include "girepository.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+
+int
+main(int argc, char **argv)
+{
+ GIRepository *repo;
+ gboolean ret;
+ GError *error = NULL;
+ GIBaseInfo *info;
+
+ g_type_init ();
+
+ repo = g_irepository_get_default ();
+
+ ret = g_irepository_require (repo, "Gio", NULL, 0, &error);
+ g_assert (ret);
+ g_assert (error == NULL);
+
+ info = g_irepository_find_by_name (repo, "Gio", "Cancellable");
+ g_assert (info != NULL);
+
+ info = g_irepository_find_by_gtype (repo, g_type_from_name ("GCancellable"));
+ g_assert (info != NULL);
+
+ exit(0);
+}