summaryrefslogtreecommitdiff
path: root/tests/test_voicemail_api.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-07-17 22:30:28 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-07-17 22:30:28 +0000
commit40ce5e0d18520cd7a440cd8849e3e920be68f471 (patch)
tree5499af489ac45954318119e4294811be3da06dff /tests/test_voicemail_api.c
parentda1902cdc060763a712bb1586cfca5ec1e9a2c49 (diff)
Change ast_hangup() to return void and be NULL safe.
Since ast_hangup() is effectively a channel destructor, it should be a void function. * Make the few silly callers checking the return value no longer do so. Only the CDR and CEL unit tests checked the return value. * Make all callers take advantage of the NULL safe change and remove the NULL check before the call. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'tests/test_voicemail_api.c')
-rw-r--r--tests/test_voicemail_api.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/test_voicemail_api.c b/tests/test_voicemail_api.c
index 30f6f11e0..a0dc2400b 100644
--- a/tests/test_voicemail_api.c
+++ b/tests/test_voicemail_api.c
@@ -229,9 +229,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define VM_API_PLAYBACK_MESSAGE(channel, mailbox, context, folder, message, callback_fn) do { \
if (ast_vm_msg_play((channel), (mailbox), (context), (folder), (message), (callback_fn))) { \
ast_test_status_update(test, "Failed nominal playback message test\n"); \
- if (test_channel) { \
- ast_hangup(test_channel); \
- } \
+ ast_hangup(test_channel); \
VM_API_TEST_CLEANUP; \
return AST_TEST_FAIL; \
} } while (0)
@@ -241,9 +239,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define VM_API_PLAYBACK_MESSAGE_OFF_NOMINAL(channel, mailbox, context, folder, message, callback_fn) do { \
if (!ast_vm_msg_play((channel), (mailbox), (context), (folder), (message), (callback_fn))) { \
ast_test_status_update(test, "Succeeded in playing back of message when expected result was to fail\n"); \
- if (test_channel) { \
- ast_hangup(test_channel); \
- } \
+ ast_hangup(test_channel); \
VM_API_TEST_CLEANUP; \
return AST_TEST_FAIL; \
} } while (0)
@@ -1322,9 +1318,7 @@ AST_TEST_DEFINE(voicemail_api_nominal_msg_playback)
VM_API_INT_VERIFY(test_mbox_snapshot->total_msg_num, 2);
test_mbox_snapshot = ast_vm_mailbox_snapshot_destroy(test_mbox_snapshot);
- if (test_channel) {
- ast_hangup(test_channel);
- }
+ ast_hangup(test_channel);
VM_API_TEST_CLEANUP;
return AST_TEST_PASS;
@@ -1382,9 +1376,7 @@ AST_TEST_DEFINE(voicemail_api_off_nominal_msg_playback)
ast_test_status_update(test, "Playing back message with NULL message specifier\n");
VM_API_PLAYBACK_MESSAGE_OFF_NOMINAL(test_channel, "test_vm_api_1234", "default", "INBOX", NULL, NULL);
- if (test_channel) {
- ast_hangup(test_channel);
- }
+ ast_hangup(test_channel);
VM_API_TEST_CLEANUP;
return AST_TEST_PASS;