From 10fddbe177f06860ed8179b2ac330b6ec087ba2f Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 17 Mar 2023 16:07:11 -0700 Subject: extension: use GObject instead of PeasExtension Now that there is no longer wrapped objects and calling via GObject Introspection, we can remove the use of PeasExtension and simply use GObject (as it was internally already). --- tests/libpeas/extension-c.c | 12 +++--- tests/libpeas/extension-lua.c | 10 ++--- tests/libpeas/extension-py.c | 8 ++-- tests/libpeas/extension-set.c | 10 ++--- .../libpeas/plugins/extension-c/extension-c.plugin | 2 +- .../plugins/extension-lua/extension-lua51.plugin | 2 +- .../extension-python/extension-py.plugin.in | 2 +- tests/libpeas/testing/testing-extension.c | 46 +++++++++++----------- 8 files changed, 46 insertions(+), 46 deletions(-) (limited to 'tests') diff --git a/tests/libpeas/extension-c.c b/tests/libpeas/extension-c.c index 78c56c0..c2e9a24 100644 --- a/tests/libpeas/extension-c.c +++ b/tests/libpeas/extension-c.c @@ -37,7 +37,7 @@ static void test_extension_c_embedded (PeasEngine *engine) { PeasPluginInfo *info; - PeasExtension *extension; + GObject *extension; info = peas_engine_get_plugin_info (engine, "embedded"); @@ -93,13 +93,13 @@ static void test_extension_c_instance_refcount (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; extension = peas_engine_create_extension (engine, info, INTROSPECTION_TYPE_BASE, NULL); - g_assert (PEAS_IS_EXTENSION (extension)); + g_assert (G_IS_OBJECT (extension)); /* The refcount of the returned object should be 1: * - one ref for the PeasExtension @@ -127,7 +127,7 @@ test_extension_c_local_linkage (PeasEngine *engine, PeasPluginInfo *info) { PeasPluginInfo *loadable_info; - PeasExtension *c_extension, *loadable_extension; + GObject *c_extension, *loadable_extension; gpointer c_global_symbol, loadable_global_symbol; loadable_info = peas_engine_get_plugin_info (engine, "loadable"); @@ -140,8 +140,8 @@ test_extension_c_local_linkage (PeasEngine *engine, PEAS_TYPE_ACTIVATABLE, NULL); - g_assert (PEAS_IS_EXTENSION (c_extension)); - g_assert (PEAS_IS_EXTENSION (loadable_extension)); + g_assert (G_IS_OBJECT (c_extension)); + g_assert (G_IS_OBJECT (loadable_extension)); g_assert (c_extension != loadable_extension); g_object_get (c_extension, diff --git a/tests/libpeas/extension-lua.c b/tests/libpeas/extension-lua.c index b5a21dd..1fbd09e 100644 --- a/tests/libpeas/extension-lua.c +++ b/tests/libpeas/extension-lua.c @@ -42,7 +42,7 @@ set_garbage_collector_state (PeasEngine *engine, PeasPluginInfo *info, gboolean start) { - PeasExtension *extension; + GObject *extension; extension = peas_engine_create_extension (engine, info, PEAS_TYPE_ACTIVATABLE, @@ -66,7 +66,7 @@ static void test_extension_lua_instance_refcount (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; set_garbage_collector_state (engine, info, FALSE); @@ -75,7 +75,7 @@ test_extension_lua_instance_refcount (PeasEngine *engine, NULL); g_object_add_weak_pointer (extension, (gpointer *) &extension); - g_assert (PEAS_IS_EXTENSION (extension)); + g_assert (G_IS_OBJECT (extension)); /* The Lua wrapper created around the extension * object should have increased its refcount by 1. @@ -105,7 +105,7 @@ static void test_extension_lua_activatable_subject_refcount (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; GObject *object; set_garbage_collector_state (engine, info, FALSE); @@ -125,7 +125,7 @@ test_extension_lua_activatable_subject_refcount (PeasEngine *engine, NULL); g_object_add_weak_pointer (extension, (gpointer *) &extension); - g_assert (PEAS_IS_EXTENSION (extension)); + g_assert (G_IS_OBJECT (extension)); /* The Lua wrapper created around our dummy * object should have increased its refcount by 1. diff --git a/tests/libpeas/extension-py.c b/tests/libpeas/extension-py.c index 7adb7b9..4c6062f 100644 --- a/tests/libpeas/extension-py.c +++ b/tests/libpeas/extension-py.c @@ -49,13 +49,13 @@ static void test_extension_py_instance_refcount (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; extension = peas_engine_create_extension (engine, info, INTROSPECTION_TYPE_BASE, NULL); - g_assert (PEAS_IS_EXTENSION (extension)); + g_assert (G_IS_OBJECT (extension)); g_object_add_weak_pointer (extension, (gpointer *) &extension); @@ -69,7 +69,7 @@ static void test_extension_py_activatable_subject_refcount (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; GObject *object; PyObject *wrapper; @@ -85,7 +85,7 @@ test_extension_py_activatable_subject_refcount (PeasEngine *engine, "object", object, NULL); - g_assert (PEAS_IS_EXTENSION (extension)); + g_assert (G_IS_OBJECT (extension)); /* The python wrapper created around our dummy object should have increased * its refcount by 1. diff --git a/tests/libpeas/extension-set.c b/tests/libpeas/extension-set.c index 93ec32d..06aa318 100644 --- a/tests/libpeas/extension-set.c +++ b/tests/libpeas/extension-set.c @@ -47,7 +47,7 @@ static const gchar *loadable_plugins[] = { static void extension_added_cb (PeasExtensionSet *extension_set, PeasPluginInfo *info, - PeasExtension *extension, + GObject *extension, gint *active) { ++(*active); @@ -56,7 +56,7 @@ extension_added_cb (PeasExtensionSet *extension_set, static void extension_removed_cb (PeasExtensionSet *extension_set, PeasPluginInfo *info, - PeasExtension *extension, + GObject *extension, gint *active) { --(*active); @@ -152,7 +152,7 @@ test_extension_set_create_valid (PeasEngine *engine) static void valid_extension_added_cb (PeasExtensionSet *extension_set, PeasPluginInfo *info, - PeasExtension *extension, + GObject *extension, GObject **obj_ptr) { g_clear_object (obj_ptr); @@ -330,7 +330,7 @@ static void test_extension_set_get_extension (PeasEngine *engine) { PeasPluginInfo *info; - PeasExtension *extension; + GObject *extension; PeasExtensionSet *extension_set; extension_set = testing_extension_set_new (engine, NULL); @@ -369,7 +369,7 @@ test_extension_set_foreach (PeasEngine *engine) static void ordering_cb (PeasExtensionSet *set, PeasPluginInfo *info, - PeasExtension *extension, + GObject *extension, GList **order) { const gchar *order_module_name = (const gchar *) (*order)->data; diff --git a/tests/libpeas/plugins/extension-c/extension-c.plugin b/tests/libpeas/plugins/extension-c/extension-c.plugin index 4e079fb..94871bf 100644 --- a/tests/libpeas/plugins/extension-c/extension-c.plugin +++ b/tests/libpeas/plugins/extension-c/extension-c.plugin @@ -1,6 +1,6 @@ [Plugin] Module=extension-c Name=Extension C -Description=This plugin is for the C PeasExtension tests. +Description=This plugin is for the C GObject tests. Authors=Garrett Regier Copyright=Copyright © 2010 Garrett Regier diff --git a/tests/libpeas/plugins/extension-lua/extension-lua51.plugin b/tests/libpeas/plugins/extension-lua/extension-lua51.plugin index ff4b51a..1b076d5 100644 --- a/tests/libpeas/plugins/extension-lua/extension-lua51.plugin +++ b/tests/libpeas/plugins/extension-lua/extension-lua51.plugin @@ -2,6 +2,6 @@ Module=extension-lua51 Loader=lua5.1 Name=Extension lua5.1 -Description=This plugin is for the lua5.1 PeasExtension tests. +Description=This plugin is for the lua5.1 GObject tests. Authors=Garrett Regier Copyright=Copyright © 2014 Garrett Regier diff --git a/tests/libpeas/plugins/extension-python/extension-py.plugin.in b/tests/libpeas/plugins/extension-python/extension-py.plugin.in index 5258594..fc07603 100644 --- a/tests/libpeas/plugins/extension-python/extension-py.plugin.in +++ b/tests/libpeas/plugins/extension-python/extension-py.plugin.in @@ -2,6 +2,6 @@ Module=extension-@PY_LOADER@ Loader=@PY_LOADER@ Name=Extension @PY_LOADER@ -Description=This plugin is for the @PY_LOADER@ PeasExtension tests. +Description=This plugin is for the @PY_LOADER@ GObject tests. Authors=Garrett Regier Copyright=Copyright © 2010 Garrett Regier diff --git a/tests/libpeas/testing/testing-extension.c b/tests/libpeas/testing/testing-extension.c index b34eef5..796bcc8 100644 --- a/tests/libpeas/testing/testing-extension.c +++ b/tests/libpeas/testing/testing-extension.c @@ -134,13 +134,13 @@ static void test_extension_create_valid (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; extension = peas_engine_create_extension (engine, info, INTROSPECTION_TYPE_CALLABLE, NULL); - g_assert (PEAS_IS_EXTENSION (extension)); + g_assert (G_IS_OBJECT (extension)); g_assert (INTROSPECTION_IS_CALLABLE (extension)); g_object_unref (extension); @@ -150,14 +150,14 @@ static void test_extension_create_valid_without_properties (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; extension = peas_engine_create_extension_with_properties (engine, info, INTROSPECTION_TYPE_CALLABLE, 0, NULL, NULL); - g_assert (PEAS_IS_EXTENSION (extension)); + g_assert (G_IS_OBJECT (extension)); g_assert (INTROSPECTION_IS_CALLABLE (extension)); g_object_unref (extension); @@ -167,7 +167,7 @@ static void test_extension_create_valid_with_properties (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; IntrospectionAbstract *abstract; GValue prop_values[1] = { G_VALUE_INIT }; const gchar *prop_names[1] = { "abstract-property" }; @@ -193,7 +193,7 @@ static void test_extension_create_invalid (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; testing_util_push_log_hook ("*assertion*G_TYPE_IS_INTERFACE*failed"); testing_util_push_log_hook ("*does not provide a 'IntrospectionUnimplemented' extension"); @@ -202,40 +202,40 @@ test_extension_create_invalid (PeasEngine *engine, /* Invalid GType */ extension = peas_engine_create_extension (engine, info, G_TYPE_INVALID, NULL); - g_assert (!PEAS_IS_EXTENSION (extension)); + g_assert (!G_IS_OBJECT (extension)); /* GObject but not a GInterface */ extension = peas_engine_create_extension (engine, info, PEAS_TYPE_ENGINE, NULL); - g_assert (!PEAS_IS_EXTENSION (extension)); + g_assert (!G_IS_OBJECT (extension)); /* Does not implement this GType */ extension = peas_engine_create_extension (engine, info, INTROSPECTION_TYPE_UNIMPLEMENTED, NULL); - g_assert (!PEAS_IS_EXTENSION (extension)); + g_assert (!G_IS_OBJECT (extension)); /* Interface does not have a specified property */ extension = peas_engine_create_extension (engine, info, INTROSPECTION_TYPE_CALLABLE, "does-not-exist", "", NULL); - g_assert (!PEAS_IS_EXTENSION (extension)); + g_assert (!G_IS_OBJECT (extension)); /* Not loaded */ g_assert (peas_engine_unload_plugin (engine, info)); extension = peas_engine_create_extension (engine, info, INTROSPECTION_TYPE_CALLABLE, NULL); - g_assert (!PEAS_IS_EXTENSION (extension)); + g_assert (!G_IS_OBJECT (extension)); } static void test_extension_create_invalid_with_properties (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; GValue prop_values[1] = { G_VALUE_INIT }; const gchar *prop_names[1] = { NULL }; GValue prop_values2[1] = { G_VALUE_INIT }; @@ -254,20 +254,20 @@ test_extension_create_invalid_with_properties (PeasEngine *engine, extension = peas_engine_create_extension_with_properties (engine, info, G_TYPE_INVALID, 0, NULL, NULL); - g_assert (!PEAS_IS_EXTENSION (extension)); + g_assert (!G_IS_OBJECT (extension)); /* GObject but not a GInterface */ extension = peas_engine_create_extension_with_properties (engine, info, PEAS_TYPE_ENGINE, 0, NULL, NULL); - g_assert (!PEAS_IS_EXTENSION (extension)); + g_assert (!G_IS_OBJECT (extension)); /* Does not implement this GType */ extension = peas_engine_create_extension_with_properties (engine, info, INTROSPECTION_TYPE_UNIMPLEMENTED, 0, NULL, NULL); - g_assert (!PEAS_IS_EXTENSION (extension)); + g_assert (!G_IS_OBJECT (extension)); /* Interface has a NULL property name*/ extension = @@ -275,7 +275,7 @@ test_extension_create_invalid_with_properties (PeasEngine *engine, INTROSPECTION_TYPE_CALLABLE, G_N_ELEMENTS (prop_names2), prop_names, prop_values); - g_assert (!PEAS_IS_EXTENSION (extension)); + g_assert (!G_IS_OBJECT (extension)); /* Interface has a not initialiazed GValue */ extension = @@ -283,7 +283,7 @@ test_extension_create_invalid_with_properties (PeasEngine *engine, INTROSPECTION_TYPE_CALLABLE, G_N_ELEMENTS (prop_names2), prop_names2, prop_values2); - g_assert (!PEAS_IS_EXTENSION (extension)); + g_assert (!G_IS_OBJECT (extension)); /* Not loaded */ g_assert (peas_engine_unload_plugin (engine, info)); @@ -291,7 +291,7 @@ test_extension_create_invalid_with_properties (PeasEngine *engine, peas_engine_create_extension_with_properties (engine, info, INTROSPECTION_TYPE_CALLABLE, 0, NULL, NULL); - g_assert (!PEAS_IS_EXTENSION (extension)); + g_assert (!G_IS_OBJECT (extension)); g_value_unset (&prop_values[0]); @@ -301,7 +301,7 @@ static void test_extension_create_with_prerequisite (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; gint prerequisite_property = -1; extension = peas_engine_create_extension (engine, info, @@ -337,7 +337,7 @@ static void test_extension_plugin_info (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; IntrospectionBase *base; g_assert (peas_engine_load_plugin (engine, info)); @@ -357,7 +357,7 @@ static void test_extension_get_settings (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; IntrospectionBase *base; GSettings *settings; @@ -380,7 +380,7 @@ static void test_extension_abstract (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; IntrospectionAbstract *abstract; g_assert (peas_engine_load_plugin (engine, info)); @@ -490,7 +490,7 @@ static void test_extension_multiple_threads_callbacks (PeasEngine *engine, PeasPluginInfo *info) { - PeasExtension *extension; + GObject *extension; gint n_threads, update_count; extension = peas_engine_create_extension (engine, info, -- cgit v1.2.1