summaryrefslogtreecommitdiff
path: root/tests/scanner
diff options
context:
space:
mode:
authorLionel Landwerlin <llandwerlin@gmail.com>2016-01-02 00:17:59 +0100
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>2017-01-14 12:55:51 +0000
commitceddab4d6f0f65d773f361863ca3022b67b192bd (patch)
tree7a8db60a7c5c7af5de256350e9e8d9c11fd66d78 /tests/scanner
parent4bcad96c5a3f1ab17187e264e0e550fab56a29dc (diff)
downloadgobject-introspection-ceddab4d6f0f65d773f361863ca3022b67b192bd.tar.gz
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
Diffstat (limited to 'tests/scanner')
-rw-r--r--tests/scanner/regress.c37
-rw-r--r--tests/scanner/regress.h4
2 files changed, 41 insertions, 0 deletions
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index c317682a..638587e3 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 1abd610f..4771cc68 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);