summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2011-05-19 17:46:36 -0400
committerJohan Dahlin <jdahlin@litl.com>2011-08-13 09:42:38 -0300
commitd3a7314ba46b32e0dc215ad7d54fbf888ac519d0 (patch)
tree98e20ed4d73aa54559f65cb469d0a5c861ee0aad /tests
parentd92fb1e2433e6c64e47da6277e30e8fad455e719 (diff)
downloadgobject-introspection-d3a7314ba46b32e0dc215ad7d54fbf888ac519d0.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')
-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);
}