[grilo-plugins] tests: Unload plugin after the test



commit f7fa1dc04392976357569e546ad57040a9815779
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Fri Sep 27 11:28:09 2013 +0000

    tests: Unload plugin after the test
    
    This covers the case of deinitializing a plugin

 tests/apple-trailers/test_apple_trailers.c |   13 +++++++++++++
 tests/bliptv/test_bliptv.c                 |   13 +++++++++++++
 tests/vimeo/test_vimeo.c                   |   13 +++++++++++++
 3 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/tests/apple-trailers/test_apple_trailers.c b/tests/apple-trailers/test_apple_trailers.c
index 809616d..33be3a0 100644
--- a/tests/apple-trailers/test_apple_trailers.c
+++ b/tests/apple-trailers/test_apple_trailers.c
@@ -36,6 +36,17 @@ test_setup (void)
 }
 
 static void
+test_unload (const gchar *plugin_id)
+{
+  GError *error = NULL;
+  GrlRegistry *registry;
+
+  registry = grl_registry_get_default ();
+  grl_registry_unload_plugin (registry, plugin_id, &error);
+  g_assert_no_error (error);
+}
+
+static void
 verify (GrlData *data,
         guint n)
 {
@@ -157,4 +168,6 @@ main(int argc, char **argv)
   g_test_add_func ("/apple-trailers/browse/skip", test_browse_skip);
 
   return g_test_run ();
+
+  test_unload (APPLE_TRAILERS_ID);
 }
diff --git a/tests/bliptv/test_bliptv.c b/tests/bliptv/test_bliptv.c
index 3ada272..15dddfa 100644
--- a/tests/bliptv/test_bliptv.c
+++ b/tests/bliptv/test_bliptv.c
@@ -38,6 +38,17 @@ test_setup (void)
 }
 
 static void
+test_unload (const gchar *plugin_id)
+{
+  GError *error = NULL;
+  GrlRegistry *registry;
+
+  registry = grl_registry_get_default ();
+  grl_registry_unload_plugin (registry, plugin_id, &error);
+  g_assert_no_error (error);
+}
+
+static void
 test_browse (void)
 {
   GError *error = NULL;
@@ -274,4 +285,6 @@ main(int argc, char **argv)
   g_test_add_func ("/bliptv/autosplit", test_autosplit);
 
   return g_test_run ();
+
+  test_unload (BLIPTV_ID);
 }
diff --git a/tests/vimeo/test_vimeo.c b/tests/vimeo/test_vimeo.c
index 29b4aaf..611f884 100644
--- a/tests/vimeo/test_vimeo.c
+++ b/tests/vimeo/test_vimeo.c
@@ -48,6 +48,17 @@ test_setup (void)
 }
 
 static void
+test_unload (const gchar *plugin_id)
+{
+  GError *error = NULL;
+  GrlRegistry *registry;
+
+  registry = grl_registry_get_default ();
+  grl_registry_unload_plugin (registry, plugin_id, &error);
+  g_assert_no_error (error);
+}
+
+static void
 test_search_normal (void)
 {
   GError *error = NULL;
@@ -250,4 +261,6 @@ main (int argc, char **argv)
   g_test_add_func ("/vimeo/cancel", test_cancel);
 
   return g_test_run ();
+
+  test_unload (VIMEO_ID);
 }


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