[libpeas] Add a test for an invalid loader
- From: Steve Frécinaux <sfre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Add a test for an invalid loader
- Date: Wed, 9 Feb 2011 00:14:41 +0000 (UTC)
commit 84108e35d6e42070331c1b155a04f559c0aebb6d
Author: Garrett Regier <alias301 gmail com>
Date: Sun Feb 6 02:43:40 2011 -0800
Add a test for an invalid loader
tests/libpeas/engine.c | 13 +++++++++++++
tests/libpeas/plugins/Makefile.am | 1 +
tests/libpeas/plugins/invalid-loader.plugin | 9 +++++++++
tests/libpeas/testing/testing.c | 2 +-
4 files changed, 24 insertions(+), 1 deletions(-)
---
diff --git a/tests/libpeas/engine.c b/tests/libpeas/engine.c
index 8784a54..48b81d5 100644
--- a/tests/libpeas/engine.c
+++ b/tests/libpeas/engine.c
@@ -246,6 +246,18 @@ test_engine_loaded_plugins (PeasEngine *engine)
&loaded_plugins);
}
+static void
+test_engine_invalid_loader (PeasEngine *engine)
+{
+ PeasPluginInfo *info;
+
+ info = peas_engine_get_plugin_info (engine, "invalid-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));
+}
+
#ifdef CANNOT_TEST
static void
test_engine_disable_loader (PeasEngine *engine)
@@ -292,6 +304,7 @@ main (int argc,
TEST ("loaded-plugins", loaded_plugins);
+ TEST ("invalid-loader", invalid_loader);
#ifdef CANNOT_TEST
TEST ("disable-loader", disable_loader);
#endif
diff --git a/tests/libpeas/plugins/Makefile.am b/tests/libpeas/plugins/Makefile.am
index 4958eb9..7874100 100644
--- a/tests/libpeas/plugins/Makefile.am
+++ b/tests/libpeas/plugins/Makefile.am
@@ -12,6 +12,7 @@ noinst_DATA = \
info-missing-iage.plugin \
info-missing-module.plugin \
info-missing-name.plugin \
+ invalid-loader.plugin \
os-dependant-help.plugin
EXTRA_DIST = $(noinst_DATA)
diff --git a/tests/libpeas/plugins/invalid-loader.plugin b/tests/libpeas/plugins/invalid-loader.plugin
new file mode 100644
index 0000000..96e9e3c
--- /dev/null
+++ b/tests/libpeas/plugins/invalid-loader.plugin
@@ -0,0 +1,9 @@
+[Plugin]
+Module=invalid-loader
+Loader=does-not-exist
+IAge=2
+Name=Invalid Loader
+Description=This plugin has an invalid loader.
+Authors=Garrett Regier
+Copyright=Copyright © 2011 Garrett Regier
+Website=http://live.gnome.org/Libpeas
diff --git a/tests/libpeas/testing/testing.c b/tests/libpeas/testing/testing.c
index ce7506d..93014b2 100644
--- a/tests/libpeas/testing/testing.c
+++ b/tests/libpeas/testing/testing.c
@@ -40,7 +40,7 @@ static GLogFunc default_log_func;
* Would be nice if we could assert that they were...
*/
static const gchar *allowed_patterns[] = {
- "*Plugin not found: does-not-exist*",
+ "*does-not-exist*",
"*lib*loader.so*cannot open shared object file: No such file or directory*",
"*Could not find 'IAge' in *info-missing-iage.plugin*",
"*Could not find 'Module' in *info-missing-module.plugin*",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]