mirror of
https://github.com/bkthomps/Containers.git
synced 2025-12-26 17:19:01 +00:00
Add more testing (#23)
Increase code coverage so that other than the out-of-memory conditions, the code is entirely covered. Some areas of the code have been tweaked for performance optimizations. Bug fix! A bug has been identified and fixed in the unordered_multiset data structure in the unordered_multiset_remove_all function. This bug would occur when more than one entry exists in the bucket in which the element is occupying, and that element had a count of more than one.
This commit is contained in:
@@ -55,11 +55,16 @@ bool stub_priority_queue_pop(void *const data, priority_queue me)
|
||||
|
||||
void test_priority_queue(void)
|
||||
{
|
||||
assert(!priority_queue_init(0, compare_int));
|
||||
assert(!priority_queue_init(sizeof(int), NULL));
|
||||
priority_queue me = priority_queue_init(sizeof(int), compare_int);
|
||||
assert(me);
|
||||
assert(priority_queue_size(me) == 0);
|
||||
assert(priority_queue_is_empty(me));
|
||||
int item = 5;
|
||||
int item = 0xdeadbeef;
|
||||
assert(!priority_queue_pop(&item, me));
|
||||
assert(item == 0xdeadbeef);
|
||||
item = 5;
|
||||
stub_priority_queue_push(me, &item);
|
||||
item = 2;
|
||||
stub_priority_queue_push(me, &item);
|
||||
|
||||
Reference in New Issue
Block a user