lib: bt_graph_create(): accept MIP version
[babeltrace.git] / tests / lib / test_graph_topo.c
index e0ea4258158c143a82dd6b44183e950f9eb8c5e9..ae2da5aa72437074516ab215574ade6723de7734 100644 (file)
@@ -219,16 +219,16 @@ size_t event_pos(struct event *event)
 }
 
 static
-bt_self_message_iterator_status src_iter_next(
+bt_component_class_message_iterator_next_method_status src_iter_next(
                bt_self_message_iterator *self_iterator,
                bt_message_array_const msgs, uint64_t capacity,
                uint64_t *count)
 {
-       return BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
+       return BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_ERROR;
 }
 
 static
-bt_self_component_status src_output_port_connected(
+bt_component_class_port_connected_method_status src_output_port_connected(
                bt_self_component_source *self_comp,
                bt_self_component_port_output *self_comp_port,
                const bt_port_input *other_port)
@@ -256,16 +256,16 @@ bt_self_component_status src_output_port_connected(
                BT_ASSERT(ret == 0);
                break;
        case TEST_SRC_PORT_CONNECTED_ERROR:
-               return BT_SELF_COMPONENT_STATUS_ERROR;
+               return BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR;
        default:
                break;
        }
 
-       return BT_SELF_COMPONENT_STATUS_OK;
+       return BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK;
 }
 
 static
-bt_self_component_status sink_input_port_connected(
+bt_component_class_port_connected_method_status sink_input_port_connected(
                bt_self_component_sink *self_comp,
                bt_self_component_port_input *self_comp_port,
                const bt_port_output *other_port)
@@ -286,14 +286,14 @@ bt_self_component_status sink_input_port_connected(
        append_event(&event);
 
        if (current_test == TEST_SINK_PORT_CONNECTED_ERROR) {
-               return BT_SELF_COMPONENT_STATUS_ERROR;
+               return BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR;
        } else {
-               return BT_SELF_COMPONENT_STATUS_OK;
+               return BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK;
        }
 }
 
 static
-bt_self_component_status src_init(
+bt_component_class_init_method_status src_init(
        bt_self_component_source *self_comp,
        const bt_value *params, void *init_method_data)
 {
@@ -302,11 +302,11 @@ bt_self_component_status src_init(
        ret = bt_self_component_source_add_output_port(
                self_comp, "out", NULL, NULL);
        BT_ASSERT(ret == 0);
-       return BT_SELF_COMPONENT_STATUS_OK;
+       return BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK;
 }
 
 static
-bt_self_component_status sink_init(
+bt_component_class_init_method_status sink_init(
        bt_self_component_sink *self_comp,
        const bt_value *params, void *init_method_data)
 {
@@ -315,18 +315,18 @@ bt_self_component_status sink_init(
        ret = bt_self_component_sink_add_input_port(self_comp,
                "in", NULL, NULL);
        BT_ASSERT(ret == 0);
-       return BT_SELF_COMPONENT_STATUS_OK;
+       return BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK;
 }
 
 static
-bt_self_component_status sink_consume(
+bt_component_class_sink_consume_method_status sink_consume(
                bt_self_component_sink *self_comp)
 {
-       return BT_SELF_COMPONENT_STATUS_OK;
+       return BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK;
 }
 
 static
-bt_graph_listener_status graph_src_output_port_added(
+bt_graph_listener_func_status graph_src_output_port_added(
                const bt_component_source *comp, const bt_port_output *port,
                void *data)
 {
@@ -340,11 +340,11 @@ bt_graph_listener_status graph_src_output_port_added(
 
        append_event(&event);
 
-       return BT_GRAPH_LISTENER_STATUS_OK;
+       return BT_GRAPH_LISTENER_FUNC_STATUS_OK;
 }
 
 static
-bt_graph_listener_status graph_sink_input_port_added(
+bt_graph_listener_func_status graph_sink_input_port_added(
                const bt_component_sink *comp, const bt_port_input *port,
                void *data)
 {
@@ -358,11 +358,11 @@ bt_graph_listener_status graph_sink_input_port_added(
 
        append_event(&event);
 
-       return BT_GRAPH_LISTENER_STATUS_OK;
+       return BT_GRAPH_LISTENER_FUNC_STATUS_OK;
 }
 
 static
-bt_graph_listener_status graph_src_sink_ports_connected(
+bt_graph_listener_func_status graph_src_sink_ports_connected(
                const bt_component_source *upstream_comp,
                const bt_component_sink *downstream_comp,
                const bt_port_output *upstream_port,
@@ -384,7 +384,7 @@ bt_graph_listener_status graph_src_sink_ports_connected(
 
        append_event(&event);
 
-       return BT_GRAPH_LISTENER_STATUS_OK;
+       return BT_GRAPH_LISTENER_FUNC_STATUS_OK;
 }
 
 static
@@ -449,7 +449,7 @@ const bt_component_sink *create_sink(bt_graph *graph)
 static
 bt_graph *create_graph(void)
 {
-       bt_graph *graph = bt_graph_create();
+       bt_graph *graph = bt_graph_create(0);
        int ret;
 
        BT_ASSERT(graph);
@@ -488,7 +488,7 @@ void test_src_adds_port_in_port_connected(void)
        const bt_port *gsrc_hello_port;
        const bt_port *gsink_def_port;
        struct event event;
-       bt_graph_status status;
+       bt_graph_connect_ports_status status;
        size_t src_port_connected_pos;
        size_t sink_port_connected_pos;
        size_t graph_ports_connected_pos;
@@ -593,7 +593,7 @@ void test_simple(void)
        const bt_port *gsrc_def_port;
        const bt_port *gsink_def_port;
        struct event event;
-       bt_graph_status status;
+       bt_graph_connect_ports_status status;
        size_t src_port_connected_pos;
        size_t sink_port_connected_pos;
        size_t graph_ports_connected_pos;
@@ -682,7 +682,7 @@ void test_src_port_connected_error(void)
        const bt_port *gsink_def_port;
        const bt_connection *conn = NULL;
        struct event event;
-       bt_graph_status status;
+       bt_graph_connect_ports_status status;
 
        prepare_test(TEST_SRC_PORT_CONNECTED_ERROR, "port connected error: source");
        graph = create_graph();
@@ -697,8 +697,9 @@ void test_src_port_connected_error(void)
        BT_ASSERT(sink_def_port);
        status = bt_graph_connect_ports(graph, src_def_port,
                sink_def_port, &conn);
-       ok(status != BT_GRAPH_STATUS_OK,
+       ok(status != BT_GRAPH_CONNECT_PORTS_STATUS_OK,
                "bt_graph_connect_ports() returns an error");
+       bt_current_thread_clear_error();
        ok(!conn, "returned connection is still NULL");
        gsrc = bt_component_source_as_component_const(src);
        gsink = bt_component_sink_as_component_const(sink);
@@ -747,7 +748,7 @@ void test_sink_port_connected_error(void)
        const bt_port *gsink_def_port;
        const bt_connection *conn = NULL;
        struct event event;
-       bt_graph_status status;
+       bt_graph_connect_ports_status status;
 
        prepare_test(TEST_SINK_PORT_CONNECTED_ERROR, "port connected error: sink");
        graph = create_graph();
@@ -762,8 +763,9 @@ void test_sink_port_connected_error(void)
        BT_ASSERT(sink_def_port);
        status = bt_graph_connect_ports(graph, src_def_port,
                sink_def_port, &conn);
-       ok(status != BT_GRAPH_STATUS_OK,
+       ok(status != BT_GRAPH_CONNECT_PORTS_STATUS_OK,
                "bt_graph_connect_ports() returns an error");
+       bt_current_thread_clear_error();
        ok(!conn, "returned connection is still NULL");
        gsrc = bt_component_source_as_component_const(src);
        gsink = bt_component_sink_as_component_const(sink);
This page took 0.027183 seconds and 4 git commands to generate.