[gobject-introspection] tests: Add a hidden fundamental class
- From: Lionel Landwerlin <llandwerlin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] tests: Add a hidden fundamental class
- Date: Sat, 14 Jan 2017 12:57:23 +0000 (UTC)
commit ceddab4d6f0f65d773f361863ca3022b67b192bd
Author: Lionel Landwerlin <llandwerlin gmail com>
Date: Sat Jan 2 00:17:59 2016 +0100
tests: Add a hidden fundamental class
We could have a fundamental type A derived by a subclass B. Class A happens
to be introspected, but B isn't. This can cause some issues in Gjs.
https://bugzilla.gnome.org/show_bug.cgi?id=760056
tests/scanner/regress.c | 37 +++++++++++++++++++++++++++++++++++++
tests/scanner/regress.h | 4 ++++
2 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index c317682..638587e 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -3442,6 +3442,43 @@ regress_test_fundamental_sub_object_new (const char * data)
return object;
}
+/**/
+
+#define regress_test_fundamental_hidden_sub_object_get_type \
+ _regress_test_fundamental_hidden_sub_object_get_type
+
+typedef struct _RegressTestFundamentalHiddenSubObject RegressTestFundamentalHiddenSubObject;
+typedef struct _GObjectClass RegressTestFundamentalHiddenSubObjectClass;
+struct _RegressTestFundamentalHiddenSubObject {
+ RegressTestFundamentalObject parent_instance;
+};
+
+G_DEFINE_TYPE (RegressTestFundamentalHiddenSubObject,
+ regress_test_fundamental_hidden_sub_object,
+ REGRESS_TEST_TYPE_FUNDAMENTAL_OBJECT);
+
+static void
+regress_test_fundamental_hidden_sub_object_init (RegressTestFundamentalHiddenSubObject *object)
+{
+}
+
+static void
+regress_test_fundamental_hidden_sub_object_class_init (RegressTestFundamentalHiddenSubObjectClass *klass)
+{
+}
+
+/**
+ * regress_test_create_fundamental_hidden_class_instance:
+ *
+ * Return value: (transfer full):
+ */
+RegressTestFundamentalObject *
+regress_test_create_fundamental_hidden_class_instance (void)
+{
+ return (RegressTestFundamentalObject *) g_type_create_instance
(_regress_test_fundamental_hidden_sub_object_get_type());
+}
+
+
/**
* regress_test_callback:
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index 1abd610..4771cc6 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -1044,6 +1044,10 @@ _GI_TEST_EXTERN
RegressTestFundamentalSubObject *
regress_test_fundamental_sub_object_new (const char *data);
+_GI_TEST_EXTERN
+RegressTestFundamentalObject *
+regress_test_create_fundamental_hidden_class_instance (void);
+
/* callback */
typedef void (*RegressTestSimpleCallback) (void);
typedef void RegressTestNoPtrCallback (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]