1
0
Fork 0

Update single linked list tests to compile with new attributes.

This commit is contained in:
Wael Karram 2024-02-18 22:39:46 +02:00
parent 33eeea878d
commit f066310a3e
Signed by: wael
GPG Key ID: 3B356038CCB10808
1 changed files with 6 additions and 6 deletions

View File

@ -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. */