[Asterisk-code-review] test_utils.c: Skip test adsi_loaded_test if module not loaded. (...asterisk[16])

Friendly Automation asteriskteam at digium.com
Tue Sep 10 08:37:09 CDT 2019


Friendly Automation has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/12829 )

Change subject: test_utils.c: Skip test adsi_loaded_test if module not loaded.
......................................................................

test_utils.c: Skip test adsi_loaded_test if module not loaded.

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
---
M tests/test_utils.c
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/tests/test_utils.c b/tests/test_utils.c
index f5586d3..1005f23 100644
--- a/tests/test_utils.c
+++ b/tests/test_utils.c
@@ -343,6 +343,11 @@
 		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;
 	}

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/12829
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I52be64c8f6af222e15148a856d1f10cb113e1e94
Gerrit-Change-Number: 12829
Gerrit-PatchSet: 1
Gerrit-Owner: Christian Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190910/24173891/attachment.html>


More information about the asterisk-code-review mailing list