summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@src.gnome.org>2008-10-12 16:36:29 +0000
committerColin Walters <walters@src.gnome.org>2008-10-12 16:36:29 +0000
commit589845ddfe406a064e87ab75d6aa1f820a93943d (patch)
treef06b6e06952088b7cdc86f4d489acb95293dd5bc
parent34098ad8b5dcb5f76b092c594798e804c60b2fb6 (diff)
downloadgobject-introspection-589845ddfe406a064e87ab75d6aa1f820a93943d.tar.gz
Add tests/repository which has some repository regression tests
svn path=/trunk/; revision=683
-rw-r--r--configure.ac1
-rw-r--r--girepository/girepository.c2
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/repository/Makefile.am11
-rw-r--r--tests/repository/gitestrepo.c30
5 files changed, 44 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 78e7b9ab..1f0ad358 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,6 +150,7 @@ tools/Makefile
tests/Makefile
tests/invoke/Makefile
tests/scanner/Makefile
+tests/repository/Makefile
tests/types/Makefile
gobject-introspection-1.0.pc])
AC_OUTPUT
diff --git a/girepository/girepository.c b/girepository/girepository.c
index 5bbad532..d56482ec 100644
--- a/girepository/girepository.c
+++ b/girepository/girepository.c
@@ -490,7 +490,7 @@ find_interface (gpointer key,
for (i = 1; i <= n_entries; i++)
{
entry = g_typelib_get_dir_entry (typelib, i);
- if (entry->blob_type < 4)
+ if (entry->blob_type < BLOB_TYPE_BOXED)
continue;
offset = *(guint32*)&typelib->data[entry->offset + 8];
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 64236310..6f7fdb48 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = . invoke scanner types
+SUBDIRS = . invoke scanner repository types
EXTRA_DIST = \
array.gir \
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);
+}