--- a/gplugin/tests/test-versioned-dependencies.c Thu Mar 12 23:19:23 2020 -0500
+++ b/gplugin/tests/test-versioned-dependencies.c Thu Mar 12 23:32:52 2020 -0500
@@ -15,24 +15,17 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
-#include <gplugin-native.h>
/******************************************************************************
*****************************************************************************/
-_test_plugin_load_and_has_dependent(
- GPluginPlugin *dependent,
- G_GNUC_UNUSED const gchar *id)
+_test_plugin_loaded(GPluginPlugin *dependent, const gchar *id) GPluginPlugin *plugin = NULL;
- GSList *deps = NULL, *l = NULL;
- gboolean found = FALSE;
plugin = gplugin_manager_find_plugin(id);
@@ -40,19 +33,6 @@
GPLUGIN_PLUGIN_STATE_LOADED);
- deps = gplugin_manager_get_plugin_dependencies(plugin, NULL);
- for(l = deps; l; l = l->next) {
- if(l->data == dependent) {
- g_slist_free_full(deps, g_object_unref);
g_object_unref(G_OBJECT(plugin));
@@ -64,8 +44,10 @@
GPluginPlugin *plugin = NULL;
- gplugin_manager_remove_paths();
gplugin_manager_append_path(TEST_VERSIONED_DEPENDENCY_DIR);
gplugin_manager_refresh();
@@ -73,26 +55,31 @@
g_assert_nonnull(plugin);
g_assert_true(GPLUGIN_IS_PLUGIN(plugin));
- gplugin_manager_load_plugin(plugin, &error);
+ ret = gplugin_manager_load_plugin(plugin, &error); g_assert_no_error(error);
gplugin_plugin_get_state(plugin),
GPLUGIN_PLUGIN_STATE_LOADED);
- g_object_unref(G_OBJECT(plugin));
/* now make sure each dependent plugin that's available was loaded */
- _test_plugin_load_and_has_dependent(plugin, "gplugin/test-no-version");
- _test_plugin_load_and_has_dependent(plugin, "gplugin/test-exact1");
- _test_plugin_load_and_has_dependent(plugin, "gplugin/test-exact2");
- _test_plugin_load_and_has_dependent(plugin, "gplugin/test-greater");
- _test_plugin_load_and_has_dependent(plugin, "gplugin/test-greater-equal");
- _test_plugin_load_and_has_dependent(plugin, "gplugin/test-less");
- _test_plugin_load_and_has_dependent(plugin, "gplugin/test-less-equal");
- _test_plugin_load_and_has_dependent(plugin, "gplugin/bar");
- _test_plugin_load_and_has_dependent(plugin, "gplugin/baz");
- _test_plugin_load_and_has_dependent(plugin, "gplugin/fez");
+ _test_plugin_loaded(plugin, "gplugin/test-no-version"); + _test_plugin_loaded(plugin, "gplugin/test-exact1"); + _test_plugin_loaded(plugin, "gplugin/test-exact2"); + _test_plugin_loaded(plugin, "gplugin/test-greater"); + _test_plugin_loaded(plugin, "gplugin/test-greater-equal"); + _test_plugin_loaded(plugin, "gplugin/test-less"); + _test_plugin_loaded(plugin, "gplugin/test-less-equal"); + _test_plugin_loaded(plugin, "gplugin/bar"); + _test_plugin_loaded(plugin, "gplugin/baz"); + _test_plugin_loaded(plugin, "gplugin/fez"); + g_object_unref(G_OBJECT(plugin)); /******************************************************************************
@@ -101,20 +88,12 @@
main(gint argc, gchar **argv)
g_test_init(&argc, &argv, NULL);
/* test the load on query flag */
"/dependent-versions/super-dependent",
test_load_with_dependencies);