summaryrefslogtreecommitdiffstats
path: root/src/tests/eina_graph_suite.c
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-02-04 00:10:16 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-02-04 00:10:16 +0100
commite15eeeaaf88ac81cf3636a3f79299fa6ec1dc2dd (patch)
treedb2520e0bbd8d89688cd4919aa2d60bee104bc2e /src/tests/eina_graph_suite.c
parent77f3f35cefd06ea27a403830d129a523fa1aa3cb (diff)
downloadeina_graph-e15eeeaaf88ac81cf3636a3f79299fa6ec1dc2dd.zip
eina_graph-e15eeeaaf88ac81cf3636a3f79299fa6ec1dc2dd.tar.gz
free Eina_Lists in tests
Diffstat (limited to 'src/tests/eina_graph_suite.c')
-rw-r--r--src/tests/eina_graph_suite.c10
1 files 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);