![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Test program to check various functionality in FixedLengthList (see http://mbed.org/users/johnb/code/FixedLengthList/ )
Dependencies: FixedLengthList mbed
Test code for FixedLengthList class
Diff: main.cpp
- Revision:
- 3:5480dece8fa5
- Parent:
- 2:e00ea5f2e80c
--- a/main.cpp Sun Jan 19 13:28:52 2014 +0000 +++ b/main.cpp Wed Jan 29 23:01:16 2014 +0000 @@ -4,7 +4,7 @@ @author John Bailey - @copyright Copyright 2013 John Bailey + @copyright Copyright 2014 John Bailey @section LICENSE @@ -143,6 +143,12 @@ CHECK( list2.queue( 254 ) == false, "queue() on a full list" ); check_iterators(); + + CHECK( list2.remove( 255 ) == false, "remove() a non-existant item" ); + CHECK( list2.available() == 0, "available() having tried to remove non-existent item from full list" ); + CHECK( list2.remove( 243 ) == true, "remove() a valid item" ); + CHECK( list2.available() == 1, "available() having removed item from full list" ); + CHECK( list2.inList( 243 ) == false, "inList() for item which was just remove()d" ); PRINTF("FixedLengthList test - Done\n"); @@ -166,4 +172,4 @@ CHECK( it != ilist.begin(), "iterators: operator!=" ); CHECK( it == ilist.end(), "iterators: operator==" ); -} \ No newline at end of file +}