gobject-introspection r699 - in trunk: . tests/repository



Author: tko
Date: Sun Oct 12 21:57:32 2008
New Revision: 699
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=699&view=rev

Log:
2008-10-12  Tommi Komulainen  <tommi komulainen iki fi>

	* tests/repository/Makefile.am: run 'gitestrepo' in 'make check'
	* tests/repository/gitestrepo.c (main): instantiate
	'GCancellable' to ensure the GType is registered before using
	g_type_from_name()

Modified:
   trunk/ChangeLog
   trunk/tests/repository/Makefile.am
   trunk/tests/repository/gitestrepo.c

Modified: trunk/tests/repository/Makefile.am
==============================================================================
--- trunk/tests/repository/Makefile.am	(original)
+++ trunk/tests/repository/Makefile.am	Sun Oct 12 21:57:32 2008
@@ -8,4 +8,4 @@
 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
+TESTS = gitestrepo

Modified: trunk/tests/repository/gitestrepo.c
==============================================================================
--- trunk/tests/repository/gitestrepo.c	(original)
+++ trunk/tests/repository/gitestrepo.c	Sun Oct 12 21:57:32 2008
@@ -11,6 +11,7 @@
   gboolean ret;
   GError *error = NULL;
   GIBaseInfo *info;
+  GType gtype;
 
   g_type_init ();
 
@@ -22,6 +23,10 @@
 
   info = g_irepository_find_by_name (repo, "Gio", "Cancellable");
   g_assert (info != NULL);
+  g_assert (g_base_info_get_type (info) == GI_INFO_TYPE_OBJECT);
+
+  gtype = g_registered_type_info_get_g_type ((GIRegisteredTypeInfo *)info);
+  g_assert (g_type_is_a (gtype, G_TYPE_OBJECT));
 
   info = g_irepository_find_by_gtype (repo, g_type_from_name ("GCancellable"));
   g_assert (info != NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]