summaryrefslogtreecommitdiff
path: root/tests/repository
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2011-05-19 17:46:36 -0400
committerDan Winship <danw@gnome.org>2011-08-12 11:11:45 -0400
commitc4c1de663f0c42875d5dd029d910d6c37e90ec8a (patch)
tree39237617ff1b54b1e6ebc0698f9fa4ceb311df48 /tests/repository
parent5fd2fa5bf5a07a66d2150740d534a398598e8dd1 (diff)
downloadgobject-introspection-c4c1de663f0c42875d5dd029d910d6c37e90ec8a.tar.gz
Add g_irepository_find_by_error_domain()
Add a method to look up a GIEnumInfo given its associated error quark. Based on a patch from Colin Walters. https://bugzilla.gnome.org/show_bug.cgi?id=602516
Diffstat (limited to 'tests/repository')
-rw-r--r--tests/repository/gitestrepo.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/repository/gitestrepo.c b/tests/repository/gitestrepo.c
index 316ee3d2..e7c3ae45 100644
--- a/tests/repository/gitestrepo.c
+++ b/tests/repository/gitestrepo.c
@@ -5,6 +5,8 @@
#include <string.h>
#include <unistd.h>
+#include <gio/gio.h>
+
void test_constructor_return_type(GIBaseInfo* object_info);
void
@@ -42,6 +44,7 @@ main(int argc, char **argv)
GError *error = NULL;
GIBaseInfo *info;
GIBaseInfo *siginfo;
+ GIEnumInfo *errorinfo;
GType gtype;
g_type_init ();
@@ -123,5 +126,11 @@ main(int argc, char **argv)
g_assert (strcmp (g_base_info_get_name ((GIBaseInfo*)invoker), "get_display") == 0);
}
+ /* Error quark tests */
+ errorinfo = g_irepository_find_by_error_domain (repo, G_RESOLVER_ERROR);
+ g_assert (errorinfo != NULL);
+ g_assert (g_base_info_get_type ((GIBaseInfo *)errorinfo) == GI_INFO_TYPE_ENUM);
+ g_assert (strcmp (g_base_info_get_name ((GIBaseInfo*)errorinfo), "ResolverError") == 0);
+
exit(0);
}