X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Flib%2Ftest-plugin-plugins%2Fsfs.c;h=e9080b7ed6a02591dcf0aca0a0d118cfe78b7b24;hb=7e69c04f557e46fb50e5a888a3bc3451afbd3b8e;hp=d58b8ea8919ead2e76dbb01dd70385a338b559b3;hpb=d94d92ac6656fd252a5d7bb4f6c76935ba18e62e;p=babeltrace.git diff --git a/tests/lib/test-plugin-plugins/sfs.c b/tests/lib/test-plugin-plugins/sfs.c index d58b8ea8..e9080b7e 100644 --- a/tests/lib/test-plugin-plugins/sfs.c +++ b/tests/lib/test-plugin-plugins/sfs.c @@ -15,64 +15,63 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include -#include -#include -#include -#include -#include +#include #include -static enum bt_self_component_status sink_consume( - struct bt_self_component_sink *self_comp) +static bt_self_component_status sink_consume( + bt_self_component_sink *self_comp) { return BT_SELF_COMPONENT_STATUS_OK; } -static enum bt_self_notification_iterator_status src_dummy_iterator_init_method( - struct bt_self_notification_iterator *self_notif_iter, - struct bt_self_component_source *self_comp, - struct bt_self_component_port_output *self_port) +static bt_self_message_iterator_status src_dummy_iterator_init_method( + bt_self_message_iterator *self_msg_iter, + bt_self_component_source *self_comp, + bt_self_component_port_output *self_port) { - return BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK; + return BT_SELF_MESSAGE_ITERATOR_STATUS_OK; } -static enum bt_self_notification_iterator_status flt_dummy_iterator_init_method( - struct bt_self_notification_iterator *self_notif_iter, - struct bt_self_component_filter *self_comp, - struct bt_self_component_port_output *self_port) +static bt_self_message_iterator_status flt_dummy_iterator_init_method( + bt_self_message_iterator *self_msg_iter, + bt_self_component_filter *self_comp, + bt_self_component_port_output *self_port) { - return BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK; + return BT_SELF_MESSAGE_ITERATOR_STATUS_OK; } static void dummy_iterator_finalize_method( - struct bt_self_notification_iterator *self_notif_iter) + bt_self_message_iterator *self_msg_iter) { } -static enum bt_self_notification_iterator_status dummy_iterator_next_method( - struct bt_self_notification_iterator *self_notif_iter, - bt_notification_array notifs, uint64_t capacity, +static bt_self_message_iterator_status dummy_iterator_next_method( + bt_self_message_iterator *self_msg_iter, + bt_message_array_const msgs, uint64_t capacity, uint64_t *count) { - return BT_SELF_NOTIFICATION_ITERATOR_STATUS_ERROR; + return BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR; } -static enum bt_query_status flt_query_method( - struct bt_self_component_class_filter *component_class, - struct bt_query_executor *query_exec, - const char *object, struct bt_value *params, - struct bt_value **result) +static bt_query_status flt_query_method( + bt_self_component_class_filter *component_class, + const bt_query_executor *query_exec, + const char *object, const bt_value *params, + const bt_value **result) { - struct bt_private_value *res = bt_private_value_array_create(); - *result = bt_private_value_borrow_value(res); + bt_value *res = bt_value_array_create(); + bt_value *val; + *result = res; int iret; BT_ASSERT(*result); - iret = bt_private_value_array_append_string_element(res, object); + iret = bt_value_array_append_string_element(res, object); + BT_ASSERT(iret == 0); + iret = bt_value_copy(params, &val); BT_ASSERT(iret == 0); - iret = bt_private_value_array_append_element(res, params); + iret = bt_value_array_append_element(res, val); BT_ASSERT(iret == 0); + bt_value_put_ref(val); return BT_QUERY_STATUS_OK; } @@ -85,9 +84,9 @@ BT_PLUGIN_VERSION(1, 2, 3, "yes"); BT_PLUGIN_SOURCE_COMPONENT_CLASS(source, dummy_iterator_next_method); BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(source, "A source."); -BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(source, +BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(source, src_dummy_iterator_init_method); -BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(source, +BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(source, dummy_iterator_finalize_method); BT_PLUGIN_SINK_COMPONENT_CLASS(sink, sink_consume); @@ -101,8 +100,8 @@ BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(sink, BT_PLUGIN_FILTER_COMPONENT_CLASS(filter, dummy_iterator_next_method); BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(filter, "A filter."); -BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(filter, +BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_INIT_METHOD(filter, flt_dummy_iterator_init_method); -BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(filter, +BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_FINALIZE_METHOD(filter, dummy_iterator_finalize_method); BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(filter, flt_query_method);