--- a/gplugin/tests/test-core.c Mon Mar 09 03:03:39 2020 +0000
+++ b/gplugin/tests/test-core.c Thu Feb 27 02:36:58 2020 -0600
@@ -20,6 +20,39 @@
/******************************************************************************
+ *****************************************************************************/ +test_gplugin_count_ids_and_plugins(gint *n_ids, gint *n_plugins) + GList *l_ids = NULL, *l_id = NULL; + gint ids = 0, plugins = 0; + l_ids = gplugin_manager_list_plugins(); + for(l_id = l_ids; l_id; l_id = l_id->next) { + GSList *l_plugins = NULL, *l_plugin = NULL; + const gchar *id = (const gchar *)l_id->data; + l_plugins = gplugin_manager_find_plugins(id); + for(l_plugin = l_plugins; l_plugin; l_plugin = l_plugin->next) { + g_slist_free_full(l_plugins, g_object_unref); +/****************************************************************************** *****************************************************************************/
@@ -57,8 +90,6 @@
test_gplugin_init_uninit_with_double_refresh_plugins(void)
gint f_ids = 0, s_ids = 0, f_plugins = 0, s_plugins = 0;
@@ -67,25 +98,11 @@
/* run the first refresh and count everything */
gplugin_manager_refresh();
- for(l = gplugin_manager_list_plugins(); l; l = l->next) {
- const gchar *id = (const gchar *)l->data;
- for(sl = gplugin_manager_find_plugins(id); sl; sl = sl->next)
+ test_gplugin_count_ids_and_plugins(&f_ids, &f_plugins); /* now run the second refresh and make sure the counts match */
gplugin_manager_refresh();
- for(l = gplugin_manager_list_plugins(); l; l = l->next) {
- const gchar *id = (const gchar *)l->data;
- for(sl = gplugin_manager_find_plugins(id); sl; sl = sl->next)
+ test_gplugin_count_ids_and_plugins(&s_ids, &s_plugins); g_assert_cmpint(f_ids, >, 0);
g_assert_cmpint(f_plugins, >, 0);