[Asterisk-code-review] tests: Fix warnings found on Mac. (asterisk[master])

Joshua Colp asteriskteam at digium.com
Mon Nov 20 11:32:52 CST 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/7288 )

Change subject: tests: Fix warnings found on Mac.
......................................................................

tests: Fix warnings found on Mac.

test_pbx used raise without explicitly including signal.h.  On Mac for
some reason nothing else includes it.

test_logger checked if an unsigned int was negative.  Switch the
variable to 'int' so that error check can be effective.

Change-Id: Ie1db5dd1818ac25cc2ae41b644f848b5865b1362
---
M tests/test_logger.c
M tests/test_pbx.c
2 files changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/tests/test_logger.c b/tests/test_logger.c
index 59ee3e6..6cbddb9 100644
--- a/tests/test_logger.c
+++ b/tests/test_logger.c
@@ -190,7 +190,7 @@
 
 static char *handle_cli_queue_test(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
-	unsigned int level;
+	int level;
 	int current_queue_limit;
 	unsigned int x;
 	struct timeval start, end;
@@ -220,7 +220,7 @@
 		ast_cli(a->fd, "Test: Failed, could not register level 'queuetest'.\n");
 		return CLI_SUCCESS;
 	}
-	ast_cli(a->fd, "Test: got level %u for 'queuetest'.\n", level);
+	ast_cli(a->fd, "Test: got level %d for 'queuetest'.\n", level);
 
 	if (ast_logger_create_channel(tmppath, "queuetest") != AST_LOGGER_SUCCESS) {
 		ast_cli(a->fd, "Test: Unable to create logger channel '%s'\n", tmppath);
diff --git a/tests/test_pbx.c b/tests/test_pbx.c
index 00fa411..155bec9 100644
--- a/tests/test_pbx.c
+++ b/tests/test_pbx.c
@@ -37,6 +37,8 @@
 #include "asterisk/pbx.h"
 #include "asterisk/test.h"
 
+#include <signal.h>
+
 /*!
  * If we determine that we really need
  * to be able to register more than 10

-- 
To view, visit https://gerrit.asterisk.org/7288
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie1db5dd1818ac25cc2ae41b644f848b5865b1362
Gerrit-Change-Number: 7288
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171120/2b503622/attachment.html>


More information about the asterisk-code-review mailing list