From ca479bd5960da08f5b6890eddfc94e0bd3fef1e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kn=C3=BCttel?= Date: Fri, 22 Nov 2019 17:26:14 +0100 Subject: [PATCH] updated the graph storage c module --- .../array_sorted_list/sorted_list.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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");