summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-02-20 17:34:20 -0500
committerColin Walters <walters@verbum.org>2009-02-25 17:31:49 -0500
commit251de52b083d3e0e42f25cb164a46865c2c2b9a9 (patch)
tree99db442fd1bb299466f5d277561becfca4b220ee /tests
parent0b9dda0e725446882dca84b6a64688c8f0e5a4e3 (diff)
downloadgobject-introspection-251de52b083d3e0e42f25cb164a46865c2c2b9a9.tar.gz
Bug 572434 - Associate interfaces with their C structures
Similar to GObject class structs, we pair up GInterfaces with their C structures. Also, move some GLib-specific things into glibast.py, and make the naming more generic.
Diffstat (limited to 'tests')
-rw-r--r--tests/repository/gitestrepo.c3
-rw-r--r--tests/scanner/BarApp-1.0-expected.gir4
-rw-r--r--tests/scanner/BarApp-1.0-expected.tgir4
-rw-r--r--tests/scanner/annotation-1.0-expected.gir4
-rw-r--r--tests/scanner/annotation-1.0-expected.tgir4
-rw-r--r--tests/scanner/drawable-1.0-expected.gir4
-rw-r--r--tests/scanner/drawable-1.0-expected.tgir4
-rw-r--r--tests/scanner/foo-1.0-expected.gir26
-rw-r--r--tests/scanner/foo-1.0-expected.tgir20
-rw-r--r--tests/scanner/utility-1.0-expected.gir4
-rw-r--r--tests/scanner/utility-1.0-expected.tgir4
11 files changed, 45 insertions, 36 deletions
diff --git a/tests/repository/gitestrepo.c b/tests/repository/gitestrepo.c
index 007ce02e..0e674670 100644
--- a/tests/repository/gitestrepo.c
+++ b/tests/repository/gitestrepo.c
@@ -70,5 +70,8 @@ main(int argc, char **argv)
test_constructor_return_type (info);
+ info = g_irepository_find_by_name (repo, "Gio", "ThisDoesNotExist");
+ g_assert (info == NULL);
+
exit(0);
}
diff --git a/tests/scanner/BarApp-1.0-expected.gir b/tests/scanner/BarApp-1.0-expected.gir
index 91b044dd..da8c825e 100644
--- a/tests/scanner/BarApp-1.0-expected.gir
+++ b/tests/scanner/BarApp-1.0-expected.gir
@@ -15,14 +15,14 @@ and/or use gtk-doc annotations. -->
parent="GObject.Object"
glib:type-name="BarBaz"
glib:get-type="bar_baz_get_type"
- glib:class-struct="BazClass">
+ glib:type-struct="BazClass">
<field name="parent_instance">
<type name="GObject.Object" c:type="GObject"/>
</field>
</class>
<record name="BazClass"
c:type="BarBazClass"
- glib:is-class-struct-for="Baz">
+ glib:is-gtype-struct-for="Baz">
<field name="parent_class">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
diff --git a/tests/scanner/BarApp-1.0-expected.tgir b/tests/scanner/BarApp-1.0-expected.tgir
index 4a99be5d..20173cb9 100644
--- a/tests/scanner/BarApp-1.0-expected.tgir
+++ b/tests/scanner/BarApp-1.0-expected.tgir
@@ -6,12 +6,12 @@
<include name="GObject" version="2.0"/>
<include name="GLib" version="2.0"/>
<namespace name="BarApp" version="1.0" shared-library="">
- <class name="Baz" parent="GObject.Object" glib:class-struct="BazClass" glib:type-name="BarBaz" glib:get-type="bar_baz_get_type">
+ <class name="Baz" parent="GObject.Object" glib:type-struct="BazClass" glib:type-name="BarBaz" glib:get-type="bar_baz_get_type">
<field name="parent_instance">
<type name="GObject.Object"/>
</field>
</class>
- <record name="BazClass" glib:is-class-struct="1">
+ <record name="BazClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
diff --git a/tests/scanner/annotation-1.0-expected.gir b/tests/scanner/annotation-1.0-expected.gir
index 1833f739..053d459a 100644
--- a/tests/scanner/annotation-1.0-expected.gir
+++ b/tests/scanner/annotation-1.0-expected.gir
@@ -61,7 +61,7 @@ and/or use gtk-doc annotations. -->
parent="GObject.Object"
glib:type-name="AnnotationObject"
glib:get-type="annotation_object_get_type"
- glib:class-struct="ObjectClass">
+ glib:type-struct="ObjectClass">
<method name="method" c:identifier="annotation_object_method">
<return-value transfer-ownership="none">
<type name="int" c:type="gint"/>
@@ -472,7 +472,7 @@ known by GObject as it&apos;s only marked as G_TYPE_POINTER">
</class>
<record name="ObjectClass"
c:type="AnnotationObjectClass"
- glib:is-class-struct-for="Object">
+ glib:is-gtype-struct-for="Object">
<field name="parent_class">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
diff --git a/tests/scanner/annotation-1.0-expected.tgir b/tests/scanner/annotation-1.0-expected.tgir
index a201ec62..643ffb28 100644
--- a/tests/scanner/annotation-1.0-expected.tgir
+++ b/tests/scanner/annotation-1.0-expected.tgir
@@ -47,7 +47,7 @@
</parameter>
</parameters>
</callback>
- <class name="Object" parent="GObject.Object" glib:class-struct="ObjectClass" glib:type-name="AnnotationObject" glib:get-type="annotation_object_get_type">
+ <class name="Object" parent="GObject.Object" glib:type-struct="ObjectClass" glib:type-name="AnnotationObject" glib:get-type="annotation_object_get_type">
<field name="parent_instance">
<type name="GObject.Object"/>
</field>
@@ -349,7 +349,7 @@
</parameters>
</glib:signal>
</class>
- <record name="ObjectClass" glib:is-class-struct="1">
+ <record name="ObjectClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
diff --git a/tests/scanner/drawable-1.0-expected.gir b/tests/scanner/drawable-1.0-expected.gir
index 4affc68e..052e788a 100644
--- a/tests/scanner/drawable-1.0-expected.gir
+++ b/tests/scanner/drawable-1.0-expected.gir
@@ -17,7 +17,7 @@ and/or use gtk-doc annotations. -->
abstract="1"
glib:type-name="TestDrawable"
glib:get-type="test_drawable_get_type"
- glib:class-struct="TestDrawableClass">
+ glib:type-struct="TestDrawableClass">
<method name="do_foo" c:identifier="test_drawable_do_foo">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
@@ -72,7 +72,7 @@ and/or use gtk-doc annotations. -->
</class>
<record name="TestDrawableClass"
c:type="TestDrawableClass"
- glib:is-class-struct-for="TestDrawable">
+ glib:is-gtype-struct-for="TestDrawable">
<field name="parent_class">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
diff --git a/tests/scanner/drawable-1.0-expected.tgir b/tests/scanner/drawable-1.0-expected.tgir
index 612022b7..2c939612 100644
--- a/tests/scanner/drawable-1.0-expected.tgir
+++ b/tests/scanner/drawable-1.0-expected.tgir
@@ -7,7 +7,7 @@
<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:class-struct="TestDrawableClass" abstract="1" glib:type-name="TestDrawable" glib:get-type="test_drawable_get_type">
+ <class name="TestDrawable" parent="GObject.Object" glib:type-struct="TestDrawableClass" abstract="1" glib:type-name="TestDrawable" glib:get-type="test_drawable_get_type">
<field name="parent_instance">
<type name="GObject.Object"/>
</field>
@@ -58,7 +58,7 @@
</parameters>
</method>
</class>
- <record name="TestDrawableClass" glib:is-class-struct="1">
+ <record name="TestDrawableClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
diff --git a/tests/scanner/foo-1.0-expected.gir b/tests/scanner/foo-1.0-expected.gir
index 4bd77452..0f6b1f1f 100644
--- a/tests/scanner/foo-1.0-expected.gir
+++ b/tests/scanner/foo-1.0-expected.gir
@@ -94,7 +94,7 @@ and/or use gtk-doc annotations. -->
parent="GObject.Object"
glib:type-name="FooBuffer"
glib:get-type="foo_buffer_get_type"
- glib:class-struct="BufferClass">
+ glib:type-struct="BufferClass">
<implements name="Interface"/>
<method name="some_method" c:identifier="foo_buffer_some_method">
<return-value transfer-ownership="none">
@@ -104,7 +104,7 @@ and/or use gtk-doc annotations. -->
</class>
<record name="BufferClass"
c:type="FooBufferClass"
- glib:is-class-struct-for="Buffer">
+ glib:is-gtype-struct-for="Buffer">
</record>
<callback name="Callback" c:type="FooCallback">
<return-value transfer-ownership="none">
@@ -230,7 +230,8 @@ and/or use gtk-doc annotations. -->
<interface name="Interface"
c:type="FooInterface"
glib:type-name="FooInterface"
- glib:get-type="foo_interface_get_type">
+ glib:get-type="foo_interface_get_type"
+ glib:type-struct="InterfaceIface">
<callback name="do_foo" c:type="do_foo">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
@@ -242,7 +243,9 @@ and/or use gtk-doc annotations. -->
</parameters>
</callback>
</interface>
- <record name="InterfaceIface" c:type="FooInterfaceIface">
+ <record name="InterfaceIface"
+ c:type="FooInterfaceIface"
+ glib:is-gtype-struct-for="Interface">
<field name="parent_iface">
<type name="GObject.TypeInterface" c:type="GTypeInterface"/>
</field>
@@ -262,7 +265,7 @@ and/or use gtk-doc annotations. -->
parent="GObject.Object"
glib:type-name="FooObject"
glib:get-type="foo_object_get_type"
- glib:class-struct="ObjectClass">
+ glib:type-struct="ObjectClass">
<implements name="Interface"/>
<constructor name="new" c:identifier="foo_object_new">
<return-value transfer-ownership="full">
@@ -381,7 +384,7 @@ and/or use gtk-doc annotations. -->
</class>
<record name="ObjectClass"
c:type="FooObjectClass"
- glib:is-class-struct-for="Object">
+ glib:is-gtype-struct-for="Object">
<field name="parent_class">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
@@ -461,7 +464,8 @@ and/or use gtk-doc annotations. -->
<interface name="SubInterface"
c:type="FooSubInterface"
glib:type-name="FooSubInterface"
- glib:get-type="foo_sub_interface_get_type">
+ glib:get-type="foo_sub_interface_get_type"
+ glib:type-struct="SubInterfaceIface">
<prerequisite name="Interface"/>
<method name="do_bar" c:identifier="foo_sub_interface_do_bar">
<return-value transfer-ownership="none">
@@ -479,7 +483,9 @@ and/or use gtk-doc annotations. -->
</parameters>
</callback>
</interface>
- <record name="SubInterfaceIface" c:type="FooSubInterfaceIface">
+ <record name="SubInterfaceIface"
+ c:type="FooSubInterfaceIface"
+ glib:is-gtype-struct-for="SubInterface">
<field name="parent_iface">
<type name="GObject.TypeInterface" c:type="GTypeInterface"/>
</field>
@@ -500,7 +506,7 @@ and/or use gtk-doc annotations. -->
abstract="1"
glib:type-name="FooSubobject"
glib:get-type="foo_subobject_get_type"
- glib:class-struct="SubobjectClass">
+ glib:type-struct="SubobjectClass">
<implements name="Interface"/>
<constructor name="new" c:identifier="foo_subobject_new">
<return-value transfer-ownership="full">
@@ -513,7 +519,7 @@ and/or use gtk-doc annotations. -->
</class>
<record name="SubobjectClass"
c:type="FooSubobjectClass"
- glib:is-class-struct-for="Subobject">
+ glib:is-gtype-struct-for="Subobject">
<field name="parent_class">
<type name="ObjectClass" c:type="FooObjectClass"/>
</field>
diff --git a/tests/scanner/foo-1.0-expected.tgir b/tests/scanner/foo-1.0-expected.tgir
index dcd97891..f8e1ee59 100644
--- a/tests/scanner/foo-1.0-expected.tgir
+++ b/tests/scanner/foo-1.0-expected.tgir
@@ -71,7 +71,7 @@
</return-value>
</method>
</record>
- <class name="Buffer" parent="GObject.Object" glib:class-struct="BufferClass" glib:type-name="FooBuffer" glib:get-type="foo_buffer_get_type">
+ <class name="Buffer" parent="GObject.Object" glib:type-struct="BufferClass" glib:type-name="FooBuffer" glib:get-type="foo_buffer_get_type">
<implements name="Interface"/>
<method name="some_method" c:identifier="foo_buffer_some_method">
<return-value transfer-ownership="none">
@@ -79,7 +79,7 @@
</return-value>
</method>
</class>
- <record name="BufferClass" glib:is-class-struct="1"/>
+ <record name="BufferClass" glib:is-gtype-struct="1"/>
<callback name="Callback">
<return-value transfer-ownership="none">
<type name="boolean"/>
@@ -161,13 +161,13 @@
<member name="second" value="2"/>
<member name="third" value="4"/>
</bitfield>
- <interface name="Interface" glib:type-name="FooInterface" glib:get-type="foo_interface_get_type"/>
- <record name="InterfaceIface">
+ <interface name="Interface" glib:type-name="FooInterface" glib:get-type="foo_interface_get_type" glib:type-struct="InterfaceIface"/>
+ <record name="InterfaceIface" glib:is-gtype-struct="1">
<field name="parent_iface">
<type name="GObject.TypeInterface"/>
</field>
</record>
- <class name="Object" parent="GObject.Object" glib:class-struct="ObjectClass" glib:type-name="FooObject" glib:get-type="foo_object_get_type">
+ <class name="Object" parent="GObject.Object" glib:type-struct="ObjectClass" glib:type-name="FooObject" glib:get-type="foo_object_get_type">
<implements name="Interface"/>
<field name="parent_instance">
<type name="GObject.Object"/>
@@ -272,7 +272,7 @@
</parameters>
</glib:signal>
</class>
- <record name="ObjectClass" glib:is-class-struct="1">
+ <record name="ObjectClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
@@ -335,7 +335,7 @@
</field>
</record>
<record name="StructPrivate"/>
- <interface name="SubInterface" glib:type-name="FooSubInterface" glib:get-type="foo_sub_interface_get_type">
+ <interface name="SubInterface" glib:type-name="FooSubInterface" glib:get-type="foo_sub_interface_get_type" glib:type-struct="SubInterfaceIface">
<prerequisite name="Interface"/>
<method name="do_bar" c:identifier="foo_sub_interface_do_bar">
<return-value transfer-ownership="none">
@@ -343,12 +343,12 @@
</return-value>
</method>
</interface>
- <record name="SubInterfaceIface">
+ <record name="SubInterfaceIface" glib:is-gtype-struct="1">
<field name="parent_iface">
<type name="GObject.TypeInterface"/>
</field>
</record>
- <class name="Subobject" parent="Object" glib:class-struct="SubobjectClass" abstract="1" glib:type-name="FooSubobject" glib:get-type="foo_subobject_get_type">
+ <class name="Subobject" parent="Object" glib:type-struct="SubobjectClass" abstract="1" glib:type-name="FooSubobject" glib:get-type="foo_subobject_get_type">
<implements name="Interface"/>
<field name="parent_instance">
<type name="Object"/>
@@ -359,7 +359,7 @@
</return-value>
</constructor>
</class>
- <record name="SubobjectClass" glib:is-class-struct="1">
+ <record name="SubobjectClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="ObjectClass"/>
</field>
diff --git a/tests/scanner/utility-1.0-expected.gir b/tests/scanner/utility-1.0-expected.gir
index 3d8aed06..7ff6ca5a 100644
--- a/tests/scanner/utility-1.0-expected.gir
+++ b/tests/scanner/utility-1.0-expected.gir
@@ -52,7 +52,7 @@ and/or use gtk-doc annotations. -->
parent="GObject.Object"
glib:type-name="UtilityObject"
glib:get-type="utility_object_get_type"
- glib:class-struct="ObjectClass">
+ glib:type-struct="ObjectClass">
<method name="watch_dir" c:identifier="utility_object_watch_dir">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
@@ -81,7 +81,7 @@ and/or use gtk-doc annotations. -->
</class>
<record name="ObjectClass"
c:type="UtilityObjectClass"
- glib:is-class-struct-for="Object">
+ glib:is-gtype-struct-for="Object">
<field name="parent_class">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
diff --git a/tests/scanner/utility-1.0-expected.tgir b/tests/scanner/utility-1.0-expected.tgir
index 34bdce55..46ba2922 100644
--- a/tests/scanner/utility-1.0-expected.tgir
+++ b/tests/scanner/utility-1.0-expected.tgir
@@ -34,7 +34,7 @@
<member name="b" value="1"/>
<member name="c" value="2"/>
</enumeration>
- <class name="Object" parent="GObject.Object" glib:class-struct="ObjectClass" glib:type-name="UtilityObject" glib:get-type="utility_object_get_type">
+ <class name="Object" parent="GObject.Object" glib:type-struct="ObjectClass" glib:type-name="UtilityObject" glib:get-type="utility_object_get_type">
<field name="parent_instance">
<type name="GObject.Object"/>
</field>
@@ -58,7 +58,7 @@
</parameters>
</method>
</class>
- <record name="ObjectClass" glib:is-class-struct="1">
+ <record name="ObjectClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>