Update single linked list tests to compile with new attributes.
This commit is contained in:
parent
33eeea878d
commit
f066310a3e
|
@ -146,7 +146,7 @@ int test_serialization() {
|
|||
value = (int*) malloc(sizeof(int));
|
||||
if (!value) {
|
||||
/* Clear the list. */
|
||||
clear_list_data_single_linked_list(&list, NULL);
|
||||
int val = clear_list_data_single_linked_list(&list, NULL); // Intentionally not handling error!
|
||||
/* Free the array. */
|
||||
free(array);
|
||||
/* Failed the test, technical reasons. */
|
||||
|
@ -155,13 +155,13 @@ int test_serialization() {
|
|||
/* Set the value. */
|
||||
*value = i;
|
||||
/* Append into the list. */
|
||||
append_node_data_single_linked_list(list, value);
|
||||
int val = append_node_data_single_linked_list(list, value);
|
||||
}
|
||||
|
||||
/* Serialize the list and check if the serialization failed. */
|
||||
if (!serialize_linked_list(list, set_array_value_index, array)) {
|
||||
/* Clear the list. */
|
||||
clear_list_data_single_linked_list(&list, NULL);
|
||||
int val = clear_list_data_single_linked_list(&list, NULL);
|
||||
/* Free the array. */
|
||||
free(array);
|
||||
/* Failed the test. */
|
||||
|
@ -172,7 +172,7 @@ int test_serialization() {
|
|||
for (i = 0; i < SERIALIZATION_TEST_LIST_LENGTH; i++) {
|
||||
if (array[i] != i) {
|
||||
/* Clear the list. */
|
||||
clear_list_data_single_linked_list(&list, NULL);
|
||||
int val = clear_list_data_single_linked_list(&list, NULL);
|
||||
/* Free the array. */
|
||||
free(array);
|
||||
/* Failed the test. */
|
||||
|
@ -182,7 +182,7 @@ int test_serialization() {
|
|||
|
||||
/* Passed the tests. */
|
||||
/* Clear the list. */
|
||||
clear_list_data_single_linked_list(&list, NULL);
|
||||
int val = clear_list_data_single_linked_list(&list, NULL);
|
||||
/* Free the array. */
|
||||
free(array);
|
||||
|
||||
|
@ -236,7 +236,7 @@ int test_linked_lists() {
|
|||
/* Test the indexer functions. */
|
||||
assert(get_node_index_pointer_single_linked_list(list, tail) == (list->length - 1));
|
||||
/* Test the freeing functions. */
|
||||
clear_list_data_single_linked_list(&list, NULL);
|
||||
int val = clear_list_data_single_linked_list(&list, NULL);
|
||||
assert(list == NULL);
|
||||
|
||||
/* Serialization test. */
|
||||
|
|
Loading…
Reference in New Issue