[asterisk-dev] [Code Review] 2669: Fixed intermittent crash when loading test_json.so

David Lee reviewboard at asterisk.org
Thu Jul 11 10:18:23 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2669/
-----------------------------------------------------------

(Updated July 11, 2013, 10:18 a.m.)


Review request for Asterisk Developers.


Changes
-------

Removed intentional test failure.

Oops.


Bugs: ASTERISK-21978
    https://issues.asterisk.org/jira/browse/ASTERISK-21978


Repository: Asterisk


Description
-------

The JSON test attempted an overly clever use of RAII_VAR to run code
at the beginning and end of each test, in order to validate that no
JSON objects were leaked during the test.

The problem is that the validation code would run during the initial
load, when the tests were initialized. This happens during startup,
when other parts of the system might actively be allocating and
freeing JSON objects.

This patch changes the RAII_VAR to use the new
ast_test_register_{init,cleanup} functions to run the validations
properly.


Diffs (updated)
-----

  /trunk/tests/test_json.c 394078 

Diff: https://reviewboard.asterisk.org/r/2669/diff/


Testing
-------

Tests pass; used debug log to verify that _init and _cleanup ran on
each test.


Thanks,

David Lee

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130711/06bd8fed/attachment.htm>


More information about the asterisk-dev mailing list