diff --git a/tests/graph_storage/array_sorted_list/sorted_list.c b/tests/graph_storage/array_sorted_list/sorted_list.c index 2614784..462ed80 100644 --- a/tests/graph_storage/array_sorted_list/sorted_list.c +++ b/tests/graph_storage/array_sorted_list/sorted_list.c @@ -293,12 +293,30 @@ ALL_Array_setitem(ALL_Array * self PyErr_SetString(PyExc_MemoryError, "failed to allocate new node"); return NULL; } + result = ll_insert_value(&(self->lists[j]), i); + if(result == 2) + { + PyErr_SetString(PyExc_ValueError, "element is already set"); + return NULL; + } + if(result == 1) + { + PyErr_SetString(PyExc_MemoryError, "failed to allocate new node"); + return NULL; + } Py_RETURN_NONE; } else { result = ll_delete_value(&(self->lists[i]), j); + if(result) + { + PyErr_SetString(PyExc_ValueError, "element is not set"); + return NULL; + } + result = ll_delete_value(&(self->lists[j]), i); + if(result) { PyErr_SetString(PyExc_ValueError, "element is not set");