summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGarrett Regier <garrettregier@gmail.com>2015-12-19 14:53:35 -0800
committerGarrett Regier <garrettregier@gmail.com>2015-12-19 14:53:35 -0800
commit5ac602a782ff18ab7f56a5ed546aa24cc1f6c13d (patch)
tree60d76e9d7aad5aa4142866ebaf58f6c6e6385196 /tests
parentfe55d3190db1a09f0914720cfc94e1a7cd6de3a4 (diff)
downloadlibpeas-5ac602a782ff18ab7f56a5ed546aa24cc1f6c13d.tar.gz
Fix sorting of PeasEngine:plugin-list
The new "better order" ended up breaking the order to be correct in regards to dependencies. https://bugzilla.gnome.org/show_bug.cgi?id=759613
Diffstat (limited to 'tests')
-rw-r--r--tests/libpeas/engine.c6
-rw-r--r--tests/libpeas/plugins/two-deps.plugin2
-rw-r--r--tests/testing-util/testing-util.c11
3 files changed, 15 insertions, 4 deletions
diff --git a/tests/libpeas/engine.c b/tests/libpeas/engine.c
index 26bdc43..0c975f4 100644
--- a/tests/libpeas/engine.c
+++ b/tests/libpeas/engine.c
@@ -286,9 +286,9 @@ test_engine_plugin_list (PeasEngine *engine)
/* Verify that we are finding the furthest dependency in the list */
dependencies = peas_plugin_info_get_dependencies (two_deps_info);
- g_assert_cmpint (builtin_index, <, loadable_index);
- g_assert_cmpstr (dependencies[0], ==, "builtin");
- g_assert_cmpstr (dependencies[1], ==, "loadable");
+ g_assert_cmpint (builtin_index, >, loadable_index);
+ g_assert_cmpstr (dependencies[0], ==, "loadable");
+ g_assert_cmpstr (dependencies[1], ==, "builtin");
/* The two-deps plugin should be ordered after builtin and loadable */
g_assert_cmpint (builtin_index, <, two_deps_index);
diff --git a/tests/libpeas/plugins/two-deps.plugin b/tests/libpeas/plugins/two-deps.plugin
index 0231c27..b463a82 100644
--- a/tests/libpeas/plugins/two-deps.plugin
+++ b/tests/libpeas/plugins/two-deps.plugin
@@ -1,6 +1,6 @@
[Plugin]
Module=two-deps
-Depends=builtin;loadable
+Depends=loadable;builtin
Name=Two Deps
Description=This plugin cannot be loaded and has two deps.
Authors=Garrett Regier
diff --git a/tests/testing-util/testing-util.c b/tests/testing-util/testing-util.c
index 4763e46..1f167a9 100644
--- a/tests/testing-util/testing-util.c
+++ b/tests/testing-util/testing-util.c
@@ -249,6 +249,17 @@ testing_util_engine_new_full (gboolean nonglobal_loaders)
(GWeakNotify) engine_weak_notify,
NULL);
+ /* The plugins that two-deps depends on must be added
+ * to the engine before it. This is used to verify that
+ * the engine will order the plugin list correctly.
+ */
+ peas_engine_add_search_path (engine,
+ BUILDDIR "/tests/plugins/builtin",
+ SRCDIR "/tests/plugins/builtin");
+ peas_engine_add_search_path (engine,
+ BUILDDIR "/tests/plugins/loadable",
+ SRCDIR "/tests/plugins/loadable");
+
peas_engine_add_search_path (engine,
BUILDDIR "/tests/plugins",
SRCDIR "/tests/plugins");