|
@@ -64,7 +64,7 @@ spec("data") { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
it("removes all nodes from the list") { |
|
|
it("removes all nodes from the list") { |
|
|
mock_set_expected_calls(IZ_free, 4); |
|
|
|
|
|
|
|
|
mock_set_expected_calls(IZ_free, 3); |
|
|
IZ_ListTeardown(&list); |
|
|
IZ_ListTeardown(&list); |
|
|
unsigned int expected_calls = mock_get_expected_calls(IZ_free); |
|
|
unsigned int expected_calls = mock_get_expected_calls(IZ_free); |
|
|
unsigned int actual_calls = mock_get_actual_calls(IZ_free); |
|
|
unsigned int actual_calls = mock_get_actual_calls(IZ_free); |
|
@@ -87,14 +87,13 @@ spec("data") { |
|
|
before_each() { |
|
|
before_each() { |
|
|
IZ_ListInitialize(&list2); |
|
|
IZ_ListInitialize(&list2); |
|
|
static u64 existing_value = 69420u; |
|
|
static u64 existing_value = 69420u; |
|
|
static IZ_ListNode existing_node = { |
|
|
|
|
|
.list = NULL, |
|
|
|
|
|
.previous = NULL, |
|
|
|
|
|
.value = &existing_value, |
|
|
|
|
|
.next = NULL, |
|
|
|
|
|
}; |
|
|
|
|
|
list2.root = &existing_node; |
|
|
|
|
|
existing_node.list = &list2; |
|
|
|
|
|
|
|
|
static IZ_ListNode* existing_node; |
|
|
|
|
|
existing_node = IZ_malloc(sizeof(IZ_ListNode)); |
|
|
|
|
|
existing_node->list = &list2; |
|
|
|
|
|
existing_node->previous = NULL; |
|
|
|
|
|
existing_node->value = &existing_value; |
|
|
|
|
|
existing_node->next = NULL; |
|
|
|
|
|
list2.root = existing_node; |
|
|
list2.length = 1; |
|
|
list2.length = 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|