[Asterisk-code-review] test data buffer.c: Add unit tests for data buffer API. (asterisk[15])

George Joseph asteriskteam at digium.com
Tue Mar 20 13:38:28 CDT 2018


George Joseph has posted comments on this change. ( https://gerrit.asterisk.org/8605 )

Change subject: test_data_buffer.c: Add unit tests for data buffer API.
......................................................................


Patch Set 4: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/8605/4/tests/test_data_buffer.c
File tests/test_data_buffer.c:

https://gerrit.asterisk.org/#/c/8605/4/tests/test_data_buffer.c@71
PS4, Line 71: 	if (!buffer) {
            : 		ast_test_status_update(test, "Failed to create buffer with valid arguments");
            : 		return AST_TEST_FAIL;
            : 	}
You can replace this whole block with...
ast_test_validate(test, buffer != NULL, "Failed to create buffer with valid arguments");

This does the test and if it fails, automatically prints the error message and returns AST_TEST_FAIL.  The RAII_VAR takes care of the cleanup.



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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: comment
Gerrit-Change-Id: Id5b599aa15a5e61d0ec080f97cd0c57bd07e6f8f
Gerrit-Change-Number: 8605
Gerrit-PatchSet: 4
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Comment-Date: Tue, 20 Mar 2018 18:38:28 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180320/03bab251/attachment.html>


More information about the asterisk-code-review mailing list