[Home]

Summary:ASTERISK-26739: voicemail API test: confuses expected and actual values
Reporter:Tzafrir Cohen (tzafrir)Labels:
Date Opened:2017-01-20 22:54:38.000-0600Date Closed:2017-01-27 18:36:14.000-0600
Priority:TrivialRegression?
Status:Closed/CompleteComponents:Tests/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I had a voicemail test fail for me:

{code}
[test_voicemail_api.c:voicemail_api_nominal_msg_playback:1455]: Playing back message from test_vm_api_2345 to callback function with default context
[test_voicemail_api.c:voicemail_api_nominal_msg_playback:1461]: Test failed for parameter 2: Expected [3], Actual [2]
END    /main/voicemail_api/ - nominal_msg_playback Time: 96ms Result: FAIL
{code}
However, the source of the test shows:
{code}
VM_API_INT_VERIFY(test_mbox_snapshot->total_msg_num, 2);
{code}

The expected value is 3? Not 2?

Indeed, the macro up that source file:

{code}
#define VM_API_INT_VERIFY(expected, actual)
{code}

Thus I believe that most usages of that and similar macros in that file should be reversed (or change the macro. There are some correct usages of the macro).
Comments:By: Asterisk Team (asteriskteam) 2017-01-20 22:54:38.876-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Tzafrir Cohen (tzafrir) 2017-01-20 23:54:02.386-0600

Sorry, my branch was incorrectly named. The patch is at:
https://gerrit.asterisk.org/#/c/4752/

By: Rusty Newton (rnewton) 2017-01-23 08:44:25.754-0600

Remember to reference this issue in your Gerrit commit msg so that it will link up with this issue.

By: Friendly Automation (friendly-automation) 2017-01-26 16:03:43.221-0600

Change 4752 merged by George Joseph:
test_voicemail_api: order of params to VERIFY macros

[https://gerrit.asterisk.org/4752|https://gerrit.asterisk.org/4752]

By: Friendly Automation (friendly-automation) 2017-01-27 07:05:11.765-0600

Change 4775 merged by George Joseph:
test_voicemail_api: order of params to VERIFY macros

[https://gerrit.asterisk.org/4775|https://gerrit.asterisk.org/4775]

By: Friendly Automation (friendly-automation) 2017-01-27 15:53:14.286-0600

Change 4776 merged by George Joseph:
test_voicemail_api: order of params to VERIFY macros

[https://gerrit.asterisk.org/4776|https://gerrit.asterisk.org/4776]