summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-05-14 15:02:24 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-05-14 15:02:24 +0200
commit56b8a477508ed223fe22205611f7dfe31591ee84 (patch)
tree1eb6855720dc824684c821d1a1730152728a7c96 /tests
parent28af38156f6a56be71666b68ae59afb66b787107 (diff)
Add method to get the number of pre-/successors
Diffstat (limited to 'tests')
-rw-r--r--tests/test-graph.c22
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);