From 4a2646a4d554d7741a0bd4da6fe3003291ac2693 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 22 Aug 2012 16:50:44 +0200 Subject: 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. --- tests/test-graph.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests/test-graph.c') 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); -- cgit v1.2.3