[Asterisk-code-review] strings/json: Add string delimter match, and object create with vars ... (asterisk[16])

George Joseph asteriskteam at digium.com
Mon Oct 25 07:20:11 CDT 2021


Attention is currently required from: Kevin Harwell, Benjamin Keith Ford.
George Joseph has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16642 )

Change subject: strings/json: Add string delimter match, and object create with vars methods
......................................................................


Patch Set 2: Code-Review-1

(4 comments)

File include/asterisk/json.h:

https://gerrit.asterisk.org/c/asterisk/+/16642/comment/f3ddcae6_0f393cff 
PS1, Line 585:  * \brief Get an integer field from a JSON object.
             :  * \param integer JSON integer.
             :  * \return Value of a JSON integer.
             :  * \return 0 if \a integer is not a JSON integer.
> Not sure really. I personally don't, so left it out. […]
I'd skip it.


File main/strings.c:

https://gerrit.asterisk.org/c/asterisk/+/16642/comment/79c65970_4507e93f 
PS2, Line 444: 
This function doesn't handle "abc, def, ghi" (with the spaces after the commas.
If you add
haystack = ast_skip_blanks(haystack);
here and...


https://gerrit.asterisk.org/c/asterisk/+/16642/comment/8a3a43b3_dd428dca 
PS2, Line 451: 		haystack = end + 1;
change this to 
haystack = ast_skip_blanks(ewnd + 1);
it should work fine.


File tests/test_strings.c:

https://gerrit.asterisk.org/c/asterisk/+/16642/comment/c0852f07_2543d12d 
PS2, Line 696: 
I'd add tests with at least 3 items in the haystack so you can test front, middle and end.
And at least one with spaces of course. 😊



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16642
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I5f34f18e102126aef3997f19a553a266d70d6226
Gerrit-Change-Number: 16642
Gerrit-PatchSet: 2
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-CC: Benjamin Keith Ford <bford at digium.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: Benjamin Keith Ford <bford at digium.com>
Gerrit-Comment-Date: Mon, 25 Oct 2021 12:20:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Kevin Harwell <kharwell at digium.com>
Comment-In-Reply-To: Benjamin Keith Ford <bford at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20211025/7cfedc72/attachment.html>


More information about the asterisk-code-review mailing list