diff options
author | alecdavis <alecdavis@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-28 16:36:45 +0000 |
---|---|---|
committer | alecdavis <alecdavis@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-02-28 16:36:45 +0000 |
commit | a55aaaea71ec1dc9455d5dd1a078bca201ca5450 (patch) | |
tree | 257949ddc15a604276f8c856b67d733c8d3a5281 /apps/app_voicemail.c | |
parent | 9d853ef8c0f8d27f177eb51efee0d57b149ecd54 (diff) |
make unit test check for NULL folder, which then defaults to INBOX
previous test, gave false level of assurance that code was healthy.
(issue #16927)
Reported by: alecdavis
Patches:
based on app_voicemail_test.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@249449 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 089a63a16..f1bf4b866 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -11682,7 +11682,8 @@ AST_TEST_DEFINE(test_voicemail_msgcount) /* hasvm-old, hasvm-urgent, hasvm-new, ic-old, ic-urgent, ic-new, ic2-old, ic2-urgent, ic2-new, mc-old, mc-urgent, mc-new */ for (j = 0; j < 3; j++) { - if (ast_app_has_voicemail(testspec, folders[j]) != expected_results[i][0 + j]) { + /* folder[2] is INBOX, __has_voicemail will default back to INBOX */ + if (ast_app_has_voicemail(testspec, (j==2 ? NULL : folders[j])) != expected_results[i][0 + j]) { ast_test_status_update(test, "has_voicemail(%s, %s) returned %d and we expected %d\n", testspec, folders[j], ast_app_has_voicemail(testspec, folders[j]), expected_results[i][0 + j]); res = AST_TEST_FAIL; |