[asterisk-dev] [Code Review] Doubly linked lists unit test and update to implementation.

mjordan reviewboard at asterisk.org
Wed Nov 23 11:57:39 CST 2011


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



/trunk/tests/test_linkedlists.c
<https://reviewboard.asterisk.org/r/1569/#comment9051>

    Very often, it is useful to break functional tests up into multiple units tests.
    
    1) It can be easier to maintain
    2) When a test fails, its easier to isolate what broke
    3) Its very clear as to what the beginning / ending conditions are for a test
    
    That being said, I wouldn't say that *has* to be done here, since you do have things well sectioned off.  If we need to add a bunch more tests that could change, but I'll leave it up to you



/trunk/tests/test_linkedlists.c
<https://reviewboard.asterisk.org/r/1569/#comment9058>

    What is the expected behavior if you attempt to insert a NULL item?  Is that handled by the list (if so, we should test for it), or do we expect that to error out when attempting to access the item later?



/trunk/tests/test_linkedlists.c
<https://reviewboard.asterisk.org/r/1569/#comment9052>

    Add comment that you're testing empty list



/trunk/tests/test_linkedlists.c
<https://reviewboard.asterisk.org/r/1569/#comment9053>

    Add comment that you're testing inserting from the tail and removing specific items



/trunk/tests/test_linkedlists.c
<https://reviewboard.asterisk.org/r/1569/#comment9054>

    Add comment that you're testing insertion / removal in relation to other items (or something like that)



/trunk/tests/test_linkedlists.c
<https://reviewboard.asterisk.org/r/1569/#comment9056>

    List append test



/trunk/tests/test_linkedlists.c
<https://reviewboard.asterisk.org/r/1569/#comment9057>

    I'd say this is traversal and modification - which is a bit different then just testing that you iterate across the elements correctly


- mjordan


On Nov. 5, 2011, 5:32 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1569/
> -----------------------------------------------------------
> 
> (Updated Nov. 5, 2011, 5:32 p.m.)
> 
> 
> Review request for Asterisk Developers and Terry Wilson.
> 
> 
> Summary
> -------
> 
> Update the doubly linked list implementation.  Now safe traversing can insert before and after the current node when traversing in either direction.
> 
> Updated the linked lists unit test test_linkedlist to also test doubly linked lists.  The old test_dlinkedlist requires a manual check of results and probably should be removed.
> 
> Asterisk currently only uses a small subset of the doubly linked lists macro implementation.  It only uses doubly linked lists for the event subscriptions module.
> 
> 
> Diffs
> -----
> 
>   /trunk/tests/test_linkedlists.c 343488 
>   /trunk/include/asterisk/dlinkedlists.h 343488 
> 
> Diff: https://reviewboard.asterisk.org/r/1569/diff
> 
> 
> Testing
> -------
> 
> Old and new unit tests pass.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

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


More information about the asterisk-dev mailing list