diff options
Diffstat (limited to 'tests/test-graph.c')
-rw-r--r-- | tests/test-graph.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test-graph.c b/tests/test-graph.c index 970801a..ab04e1c 100644 --- a/tests/test-graph.c +++ b/tests/test-graph.c @@ -152,6 +152,20 @@ test_get_num_edges (Fixture *fixture, gconstpointer data) } static void +test_get_num_successors (Fixture *fixture, gconstpointer data) +{ + g_assert (ufo_graph_get_num_successors (fixture->sequence, fixture->root) == 1); + g_assert (ufo_graph_get_num_successors (fixture->diamond, fixture->root) == 2); +} + +static void +test_get_num_predecessors (Fixture *fixture, gconstpointer data) +{ + g_assert (ufo_graph_get_num_predecessors (fixture->sequence, fixture->target1) == 1); + g_assert (ufo_graph_get_num_predecessors (fixture->diamond, fixture->target3) == 2); +} + +static void test_get_edges (Fixture *fixture, gconstpointer data) { GList *edges; @@ -335,10 +349,18 @@ test_add_graph (void) Fixture, NULL, fixture_setup, test_get_successors, fixture_teardown); + g_test_add ("/graph/nodes/successors/num", + Fixture, NULL, + fixture_setup, test_get_num_successors, fixture_teardown); + g_test_add ("/graph/nodes/predecessors", Fixture, NULL, fixture_setup, test_get_predecessors, fixture_teardown); + g_test_add ("/graph/nodes/predecessors/num", + Fixture, NULL, + fixture_setup, test_get_num_predecessors, fixture_teardown); + g_test_add ("/graph/nodes/filtered", Fixture, NULL, fixture_setup, test_get_nodes_filtered, fixture_teardown); |