]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
tests: Fix warnings found on Mac.
authorCorey Farrell <git@cfware.com>
Sun, 19 Nov 2017 03:13:32 +0000 (22:13 -0500)
committerJoshua Colp <jcolp@digium.com>
Thu, 30 Nov 2017 17:44:54 +0000 (11:44 -0600)
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
(cherry picked from commit 5fe2e7bfdcd06935594823faba67c71ead7ebcf5)

tests/test_logger.c
tests/test_pbx.c

index bf809ba54f3c383eb08bc5f16018ea345ef8af2f..08585a6b8f1059541114732e0163bf0b05921ae8 100644 (file)
@@ -192,7 +192,7 @@ static char *handle_cli_performance_test(struct ast_cli_entry *e, int cmd, struc
 
 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;
@@ -222,7 +222,7 @@ static char *handle_cli_queue_test(struct ast_cli_entry *e, int cmd, struct ast_
                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);
index acf7484c104dd237a9c1c98da2f6ba3de80763d7..df6b88dc81e04c007a1c6694c4e9e60039e551cb 100644 (file)
@@ -39,6 +39,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #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