lib: set component's initial log level when adding it to the graph
[babeltrace.git] / tests / lib / test_graph_topo.c
index cf73109a356a74d653cb6a2fcc7fdb4c190fb89b..0a3111cdfeecbfa4f10167a8b02057e1b3c9de4a 100644 (file)
@@ -17,8 +17,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <babeltrace/babeltrace.h>
-#include <babeltrace/assert-internal.h>
+#include <babeltrace2/babeltrace.h>
+#include "common/assert.h"
 #include <stdlib.h>
 #include <string.h>
 #include <stdbool.h>
@@ -418,8 +418,9 @@ bt_self_component_status sink_consume(
 }
 
 static
-void graph_src_output_port_added(const bt_component_source *comp,
-               const bt_port_output *port, void *data)
+bt_graph_listener_status graph_src_output_port_added(
+               const bt_component_source *comp, const bt_port_output *port,
+               void *data)
 {
        struct event event = {
                .type = GRAPH_SRC_OUTPUT_PORT_ADDED,
@@ -430,11 +431,14 @@ void graph_src_output_port_added(const bt_component_source *comp,
        };
 
        append_event(&event);
+
+       return BT_GRAPH_LISTENER_STATUS_OK;
 }
 
 static
-void graph_sink_input_port_added(const bt_component_sink *comp,
-               const bt_port_input *port, void *data)
+bt_graph_listener_status graph_sink_input_port_added(
+               const bt_component_sink *comp, const bt_port_input *port,
+               void *data)
 {
        struct event event = {
                .type = GRAPH_SINK_INPUT_PORT_ADDED,
@@ -445,10 +449,13 @@ void graph_sink_input_port_added(const bt_component_sink *comp,
        };
 
        append_event(&event);
+
+       return BT_GRAPH_LISTENER_STATUS_OK;
 }
 
 static
-void graph_src_sink_ports_connected(const bt_component_source *upstream_comp,
+bt_graph_listener_status graph_src_sink_ports_connected(
+               const bt_component_source *upstream_comp,
                const bt_component_sink *downstream_comp,
                const bt_port_output *upstream_port,
                const bt_port_input *downstream_port, void *data)
@@ -468,6 +475,8 @@ void graph_src_sink_ports_connected(const bt_component_source *upstream_comp,
        };
 
        append_event(&event);
+
+       return BT_GRAPH_LISTENER_STATUS_OK;
 }
 
 static
@@ -518,7 +527,7 @@ const bt_component_source *create_src(bt_graph *graph)
        int ret;
 
        ret = bt_graph_add_source_component(graph, src_comp_class,
-               "src-comp", NULL, &comp);
+               "src-comp", NULL, BT_LOGGING_LEVEL_NONE, &comp);
        BT_ASSERT(ret == 0);
        return comp;
 }
@@ -530,7 +539,7 @@ const bt_component_sink *create_sink(bt_graph *graph)
        int ret;
 
        ret = bt_graph_add_sink_component(graph, sink_comp_class,
-               "sink-comp", NULL, &comp);
+               "sink-comp", NULL, BT_LOGGING_LEVEL_NONE, &comp);
        BT_ASSERT(ret == 0);
        return comp;
 }
This page took 0.027136 seconds and 4 git commands to generate.