[Asterisk-code-review] main/test: Use ast cli completion add. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Mon Mar 19 14:19:04 CDT 2018


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/8580 )

Change subject: main/test: Use ast_cli_completion_add.
......................................................................


Patch Set 1: Code-Review-1

(8 comments)

https://gerrit.asterisk.org/#/c/8580/1/main/test.c
File main/test.c:

https://gerrit.asterisk.org/#/c/8580/1/main/test.c@696
PS1, Line 696: static char *complete_test_category(const char *word, int pos)
pos is not used


https://gerrit.asterisk.org/#/c/8580/1/main/test.c@756
PS1, Line 756: 		if (a->pos == 4) {
Test should be:
if (a->pos == 4 && !strcasecmp(a->argv[3], "category")) {
}


https://gerrit.asterisk.org/#/c/8580/1/main/test.c@763
PS1, Line 763: 			return complete_test_name(a->word, a->argv[3]);
Preexisting bug.

The index should be [4] to get the test category instead of getting the literal "category" string.


https://gerrit.asterisk.org/#/c/8580/1/main/test.c@768
PS1, Line 768: 			((a->argc == 4) && strcmp(a->argv[3], "all")) ||
             : 			((a->argc == 7) && strcmp(a->argv[5], "name"))) {
Should be using strcasecmp()


https://gerrit.asterisk.org/#/c/8580/1/main/test.c@815
PS1, Line 815: 		if (a->pos == 3) {
Test should be:
if (a->pos == 3 && !strcasecmp(a->argv[2], "category")) {
}


https://gerrit.asterisk.org/#/c/8580/1/main/test.c@831
PS1, Line 831: 		if ((a->argc == 3) && !strcmp(a->argv[2], "all")) { /* run all registered tests */
Should be using strcasecmp()


https://gerrit.asterisk.org/#/c/8580/1/main/test.c@890
PS1, Line 890: 		} else if (!strcmp(a->argv[3], "passed")) {
             : 			mode = 2;
             : 		} else if (!strcmp(a->argv[3], "failed")) {
             : 			mode = 1;
             : 		} else if (!strcmp(a->argv[3], "all")) {
Should be using strcasecmp()


https://gerrit.asterisk.org/#/c/8580/1/main/test.c@963
PS1, Line 963: 		} else if (!strcmp(a->argv[3], "xml")) {
             : 			type = "xml";
             : 			isxml = 1;
             : 		} else if (!strcmp(a->argv[3], "txt")) {
Should be using strcasecmp()



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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I5133ff2ba4e030f9733fb3d050c863d72a22ae6b
Gerrit-Change-Number: 8580
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Mon, 19 Mar 2018 19:19:04 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180319/f275ef62/attachment.html>


More information about the asterisk-code-review mailing list