[libpeas] Add a test for reloading plugins



commit cdef41d39c928f2c1561c41224db632fcecd7182
Author: Garrett Regier <alias301 gmail com>
Date:   Sun Feb 6 02:36:55 2011 -0800

    Add a test for reloading plugins

 tests/libpeas/extension-python.c          |    2 ++
 tests/libpeas/extension-seed.c            |    2 ++
 tests/libpeas/testing/testing-extension.c |   15 +++++++++++++++
 tests/libpeas/testing/testing-extension.h |    3 +++
 4 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/tests/libpeas/extension-python.c b/tests/libpeas/extension-python.c
index 0cec9d5..7c4e602 100644
--- a/tests/libpeas/extension-python.c
+++ b/tests/libpeas/extension-python.c
@@ -40,6 +40,8 @@ main (int   argc,
   _EXTENSION_TEST ("python", "create-valid", create_valid);
   _EXTENSION_TEST ("python", "create-invalid", create_invalid);
 
+  _EXTENSION_TEST ("python", "reload", reload);
+
   _EXTENSION_TEST ("python", "call-invalid", call_invalid);
   _EXTENSION_TEST ("python", "call-no-args", call_no_args);
   _EXTENSION_TEST ("python", "call-with-return", call_with_return);
diff --git a/tests/libpeas/extension-seed.c b/tests/libpeas/extension-seed.c
index 96efadc..738978e 100644
--- a/tests/libpeas/extension-seed.c
+++ b/tests/libpeas/extension-seed.c
@@ -40,6 +40,8 @@ main (int   argc,
   _EXTENSION_TEST ("seed", "create-valid", create_valid);
   _EXTENSION_TEST ("seed", "create-invalid", create_invalid);
 
+  _EXTENSION_TEST ("seed", "reload", reload);
+
   _EXTENSION_TEST ("seed", "call-invalid", call_invalid);
   _EXTENSION_TEST ("seed", "call-no-args", call_no_args);
   _EXTENSION_TEST ("seed", "call-with-return", call_with_return);
diff --git a/tests/libpeas/testing/testing-extension.c b/tests/libpeas/testing/testing-extension.c
index 3982a1d..d54b797 100644
--- a/tests/libpeas/testing/testing-extension.c
+++ b/tests/libpeas/testing/testing-extension.c
@@ -136,6 +136,21 @@ testing_extension_create_invalid_ (PeasEngine *engine)
 }
 
 void
+testing_extension_reload_ (PeasEngine *engine)
+{
+  gint i;
+  PeasPluginInfo *info;
+
+  info = peas_engine_get_plugin_info (engine, extension_plugin);
+
+  for (i = 0; i < 3; ++i)
+    {
+      g_assert (peas_engine_load_plugin (engine, info));
+      g_assert (peas_engine_unload_plugin (engine, info));
+    }
+}
+
+void
 testing_extension_call_invalid_ (PeasEngine *engine)
 {
   PeasPluginInfo *info;
diff --git a/tests/libpeas/testing/testing-extension.h b/tests/libpeas/testing/testing-extension.h
index 35b13ef..cbccec9 100644
--- a/tests/libpeas/testing/testing-extension.h
+++ b/tests/libpeas/testing/testing-extension.h
@@ -43,6 +43,7 @@ void testing_extension_test_runner_   (TestingExtensionFixture_ *fixture,
 
 void testing_extension_create_valid_              (PeasEngine *engine);
 void testing_extension_create_invalid_            (PeasEngine *engine);
+void testing_extension_reload_                    (PeasEngine *engine);
 void testing_extension_call_invalid_              (PeasEngine *engine);
 void testing_extension_call_no_args_              (PeasEngine *engine);
 void testing_extension_call_with_return_          (PeasEngine *engine);
@@ -75,6 +76,8 @@ main (int   argc, \
   _EXTENSION_TEST (loader, "create-valid", create_valid); \
   _EXTENSION_TEST (loader, "create-invalid", create_invalid); \
 \
+  _EXTENSION_TEST (loader, "reload", reload); \
+\
   _EXTENSION_TEST (loader, "call-invalid", call_invalid); \
   _EXTENSION_TEST (loader, "call-no-args", call_no_args); \
   _EXTENSION_TEST (loader, "call-with-return", call_with_return); \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]