[rygel] test: Add testcase for loading conflicting modules



commit 07577c69dcf8f02d89e5cc021af189956553cd81
Author: Jens Georg <mail jensge org>
Date:   Sun Aug 2 12:02:07 2020 +0200

    test: Add testcase for loading conflicting modules
    
    Modules that are conflicting but one of which is disabled should make
    the other load

 tests/plugin-loader/rygel-plugin-loader-test.vala | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/tests/plugin-loader/rygel-plugin-loader-test.vala 
b/tests/plugin-loader/rygel-plugin-loader-test.vala
index 94133de4..e26740b2 100644
--- a/tests/plugin-loader/rygel-plugin-loader-test.vala
+++ b/tests/plugin-loader/rygel-plugin-loader-test.vala
@@ -58,6 +58,24 @@ void test_plugin_loader_conflict () {
     Rygel.MetaConfig.cleanup ();
 }
 
+void test_plugin_loader_conflict_with_disabled () {
+    var config = new TestConfig ();
+    config.enable["Tracker"] = false;
+    config.enable["Tracker3"] = true;
+    config.enable["SomePlugin"] = true;
+    Rygel.MetaConfig.register_configuration (config);
+
+    var loader = new TestPluginLoader("conflicts",
+                                      {"librygel-tracker3.so", "librygel-no-conflict.so"},
+                                      {"librygel-tracker.so"});
+    loader.load_modules_sync (null);
+    assert (loader.loaded_plugins.length == 2);
+    assert ("librygel-tracker3.so" in loader.loaded_plugins);
+    assert ("librygel-no-conflict.so" in loader.loaded_plugins);
+
+    Rygel.MetaConfig.cleanup ();
+}
+
 
 void test_plugin_loader_conflict_dynamic_enable () {
     var config = new TestConfig ();
@@ -90,7 +108,9 @@ int main (string[] args) {
 
     Test.add_func ("/librygel-core/plugins/load-conflict",
                    test_plugin_loader_conflict);
+    Test.add_func ("/librygel-core/plugins/load-conflict-with-disabled",
+                   test_plugin_loader_conflict_with_disabled);
     Test.add_func ("/librygel-core/plugins/load-conflict-enable",
                    test_plugin_loader_conflict_dynamic_enable);
     return Test.run ();
-}
\ No newline at end of file
+}


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