[libpeas: 11/18] Add a test for an invalid loader
- From: Steve Frécinaux <sfre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas: 11/18] Add a test for an invalid loader
- Date: Fri, 4 Mar 2011 09:40:45 +0000 (UTC)
commit 9d19252e045e255417ce1652ea81e4e93defcfd0
Author: Garrett Regier <alias301 gmail com>
Date: Thu Mar 3 04:34:43 2011 -0800
Add a test for an invalid loader
tests/libpeas/engine.c | 10 +++++++++-
tests/libpeas/plugins/Makefile.am | 3 ++-
...ader-disabled.plugin => disabled-loader.plugin} | 4 ++--
tests/libpeas/plugins/invalid-loader.plugin | 8 ++++++++
tests/libpeas/testing/testing.c | 1 +
5 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/tests/libpeas/engine.c b/tests/libpeas/engine.c
index 74c9bac..4f3fdad 100644
--- a/tests/libpeas/engine.c
+++ b/tests/libpeas/engine.c
@@ -327,7 +327,15 @@ test_engine_enable_loader (PeasEngine *engine)
* a plugin if it's loader is not enabled.
*/
- info = peas_engine_get_plugin_info (engine, "loader-disabled");
+ info = peas_engine_get_plugin_info (engine, "disabled-loader");
+
+ g_assert (!peas_engine_load_plugin (engine, info));
+ g_assert (!peas_plugin_info_is_loaded (info));
+ g_assert (!peas_plugin_info_is_available (info, NULL));
+
+
+ info = peas_engine_get_plugin_info (engine, "invalid-loader");
+ peas_engine_enable_loader (engine, "invalid");
g_assert (!peas_engine_load_plugin (engine, info));
g_assert (!peas_plugin_info_is_loaded (info));
diff --git a/tests/libpeas/plugins/Makefile.am b/tests/libpeas/plugins/Makefile.am
index ff1be81..e130dd9 100644
--- a/tests/libpeas/plugins/Makefile.am
+++ b/tests/libpeas/plugins/Makefile.am
@@ -11,11 +11,12 @@ SUBDIRS += extension-seed
endif
noinst_PLUGIN = \
+ disabled-loader.plugin \
info-missing-iage.plugin \
info-missing-module.plugin \
info-missing-name.plugin \
invalid.plugin \
- loader-disabled.plugin \
+ invalid-loader.plugin \
nonexistent-dep.plugin \
nonexistent-loader.plugin \
os-dependant-help.plugin
diff --git a/tests/libpeas/plugins/loader-disabled.plugin b/tests/libpeas/plugins/disabled-loader.plugin
similarity index 76%
rename from tests/libpeas/plugins/loader-disabled.plugin
rename to tests/libpeas/plugins/disabled-loader.plugin
index 51ec551..744689a 100644
--- a/tests/libpeas/plugins/loader-disabled.plugin
+++ b/tests/libpeas/plugins/disabled-loader.plugin
@@ -1,8 +1,8 @@
[Plugin]
-Module=loader-disabled
+Module=disabled-loader
Loader=disabled
IAge=2
-Name=Loader Disabled
+Name=Disabled Loader
Description=This plugin has a disabled loader.
Authors=Garrett Regier
Copyright=Copyright © 2011 Garrett Regier
diff --git a/tests/libpeas/plugins/invalid-loader.plugin b/tests/libpeas/plugins/invalid-loader.plugin
new file mode 100644
index 0000000..b5231c3
--- /dev/null
+++ b/tests/libpeas/plugins/invalid-loader.plugin
@@ -0,0 +1,8 @@
+[Plugin]
+Module=invalid-loader
+Loader=invalid
+IAge=2
+Name=Invalid Loader
+Description=This plugin has an invalid loader.
+Authors=Garrett Regier
+Copyright=Copyright © 2011 Garrett Regier
diff --git a/tests/libpeas/testing/testing.c b/tests/libpeas/testing/testing.c
index 2ff5724..8e4a282 100644
--- a/tests/libpeas/testing/testing.c
+++ b/tests/libpeas/testing/testing.c
@@ -50,6 +50,7 @@ static const gchar *allowed_patterns[] = {
"*Error loading *info-missing-module.plugin*",
"*Error loading *info-missing-name.plugin*",
"*Could not find loader 'disabled'*",
+ "*Could not find loader 'invalid'*",
"*Bad plugin file: *invalid.plugin*",
"*Error loading *invalid.plugin*"
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]