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));
|
value = (int*) malloc(sizeof(int));
|
||||||
if (!value) {
|
if (!value) {
|
||||||
/* Clear the list. */
|
/* 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 the array. */
|
||||||
free(array);
|
free(array);
|
||||||
/* Failed the test, technical reasons. */
|
/* Failed the test, technical reasons. */
|
||||||
|
@ -155,13 +155,13 @@ int test_serialization() {
|
||||||
/* Set the value. */
|
/* Set the value. */
|
||||||
*value = i;
|
*value = i;
|
||||||
/* Append into the list. */
|
/* 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. */
|
/* Serialize the list and check if the serialization failed. */
|
||||||
if (!serialize_linked_list(list, set_array_value_index, array)) {
|
if (!serialize_linked_list(list, set_array_value_index, array)) {
|
||||||
/* Clear the list. */
|
/* 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 the array. */
|
||||||
free(array);
|
free(array);
|
||||||
/* Failed the test. */
|
/* Failed the test. */
|
||||||
|
@ -172,7 +172,7 @@ int test_serialization() {
|
||||||
for (i = 0; i < SERIALIZATION_TEST_LIST_LENGTH; i++) {
|
for (i = 0; i < SERIALIZATION_TEST_LIST_LENGTH; i++) {
|
||||||
if (array[i] != i) {
|
if (array[i] != i) {
|
||||||
/* Clear the list. */
|
/* 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 the array. */
|
||||||
free(array);
|
free(array);
|
||||||
/* Failed the test. */
|
/* Failed the test. */
|
||||||
|
@ -182,7 +182,7 @@ int test_serialization() {
|
||||||
|
|
||||||
/* Passed the tests. */
|
/* Passed the tests. */
|
||||||
/* Clear the list. */
|
/* 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 the array. */
|
||||||
free(array);
|
free(array);
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ int test_linked_lists() {
|
||||||
/* Test the indexer functions. */
|
/* Test the indexer functions. */
|
||||||
assert(get_node_index_pointer_single_linked_list(list, tail) == (list->length - 1));
|
assert(get_node_index_pointer_single_linked_list(list, tail) == (list->length - 1));
|
||||||
/* Test the freeing functions. */
|
/* 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);
|
assert(list == NULL);
|
||||||
|
|
||||||
/* Serialization test. */
|
/* Serialization test. */
|
||||||
|
|
Loading…
Reference in New Issue