From e15eeeaaf88ac81cf3636a3f79299fa6ec1dc2dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 4 Feb 2014 00:10:16 +0100 Subject: free Eina_Lists in tests --- src/tests/eina_graph_suite.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tests/eina_graph_suite.c b/src/tests/eina_graph_suite.c index c866b36..695e7ab 100644 --- a/src/tests/eina_graph_suite.c +++ b/src/tests/eina_graph_suite.c @@ -28,7 +28,7 @@ static void _bfs_tests(unsigned int vertices[], unsigned int n) { Eina_Graph *g; Eina_Graph_BFS *bfs; - Eina_List *path, *l; + Eina_List *path; void *data; int i; @@ -50,11 +50,12 @@ static void _bfs_tests(unsigned int vertices[], unsigned int n) ck_assert(path != NULL); ck_assert(eina_list_count(path) == n); i = 0; - EINA_LIST_FOREACH(path, l, data) + EINA_LIST_FREE(path, data) { ck_assert(vertices[i] == CAST_D(data)); i++; } + path = NULL; eina_graph_bfs_free(bfs); eina_graph_free(g); @@ -73,7 +74,7 @@ static void _dfs_tests(Eina_Bool r, unsigned int vertices[], unsigned int n) { Eina_Graph *g; Eina_Graph_DFS *dfs; - Eina_List *path, *l; + Eina_List *path; void *data; int i; @@ -93,11 +94,12 @@ static void _dfs_tests(Eina_Bool r, unsigned int vertices[], unsigned int n) ck_assert(path != NULL); ck_assert(eina_list_count(path) == n); i = 0; - EINA_LIST_FOREACH(path, l, data) + EINA_LIST_FREE(path, data) { ck_assert(vertices[i] == CAST_D(data)); i++; } + path = NULL; eina_graph_dfs_free(dfs); eina_graph_free(g); -- cgit v1.1-2-g2b99