summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTommi Komulainen <tommi.komulainen@iki.fi>2008-10-22 16:46:13 +0000
committerTommi Komulainen <tko@src.gnome.org>2008-10-22 16:46:13 +0000
commit3cd5f02575bc0cb193069c1e86d5577e570fc8d2 (patch)
tree03389dcd90478fe21872cdb35b452641fd78a2eb /tests
parent6a76f36420634276f4c3ee18208ac9a0a0f26e0c (diff)
downloadgobject-introspection-3cd5f02575bc0cb193069c1e86d5577e570fc8d2.tar.gz
Bug 557377 – Add test to ensure annotations survive the roundtrip via typelib
2008-10-22 Tommi Komulainen <tommi.komulainen@iki.fi> * tests/scanner/Makefile.am: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/drawable-1.0-expected.tgir: * tests/scanner/drawable-injected-1.0-expected.tgir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/GtkFrob-1.0-expected.tgir: * tests/scanner/utility-1.0-expected.tgir: Add test to ensure annotations survive the roundtrip via typelib The expectations are as currently produced by g-ir-generate, comparison with the .gir files shows there are differences. svn path=/trunk/; revision=784
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/GtkFrob-1.0-expected.tgir15
-rw-r--r--tests/scanner/Makefile.am13
-rw-r--r--tests/scanner/annotation-1.0-expected.tgir201
-rw-r--r--tests/scanner/drawable-1.0-expected.tgir72
-rw-r--r--tests/scanner/drawable-injected-1.0-expected.tgir77
-rw-r--r--tests/scanner/foo-1.0-expected.tgir418
-rw-r--r--tests/scanner/utility-1.0-expected.tgir52
7 files changed, 846 insertions, 2 deletions
diff --git a/tests/scanner/GtkFrob-1.0-expected.tgir b/tests/scanner/GtkFrob-1.0-expected.tgir
new file mode 100644
index 00000000..81156ac7
--- /dev/null
+++ b/tests/scanner/GtkFrob-1.0-expected.tgir
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<repository version="1.0"
+ xmlns="http://www.gtk.org/introspection/core/1.0"
+ xmlns:c="http://www.gtk.org/introspection/c/1.0"
+ xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+ <include name="GObject" version="2.0"/>
+ <include name="GLib" version="2.0"/>
+ <namespace name="GtkFrob" version="1.0" shared-library="gtkfrob">
+ <function name="language_manager_get_default" c:identifier="gtk_frob_language_manager_get_default">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ </function>
+ </namespace>
+</repository>
diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am
index 820b0893..cae256f8 100644
--- a/tests/scanner/Makefile.am
+++ b/tests/scanner/Makefile.am
@@ -23,6 +23,7 @@ if OS_WIN32
AM_LDFLAGS += -no-undefined
endif
+# .gir --[scanner]-> .typelib --[generate]-> .tgir
GIRS =
SCANNER = $(top_srcdir)/tools/g-ir-scanner
SCANNER_LIBS = \
@@ -31,9 +32,11 @@ SCANNER_LIBS = \
TYPELIBS = $(GIRS:.gir=.typelib)
CHECKGIRS = $(GIRS:.gir=.gir.check)
EXPECTEDGIRS = $(GIRS:.gir=-expected.gir)
+CHECKTGIRS = $(GIRS:.gir=.tgir.check)
+EXPECTEDTGIRS = $(GIRS:.gir=-expected.tgir)
CLEANFILES = $(TYPELIBS) $(GIRS)
BUILT_SOURCES = $(TYPELIBS) $(GIRS)
-EXTRA_DIST = $(EXPECTEDGIRS)
+EXTRA_DIST = $(EXPECTEDGIRS) $(EXPECTEDTGIRS)
annotation-1.0.gir: libannotation.la annotation.c annotation.h utility-1.0.gir $(SCANNER) $(SCANNER_LIBS) Makefile
PYTHONPATH=$(top_builddir):$$PYTHONPATH $(CHECK_DEBUG) $(SCANNER) -v \
@@ -125,8 +128,14 @@ post-check:
%.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) Makefile
$(top_builddir)/tools/g-ir-compiler --includedir=. --includedir=$(top_builddir)/gir $< -o $@
+%.tgir: %.typelib $(top_builddir)/tools/g-ir-generate$(EXEEXT) Makefile
+ $(DEBUG) $(top_builddir)/tools/g-ir-generate --includedir=. --includedir=$(top_builddir)/gir $< -o $@
+
+%.tgir.check: %.tgir
+ @diff -u -U 10 $(srcdir)/$*-expected.tgir $*.tgir && echo "* $*.tgir"
+
check-local: pre-check
-check-local: $(CHECKGIRS) $(TYPELIBS)
+check-local: $(CHECKGIRS) $(CHECKTGIRS) $(TYPELIBS)
@for x in $(TYPELIBS); do \
echo 1>&2 "$(DEBUG) $(top_builddir)/tools/g-ir-generate --includedir=. --includedir=$(top_builddir)/gir $${x} > $${x}.tmp && mv $${x}.tmp $${x}.xml;"; \
$(DEBUG) $(top_builddir)/tools/g-ir-generate --includedir=. --includedir=$(top_builddir)/gir $${x} > $${x}.tmp && mv $${x}.tmp $${x}.xml; \
diff --git a/tests/scanner/annotation-1.0-expected.tgir b/tests/scanner/annotation-1.0-expected.tgir
new file mode 100644
index 00000000..6910e262
--- /dev/null
+++ b/tests/scanner/annotation-1.0-expected.tgir
@@ -0,0 +1,201 @@
+<?xml version="1.0"?>
+<repository version="1.0"
+ xmlns="http://www.gtk.org/introspection/core/1.0"
+ xmlns:c="http://www.gtk.org/introspection/c/1.0"
+ xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+ <include name="utility" version="1.0"/>
+ <include name="GObject" version="2.0"/>
+ <include name="GLib" version="2.0"/>
+ <namespace name="annotation" version="1.0" shared-library="annotation">
+ <callback name="Callback">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ <parameters>
+ <parameter name="in">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </callback>
+ <callback name="ListCallback">
+ <return-value transfer-ownership="container">
+ <type name="GLib.List">
+ <type name="utf8"/>
+ </type>
+ </return-value>
+ <parameters>
+ <parameter name="in">
+ <type name="GLib.List">
+ <type name="utf8"/>
+ </type>
+ </parameter>
+ </parameters>
+ </callback>
+ <class name="Object" parent="GObject.Object" glib:type-name="AnnotationObject" glib:get-type="annotation_object_get_type">
+ <field name="parent_instance" offset="0">
+ <type name="GObject.Object"/>
+ </field>
+ <method name="method" c:identifier="annotation_object_method">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ </method>
+ <method name="out" c:identifier="annotation_object_out">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ <parameters>
+ <parameter name="outarg" transfer-ownership="full" direction="out">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="create_object" c:identifier="annotation_object_create_object">
+ <return-value>
+ <type name="GObject.Object"/>
+ </return-value>
+ </method>
+ <method name="allow_none" c:identifier="annotation_object_allow_none">
+ <return-value>
+ <type name="GObject.Object"/>
+ </return-value>
+ <parameters>
+ <parameter name="somearg" transfer-ownership="full" allow-none="1">
+ <type name="utf8"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="notrans" c:identifier="annotation_object_notrans">
+ <return-value>
+ <type name="GObject.Object"/>
+ </return-value>
+ </method>
+ <method name="inout" c:identifier="annotation_object_inout">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ <parameters>
+ <parameter name="inoutarg" transfer-ownership="full" direction="inout">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="inout2" c:identifier="annotation_object_inout2">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ <parameters>
+ <parameter name="inoutarg" transfer-ownership="full" direction="inout">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="inout3" c:identifier="annotation_object_inout3">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ <parameters>
+ <parameter name="inoutarg" transfer-ownership="full" direction="inout" allow-none="1">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="in" c:identifier="annotation_object_in">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ <parameters>
+ <parameter name="inarg">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="calleeowns" c:identifier="annotation_object_calleeowns">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ <parameters>
+ <parameter name="toown" transfer-ownership="full" direction="out">
+ <type name="GObject.Object"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="calleesowns" c:identifier="annotation_object_calleesowns">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ <parameters>
+ <parameter name="toown1" transfer-ownership="full" direction="out">
+ <type name="GObject.Object"/>
+ </parameter>
+ <parameter name="toown2" direction="out">
+ <type name="GObject.Object"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="get_strings" c:identifier="annotation_object_get_strings">
+ <return-value transfer-ownership="full">
+ <type name="GLib.List">
+ <type name="utf8"/>
+ </type>
+ </return-value>
+ </method>
+ <method name="get_objects" c:identifier="annotation_object_get_objects">
+ <return-value transfer-ownership="container">
+ <type name="GLib.SList">
+ <type name="GObject.Object"/>
+ </type>
+ </return-value>
+ </method>
+ <method name="use_buffer" c:identifier="annotation_object_use_buffer">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="bytes">
+ <array zero-terminated="1">
+ <type name="uint8"/>
+ </array>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="compute_sum" c:identifier="annotation_object_compute_sum">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="nums">
+ <array zero-terminated="1">
+ <type name="int"/>
+ </array>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="compute_sum_n" c:identifier="annotation_object_compute_sum_n">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="nums">
+ <array length="2" zero-terminated="1">
+ <type name="int"/>
+ </array>
+ </parameter>
+ <parameter name="n_nums">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="do_not_use" c:identifier="annotation_object_do_not_use" deprecated="1">
+ <return-value>
+ <type name="GObject.Object"/>
+ </return-value>
+ </method>
+ </class>
+ <record name="ObjectClass">
+ <field name="parent_class" offset="0">
+ <type name="GObject.ObjectClass"/>
+ </field>
+ </record>
+ </namespace>
+</repository>
diff --git a/tests/scanner/drawable-1.0-expected.tgir b/tests/scanner/drawable-1.0-expected.tgir
new file mode 100644
index 00000000..6fa1843a
--- /dev/null
+++ b/tests/scanner/drawable-1.0-expected.tgir
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<repository version="1.0"
+ xmlns="http://www.gtk.org/introspection/core/1.0"
+ xmlns:c="http://www.gtk.org/introspection/c/1.0"
+ xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+ <include name="utility" version="1.0"/>
+ <include name="GObject" version="2.0"/>
+ <include name="GLib" version="2.0"/>
+ <namespace name="drawable" version="1.0" shared-library="drawable">
+ <class name="TestDrawable" parent="GObject.Object" glib:type-name="TestDrawable" glib:get-type="test_drawable_get_type">
+ <field name="parent_instance" offset="0">
+ <type name="GObject.Object"/>
+ </field>
+ <method name="do_foo" c:identifier="test_drawable_do_foo">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="x">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="get_origin" c:identifier="test_drawable_get_origin">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="x" transfer-ownership="full" direction="out">
+ <type name="int"/>
+ </parameter>
+ <parameter name="y" transfer-ownership="full" direction="out">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="get_size" c:identifier="test_drawable_get_size">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="width" transfer-ownership="full" direction="out">
+ <type name="uint"/>
+ </parameter>
+ <parameter name="height" transfer-ownership="full" direction="out">
+ <type name="uint"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="do_foo_maybe_throw" c:identifier="test_drawable_do_foo_maybe_throw" throws="1">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="x">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ </class>
+ <record name="TestDrawableClass">
+ <field name="parent_class" offset="0">
+ <type name="GObject.ObjectClass"/>
+ </field>
+ </record>
+ <record name="TestPixmapObjectClass">
+ <field name="parent_class" offset="0">
+ <type name="TestDrawableClass"/>
+ </field>
+ </record>
+ </namespace>
+</repository>
diff --git a/tests/scanner/drawable-injected-1.0-expected.tgir b/tests/scanner/drawable-injected-1.0-expected.tgir
new file mode 100644
index 00000000..be88c572
--- /dev/null
+++ b/tests/scanner/drawable-injected-1.0-expected.tgir
@@ -0,0 +1,77 @@
+<?xml version="1.0"?>
+<repository version="1.0"
+ xmlns="http://www.gtk.org/introspection/core/1.0"
+ xmlns:c="http://www.gtk.org/introspection/c/1.0"
+ xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+ <include name="utility" version="1.0"/>
+ <include name="GObject" version="2.0"/>
+ <include name="GLib" version="2.0"/>
+ <namespace name="drawable" version="1.0" shared-library="drawable">
+ <class name="TestDrawable" parent="GObject.Object" glib:type-name="TestDrawable" glib:get-type="test_drawable_get_type">
+ <field name="parent_instance" offset="0">
+ <type name="GObject.Object"/>
+ </field>
+ <method name="do_foo" c:identifier="test_drawable_do_foo">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="x">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="get_origin" c:identifier="test_drawable_get_origin">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="x" transfer-ownership="full" direction="out">
+ <type name="int"/>
+ </parameter>
+ <parameter name="y" transfer-ownership="full" direction="out">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="get_size" c:identifier="test_drawable_get_size">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="width" transfer-ownership="full" direction="out">
+ <type name="uint"/>
+ </parameter>
+ <parameter name="height" transfer-ownership="full" direction="out">
+ <type name="uint"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="do_foo_maybe_throw" c:identifier="test_drawable_do_foo_maybe_throw" throws="1">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="x">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="get_width" c:identifier="girepo_test_drawable_get_width">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ </method>
+ </class>
+ <record name="TestDrawableClass">
+ <field name="parent_class" offset="0">
+ <type name="GObject.ObjectClass"/>
+ </field>
+ </record>
+ <record name="TestPixmapObjectClass">
+ <field name="parent_class" offset="0">
+ <type name="TestDrawableClass"/>
+ </field>
+ </record>
+ </namespace>
+</repository>
diff --git a/tests/scanner/foo-1.0-expected.tgir b/tests/scanner/foo-1.0-expected.tgir
new file mode 100644
index 00000000..e1bc8f52
--- /dev/null
+++ b/tests/scanner/foo-1.0-expected.tgir
@@ -0,0 +1,418 @@
+<?xml version="1.0"?>
+<repository version="1.0"
+ xmlns="http://www.gtk.org/introspection/core/1.0"
+ xmlns:c="http://www.gtk.org/introspection/c/1.0"
+ xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+ <include name="utility" version="1.0"/>
+ <include name="GObject" version="2.0"/>
+ <include name="GLib" version="2.0"/>
+ <namespace name="foo" version="1.0" shared-library="foo">
+ <interface name="Interface" glib:type-name="FooInterface" glib:get-type="foo_interface_get_type"/>
+ <record name="InterfaceIface">
+ <field name="parent_iface" offset="0">
+ <type name="GObject.TypeInterface"/>
+ </field>
+ </record>
+ <class name="Object" parent="GObject.Object" glib:type-name="FooObject" glib:get-type="foo_object_get_type">
+ <implements name="Interface"/>
+ <field name="parent_instance" offset="0">
+ <type name="GObject.Object"/>
+ </field>
+ <constructor name="new" c:identifier="foo_object_new">
+ <return-value>
+ <type name="GObject.Object"/>
+ </return-value>
+ </constructor>
+ <method name="external_type" c:identifier="foo_object_external_type">
+ <return-value>
+ <type name="GObject.Object"/>
+ </return-value>
+ </method>
+ <method name="various" c:identifier="foo_object_various">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="data">
+ <type name="any"/>
+ </parameter>
+ <parameter name="some_type">
+ <type name="GType"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="with_tdef" c:identifier="foo_object_with_tdef">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="blah">
+ <type name="GLib.SList">
+ <type name="any"/>
+ </type>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="new_cookie" c:identifier="foo_object_new_cookie">
+ <return-value transfer-ownership="full">
+ <type name="any"/>
+ </return-value>
+ <parameters>
+ <parameter name="target">
+ <type name="utf8"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="is_it_time_yet" c:identifier="foo_object_is_it_time_yet">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="time">
+ <type name="time_t"/>
+ </parameter>
+ </parameters>
+ </method>
+ <method name="get_name" c:identifier="foo_object_get_name">
+ <return-value>
+ <type name="utf8"/>
+ </return-value>
+ </method>
+ <method name="dup_name" c:identifier="foo_object_dup_name">
+ <return-value transfer-ownership="full">
+ <type name="utf8"/>
+ </return-value>
+ </method>
+ <method name="handle_glyph" c:identifier="foo_object_handle_glyph">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="glyph">
+ <type name="uint32"/>
+ </parameter>
+ </parameters>
+ </method>
+ <property name="string" writable="1" construct="1">
+ <type name="utf8"/>
+ </property>
+ <glib:signal name="signal" when="LAST">
+ <return-value transfer-ownership="full">
+ <type name="utf8"/>
+ </return-value>
+ <parameters>
+ <parameter name="object">
+ <type name="GObject.Object"/>
+ </parameter>
+ <parameter name="p0">
+ <type name="any"/>
+ </parameter>
+ </parameters>
+ </glib:signal>
+ </class>
+ <record name="ObjectClass">
+ <field name="parent_class" offset="0">
+ <type name="GObject.ObjectClass"/>
+ </field>
+ </record>
+ <class name="Subobject" parent="Object" glib:type-name="FooSubobject" glib:get-type="foo_subobject_get_type">
+ <implements name="Interface"/>
+ <field name="parent_instance" offset="0">
+ <type name="GObject.Object"/>
+ </field>
+ <constructor name="new" c:identifier="foo_subobject_new">
+ <return-value transfer-ownership="full">
+ <type name="Subobject"/>
+ </return-value>
+ </constructor>
+ </class>
+ <record name="SubobjectClass">
+ <field name="parent_class" offset="0">
+ <type name="GObject.ObjectClass"/>
+ </field>
+ </record>
+ <function name="init" c:identifier="foo_init">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ </function>
+ <enumeration name="EnumType" glib:type-name="FooEnumType" glib:get-type="foo_enum_type_get_type">
+ <member name="alpha" value="0"/>
+ <member name="beta" value="1"/>
+ <member name="delta" value="2"/>
+ </enumeration>
+ <function name="enum_type_method" c:identifier="foo_enum_type_method">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ <parameters>
+ <parameter name="foo_enum">
+ <type name="EnumType"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="enum_type_returnv" c:identifier="foo_enum_type_returnv">
+ <return-value>
+ <type name="EnumType"/>
+ </return-value>
+ <parameters>
+ <parameter name="x">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </function>
+ <bitfield name="FlagsType" glib:type-name="FooFlagsType" glib:get-type="foo_flags_type_get_type">
+ <member name="first" value="1"/>
+ <member name="second" value="2"/>
+ <member name="third" value="4"/>
+ </bitfield>
+ <enumeration name="EnumNoType">
+ <member name="un" value="1"/>
+ <member name="deux" value="2"/>
+ <member name="trois" value="3"/>
+ <member name="neuf" value="9"/>
+ </enumeration>
+ <enumeration name="EnumFullname">
+ <member name="one" value="1"/>
+ <member name="two" value="2"/>
+ <member name="three" value="3"/>
+ </enumeration>
+ <record name="Boxed" glib:type-name="FooBoxed" glib:get-type="foo_boxed_get_type">
+ <constructor name="new" c:identifier="foo_boxed_new">
+ <return-value transfer-ownership="full">
+ <type name="Boxed"/>
+ </return-value>
+ </constructor>
+ <method name="method" c:identifier="foo_boxed_method">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ </method>
+ </record>
+ <record name="DBusData" glib:type-name="FooDBusData" glib:get-type="foo_dbus_data_get_type">
+ <method name="method" c:identifier="foo_dbus_data_method">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ </method>
+ </record>
+ <callback name="Callback">
+ <return-value>
+ <type name="boolean"/>
+ </return-value>
+ <parameters>
+ <parameter name="foo">
+ <type name="GObject.Object"/>
+ </parameter>
+ <parameter name="b">
+ <type name="boolean"/>
+ </parameter>
+ <parameter name="data">
+ <type name="any"/>
+ </parameter>
+ </parameters>
+ </callback>
+ <record name="Struct">
+ <field name="priv" writable="1" offset="0">
+ <type name="StructPrivate"/>
+ </field>
+ <field name="member" writable="1" offset="0">
+ <type name="int"/>
+ </field>
+ </record>
+ <record name="StructPrivate"/>
+ <record name="Rectangle">
+ <field name="x" writable="1" offset="0">
+ <type name="int"/>
+ </field>
+ <field name="y" writable="1" offset="0">
+ <type name="int"/>
+ </field>
+ <field name="width" writable="1" offset="0">
+ <type name="int"/>
+ </field>
+ <field name="height" writable="1" offset="0">
+ <type name="int"/>
+ </field>
+ </record>
+ <function name="method_external_references" c:identifier="foo_method_external_references">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="object">
+ <type name="GObject.Object"/>
+ </parameter>
+ <parameter name="e">
+ <type name="EnumType"/>
+ </parameter>
+ <parameter name="f">
+ <type name="utility.FlagType"/>
+ </parameter>
+ <parameter name="s">
+ <type name="utility.Struct"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="rectangle_add" c:identifier="foo_rectangle_add">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="r1">
+ <type name="Rectangle"/>
+ </parameter>
+ <parameter name="r2">
+ <type name="Rectangle"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="rectangle_new" c:identifier="foo_rectangle_new">
+ <return-value transfer-ownership="full">
+ <type name="Rectangle"/>
+ </return-value>
+ <parameters>
+ <parameter name="x">
+ <type name="int"/>
+ </parameter>
+ <parameter name="y">
+ <type name="int"/>
+ </parameter>
+ <parameter name="width">
+ <type name="int"/>
+ </parameter>
+ <parameter name="height">
+ <type name="int"/>
+ </parameter>
+ </parameters>
+ </function>
+ <record name="EventAny">
+ <field name="send_event" writable="1" offset="0">
+ <type name="int8"/>
+ </field>
+ </record>
+ <record name="EventExpose">
+ <field name="send_event" writable="1" offset="0">
+ <type name="int8"/>
+ </field>
+ <field name="count" writable="1" offset="0">
+ <type name="int"/>
+ </field>
+ </record>
+ <union name="Event">
+ <field name="type" writable="1" offset="0">
+ <type name="int"/>
+ </field>
+ <field name="any" writable="1" offset="0">
+ <type name="EventAny"/>
+ </field>
+ <field name="expose" writable="1" offset="0">
+ <type name="EventExpose"/>
+ </field>
+ </union>
+ <record name="BRect" glib:type-name="FooBRect" glib:get-type="foo_brect_get_type">
+ <field name="x" writable="1" offset="0">
+ <type name="double"/>
+ </field>
+ <field name="y" writable="1" offset="0">
+ <type name="double"/>
+ </field>
+ <constructor name="new" c:identifier="foo_brect_new">
+ <return-value transfer-ownership="full">
+ <type name="BRect"/>
+ </return-value>
+ <parameters>
+ <parameter name="x">
+ <type name="double"/>
+ </parameter>
+ <parameter name="y">
+ <type name="double"/>
+ </parameter>
+ </parameters>
+ </constructor>
+ <method name="add" c:identifier="foo_brect_add">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="b2">
+ <type name="BRect"/>
+ </parameter>
+ </parameters>
+ </method>
+ </record>
+ <union name="BUnion" type-name="FooBUnion" get-type="foo_bunion_get_type">
+ <field name="type" writable="1" offset="0">
+ <type name="int"/>
+ </field>
+ <field name="v" writable="1" offset="0">
+ <type name="double"/>
+ </field>
+ <field name="rect" writable="1" offset="0">
+ <type name="BRect"/>
+ </field>
+ <constructor name="new" c:identifier="foo_bunion_new">
+ <return-value transfer-ownership="full">
+ <type name="BUnion"/>
+ </return-value>
+ </constructor>
+ <method name="get_contained_type" c:identifier="foo_bunion_get_contained_type">
+ <return-value>
+ <type name="int"/>
+ </return-value>
+ </method>
+ </union>
+ <union name="Union">
+ <field name="foo" writable="1" offset="0">
+ <type name="int"/>
+ </field>
+ </union>
+ <function name="test_unsigned_qualifier" c:identifier="foo_test_unsigned_qualifier">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="unsigned_param">
+ <type name="uint"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="test_unsigned_type" c:identifier="foo_test_unsigned_type">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="unsigned_param">
+ <type name="uint"/>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="test_string_array" c:identifier="foo_test_string_array">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="array">
+ <array zero-terminated="1">
+ <type name="utf8"/>
+ </array>
+ </parameter>
+ </parameters>
+ </function>
+ <function name="test_string_array_with_g" c:identifier="foo_test_string_array_with_g">
+ <return-value>
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <parameter name="array">
+ <array zero-terminated="1">
+ <type name="utf8"/>
+ </array>
+ </parameter>
+ </parameters>
+ </function>
+ <constant name="SUCCESS_INT" value="4408">
+ <type name="int"/>
+ </constant>
+ </namespace>
+</repository>
diff --git a/tests/scanner/utility-1.0-expected.tgir b/tests/scanner/utility-1.0-expected.tgir
new file mode 100644
index 00000000..bb8cb441
--- /dev/null
+++ b/tests/scanner/utility-1.0-expected.tgir
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<repository version="1.0"
+ xmlns="http://www.gtk.org/introspection/core/1.0"
+ xmlns:c="http://www.gtk.org/introspection/c/1.0"
+ xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+ <include name="GObject" version="2.0"/>
+ <include name="GLib" version="2.0"/>
+ <namespace name="utility" version="1.0" shared-library="utility">
+ <class name="Object" parent="GObject.Object" glib:type-name="UtilityObject" glib:get-type="utility_object_get_type">
+ <field name="parent_instance" offset="0">
+ <type name="GObject.Object"/>
+ </field>
+ </class>
+ <record name="ObjectClass">
+ <field name="parent_class" offset="0">
+ <type name="GObject.ObjectClass"/>
+ </field>
+ </record>
+ <enumeration name="EnumType">
+ <member name="a" value="0"/>
+ <member name="b" value="1"/>
+ <member name="c" value="2"/>
+ </enumeration>
+ <enumeration name="FlagType">
+ <member name="a" value="0"/>
+ <member name="b" value="1"/>
+ <member name="c" value="2"/>
+ </enumeration>
+ <record name="Struct">
+ <field name="field" writable="1" offset="0">
+ <type name="int"/>
+ </field>
+ <field name="bitfield1" writable="1" offset="0">
+ <type name="uint"/>
+ </field>
+ <field name="bitfield2" writable="1" offset="0">
+ <type name="uint"/>
+ </field>
+ </record>
+ <union name="Union">
+ <field name="pointer" writable="1" offset="0">
+ <type name="utf8"/>
+ </field>
+ <field name="integer" writable="1" offset="0">
+ <type name="long"/>
+ </field>
+ <field name="real" writable="1" offset="0">
+ <type name="double"/>
+ </field>
+ </union>
+ </namespace>
+</repository>