Commit a2a3413f authored by Chris Müller's avatar Chris Müller

Add testcases for append and prepend in struct CryList.

parent f6ad9619
......@@ -102,6 +102,31 @@ test_list(const_pointer data)
assert(cry_list_head(list) == 0);
assert(cry_list_tail(list) == 0);
// fill linked-lists with items
cry_list_prepend(list, items);
assert(cry_list_size(list) == 1);
assert(cry_list_head(list) == items);
assert(cry_list_tail(list) == items);
cry_list_prepend(list, items + 1);
assert(cry_list_size(list) == 2);
assert(cry_list_head(list) == items + 1);
assert(cry_list_tail(list) == items);
cry_list_append(list, items + 2);
assert(cry_list_size(list) == 3);
assert(cry_list_head(list) == items + 1);
assert(cry_list_tail(list) == items + 2);
cry_list_append(list, items + 3);
assert(cry_list_size(list) == 4);
assert(cry_list_head(list) == items + 1);
assert(cry_list_tail(list) == items + 3);
cry_list_free(list, 0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment