diff options
author | Dan Winship <danw@gnome.org> | 2011-10-13 12:21:22 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2011-10-13 12:37:00 -0400 |
commit | 52e12815dc33af5dab95c08d29396c48ed8055c9 (patch) | |
tree | 10d7cb3f5be1cb9c38d639c170f94c25df5c66f9 /tests/scanner | |
parent | 2fff9866fd7f9de0fb8a7ac08d6c27a14c1f3f42 (diff) | |
download | gobject-introspection-52e12815dc33af5dab95c08d29396c48ed8055c9.tar.gz |
scanner: allow GObject.Object as a superclass return type
6172c268 made the scanner think GObject* wasn't a superclass of its
subclasses. Fix that.
https://bugzilla.gnome.org/show_bug.cgi?id=661677
Diffstat (limited to 'tests/scanner')
-rw-r--r-- | tests/scanner/Foo-1.0-expected.gir | 5 | ||||
-rw-r--r-- | tests/scanner/foo.c | 12 | ||||
-rw-r--r-- | tests/scanner/foo.h | 3 |
3 files changed, 19 insertions, 1 deletions
diff --git a/tests/scanner/Foo-1.0-expected.gir b/tests/scanner/Foo-1.0-expected.gir index b8dc33f5..826d676d 100644 --- a/tests/scanner/Foo-1.0-expected.gir +++ b/tests/scanner/Foo-1.0-expected.gir @@ -366,6 +366,11 @@ and/or use gtk-doc annotations. --> <type name="Object" c:type="FooObject*"/> </return-value> </constructor> + <constructor name="new_as_super" c:identifier="foo_object_new_as_super"> + <return-value transfer-ownership="full"> + <type name="GObject.Object" c:type="GObject*"/> + </return-value> + </constructor> <function name="a_global_method" c:identifier="foo_object_a_global_method"> <return-value transfer-ownership="none"> diff --git a/tests/scanner/foo.c b/tests/scanner/foo.c index 54566404..3e15444f 100644 --- a/tests/scanner/foo.c +++ b/tests/scanner/foo.c @@ -226,6 +226,18 @@ foo_object_init (FooObject *object) } +FooObject * +foo_object_new (void) +{ + return g_object_new (FOO_TYPE_OBJECT, NULL); +} + +GObject * +foo_object_new_as_super (void) +{ + return g_object_new (FOO_TYPE_OBJECT, NULL); +} + /** * foo_object_external_type: * @object: a #FooObject diff --git a/tests/scanner/foo.h b/tests/scanner/foo.h index bd502219..4b20ed7d 100644 --- a/tests/scanner/foo.h +++ b/tests/scanner/foo.h @@ -113,8 +113,9 @@ struct _FooObjectClass gint foo_init (void); GType foo_object_get_type (void) G_GNUC_CONST; -FooObject* foo_object_new (); +FooObject* foo_object_new (void); UtilityObject* foo_object_external_type (FooObject *object); +GObject* foo_object_new_as_super (void); void foo_object_various (FooObject *object, void *data, GType some_type); |