diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2012-08-22 16:50:44 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2012-08-22 16:50:44 +0200 |
commit | 4a2646a4d554d7741a0bd4da6fe3003291ac2693 (patch) | |
tree | 16d63469c8e752c7af59950546e5f8cdde327c2a /tests/test-graph.c | |
parent | cf14364fce31fcedd4bb1224a1d2a1ce28938e5b (diff) |
Let the scheduler execute the graph not vice versa
Up to now, the UfoGraph object had a method `run' which was used to start the
computation. Internally this object created a scheduler object and passed the
list of filters to it. However, in reality the graph does not need to know
anything about executing as it is purely a representation of data flow.
Hence, the UfoBaseScheduler now has a `run' method that takes two arguments, a
UfoGraph object and a GError location. Moreover, UfoGraph does not have a
"configuration" property anymore as it does not query path information.
Diffstat (limited to 'tests/test-graph.c')
-rw-r--r-- | tests/test-graph.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test-graph.c b/tests/test-graph.c index 1f8b976..2dbdf7f 100644 --- a/tests/test-graph.c +++ b/tests/test-graph.c @@ -37,7 +37,7 @@ fixture_json_setup (Fixture *fixture, gconstpointer data) static const gchar *invalid_json = "{\"nodes:[]}"; /* missing " */ static const gchar *empty_json = "{\"nodes\": [{}]}"; - fixture->graph = ufo_graph_new (NULL, NULL); + fixture->graph = ufo_graph_new (); g_assert (UFO_IS_GRAPH (fixture->graph)); fixture->manager = ufo_plugin_manager_new (NULL); @@ -70,15 +70,22 @@ fixture_json_teardown (Fixture *fixture, gconstpointer data) static void fixture_filter_setup (Fixture *fixture, gconstpointer data) { + UfoInputParameter input_params[] = {{2, UFO_FILTER_INFINITE_INPUT}}; + UfoOutputParameter output_params[] = {{2}}; + GError *error = NULL; - fixture->graph = ufo_graph_new (NULL, NULL); + fixture->graph = ufo_graph_new (); g_assert (UFO_IS_GRAPH (fixture->graph)); fixture->source = UFO_FILTER (g_object_new (UFO_TYPE_FILTER, NULL)); fixture->sink1 = UFO_FILTER (g_object_new (UFO_TYPE_FILTER, NULL)); fixture->sink2 = UFO_FILTER (g_object_new (UFO_TYPE_FILTER, NULL)); + ufo_filter_register_outputs (fixture->source, 1, output_params); + ufo_filter_register_inputs (fixture->sink1, 1, input_params); + ufo_filter_register_inputs (fixture->sink2, 1, input_params); + ufo_graph_connect_filters (fixture->graph, fixture->source, fixture->sink1, &error); g_assert_no_error (error); |