}
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)
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)
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;
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;
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)
{
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)
{
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,
append_event(&event);
- return BT_GRAPH_LISTENER_STATUS_OK;
+ return BT_GRAPH_LISTENER_FUNC_STATUS_OK;
}
static
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(
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(
static
bt_graph *create_graph(void)
{
- bt_graph *graph = bt_graph_create();
+ bt_graph *graph = bt_graph_create(0);
int ret;
BT_ASSERT(graph);
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;
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;
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();
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);
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();
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);