X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=tests%2Flib%2Ftest_graph_topo.c;h=fedbdd03a97b8f2a8875e15abfaa5ba78f24c91e;hb=abb3ec0723e65c1c624178312367dff584cec214;hp=e0ea4258158c143a82dd6b44183e950f9eb8c5e9;hpb=aa23edf1331e2ef493dec03eccdfe28ca361be9b;p=babeltrace.git diff --git a/tests/lib/test_graph_topo.c b/tests/lib/test_graph_topo.c index e0ea4258..fedbdd03 100644 --- a/tests/lib/test_graph_topo.c +++ b/tests/lib/test_graph_topo.c @@ -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,15 +286,16 @@ 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_initialize_method_status src_init( bt_self_component_source *self_comp, + bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data) { int ret; @@ -302,12 +303,13 @@ 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_INITIALIZE_METHOD_STATUS_OK; } static -bt_self_component_status sink_init( +bt_component_class_initialize_method_status sink_init( bt_self_component_sink *self_comp, + bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data) { int ret; @@ -315,18 +317,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_INITIALIZE_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 +342,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 +360,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 +386,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 @@ -395,7 +397,7 @@ void init_test(void) src_comp_class = bt_component_class_source_create( "src", src_iter_next); BT_ASSERT(src_comp_class); - ret = bt_component_class_source_set_init_method( + ret = bt_component_class_source_set_initialize_method( src_comp_class, src_init); BT_ASSERT(ret == 0); ret = bt_component_class_source_set_output_port_connected_method( @@ -404,7 +406,7 @@ void init_test(void) sink_comp_class = bt_component_class_sink_create("sink", sink_consume); BT_ASSERT(sink_comp_class); - ret = bt_component_class_sink_set_init_method(sink_comp_class, + ret = bt_component_class_sink_set_initialize_method(sink_comp_class, sink_init); BT_ASSERT(ret == 0); ret = bt_component_class_sink_set_input_port_connected_method( @@ -449,7 +451,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 +490,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 +595,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 +684,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 +699,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 +750,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 +765,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);