[asterisk-dev] [Code Review] Fix range checking with ast_parse_arg numeric types and add tests
Terry Wilson
reviewboard at asterisk.org
Tue Apr 24 18:10:29 CDT 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1879/
-----------------------------------------------------------
(Updated April 24, 2012, 6:10 p.m.)
Review request for Asterisk Developers.
Changes
-------
Attempts to address mmichelson's concerns about double comparison.
Summary
-------
I started out by writing unit tests for ast_parse_arg and found out that it didn't actually catch errors where the string parsed resulted in an overflow of the type. So this patch adds the tests and fixes the errors that the test found. I started writing tests for the PARSE_ADDR type, but it really is just a very simple wrapper around ast_sockaddr_parse() which is tested in the netsock2 tests. Since it didn't really seem like there was a benefit to testing it twice, I didn't include tests for that.
Diffs (updated)
-----
/branches/1.8/main/config.c 362634
/branches/1.8/tests/test_config.c PRE-CREATION
Diff: https://reviewboard.asterisk.org/r/1879/diff
Testing
-------
Wrote a test that now passes.
Thanks,
Terry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120424/423a70ae/attachment-0001.htm>
More information about the asterisk-dev
mailing list