]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
test_utils.c: Skip test adsi_loaded_test if module not loaded.
authorChris-Savinovich <csavinovich@digium.com>
Wed, 4 Sep 2019 21:19:55 +0000 (16:19 -0500)
committerChristian Savinovich <csavinovich@digium.com>
Wed, 4 Sep 2019 21:49:49 +0000 (16:49 -0500)
Module res_adsi.so is deprecated, therefore it does not load by default.
Module not loaded causes it to yield a FAIL when tested by tests/test_utils.c.
This fix checks if the corresponding module is loaded at the start of the test,
and if not, it passes the test and exits with a message.

This fix is applied to all versions where the module is marked deprecated.

Change-Id: I52be64c8f6af222e15148a856d1f10cb113e1e94

tests/test_utils.c

index f5586d3f70aa1837bf3e52f53e453fdf92e2d05a..1005f2334e65d1818d41bdc84269b9c0d385249c 100644 (file)
@@ -343,6 +343,11 @@ AST_TEST_DEFINE(adsi_loaded_test)
                break;
        }
 
+       if (!ast_module_check("res_adsi.so")) {
+               ast_test_status_update(test, "This test skipped because deprecated module res_adsi.so is not built by default.\n");
+               return AST_TEST_PASS;
+       }
+
        if (!(c = ast_dummy_channel_alloc())) {
                return AST_TEST_FAIL;
        }