summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-05-23 20:38:55 +0200
committerTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-05-23 20:41:36 +0200
commit1edeccd204ac39743523275cfc50639a63a949cb (patch)
treee20654f964adf5217dae06cd6f04bfd1301c3109 /tests
parentf05406e92beede4357d74233d51aa3db45d709ae (diff)
downloadgobject-introspection-1edeccd204ac39743523275cfc50639a63a949cb.tar.gz
Add support for the 'foreign' annotation to g-i-scannerGOBJECT_INTROSPECTION_0_6_12
https://bugzilla.gnome.org/show_bug.cgi?id=619450
Diffstat (limited to 'tests')
-rw-r--r--tests/scanner/foo-1.0-expected.gir5
-rw-r--r--tests/scanner/foo-1.0-expected.tgir5
-rw-r--r--tests/scanner/foo.c5
-rw-r--r--tests/scanner/foo.h7
4 files changed, 22 insertions, 0 deletions
diff --git a/tests/scanner/foo-1.0-expected.gir b/tests/scanner/foo-1.0-expected.gir
index 3d209e31..20eb437e 100644
--- a/tests/scanner/foo-1.0-expected.gir
+++ b/tests/scanner/foo-1.0-expected.gir
@@ -241,6 +241,11 @@ and/or use gtk-doc annotations. -->
c:identifier="FOO_FLAGS_THIRD"
glib:nick="third"/>
</bitfield>
+ <record name="ForeignStruct" c:type="FooForeignStruct" foreign="1">
+ <field name="foo" writable="1">
+ <type name="int" c:type="int"/>
+ </field>
+ </record>
<interface name="Interface"
c:type="FooInterface"
glib:type-name="FooInterface"
diff --git a/tests/scanner/foo-1.0-expected.tgir b/tests/scanner/foo-1.0-expected.tgir
index 29753af1..c0bedbea 100644
--- a/tests/scanner/foo-1.0-expected.tgir
+++ b/tests/scanner/foo-1.0-expected.tgir
@@ -170,6 +170,11 @@
<member name="second" value="2"/>
<member name="third" value="4"/>
</bitfield>
+ <record name="ForeignStruct" foreign="1">
+ <field name="foo" writable="1">
+ <type name="int"/>
+ </field>
+ </record>
<interface name="Interface" glib:type-name="FooInterface" glib:get-type="foo_interface_get_type" glib:type-struct="InterfaceIface">
<method name="do_foo" c:identifier="foo_interface_do_foo">
<return-value transfer-ownership="none">
diff --git a/tests/scanner/foo.c b/tests/scanner/foo.c
index a404aac9..6239bfac 100644
--- a/tests/scanner/foo.c
+++ b/tests/scanner/foo.c
@@ -621,3 +621,8 @@ void
foo_skip_me (FooSkippable fs)
{
}
+
+/**
+ * FooForeignStruct: (foreign)
+ *
+ */
diff --git a/tests/scanner/foo.h b/tests/scanner/foo.h
index 0ebcca2a..fb4bc5cc 100644
--- a/tests/scanner/foo.h
+++ b/tests/scanner/foo.h
@@ -393,5 +393,12 @@ typedef enum {
} FooSkippable;
void foo_skip_me (FooSkippable fs);
+typedef struct _FooForeignStruct FooForeignStruct;
+
+struct _FooForeignStruct
+{
+ int foo;
+};
+
#endif /* __FOO_OBJECT_H__ */