summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-02-04 00:17:12 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-02-04 00:17:12 +0100
commit19390ab685d27f2b2c3153dd53b5661998edcfaf (patch)
tree55526002ad84678c713c0def66b7eecd411b1d12 /src/tests
parentec2f079b5bdcee15213d05bd1a81e90f9175f215 (diff)
downloadeina_graph-19390ab685d27f2b2c3153dd53b5661998edcfaf.zip
eina_graph-19390ab685d27f2b2c3153dd53b5661998edcfaf.tar.gz
implement eina_graph_bfs_shortest_path() with tests
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/eina_graph_suite.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tests/eina_graph_suite.c b/src/tests/eina_graph_suite.c
index 695e7ab..dd1d852 100644
--- a/src/tests/eina_graph_suite.c
+++ b/src/tests/eina_graph_suite.c
@@ -58,6 +58,17 @@ static void _bfs_tests(unsigned int vertices[], unsigned int n)
path = NULL;
eina_graph_bfs_free(bfs);
+ path = eina_graph_bfs_shortest_path(g, 0, 3);
+ ck_assert(path != NULL);
+ ck_assert(eina_list_count(path) == n);
+ i = 0;
+ EINA_LIST_FREE(path, data)
+ {
+ ck_assert(vertices[i] == CAST_D(data));
+ i++;
+ }
+ path = NULL;
+
eina_graph_free(g);
ck_assert(eina_graph_shutdown() == 0);