X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=tests%2Flib%2Ftest-plugin-plugins%2Fsfs.c;h=c8b81632a3106aa4c1d9ebfecb6b0cb4e57831a9;hb=bc1f90cd16b94e9e9127a7c5ea533c8f5ec129a0;hp=567a85f4d396398f2a3e0e6f92b9063b48ec3fef;hpb=bb61965be5ec1bfe6977d0eca85e2e83da65af5f;p=babeltrace.git diff --git a/tests/lib/test-plugin-plugins/sfs.c b/tests/lib/test-plugin-plugins/sfs.c index 567a85f4..c8b81632 100644 --- a/tests/lib/test-plugin-plugins/sfs.c +++ b/tests/lib/test-plugin-plugins/sfs.c @@ -15,65 +15,79 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include -#include -#include -#include -#include -#include -#include +#include +#include "common/assert.h" -static enum bt_self_component_status sink_consume( - struct bt_self_component_sink *self_comp) +static 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 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_component_class_get_supported_mip_versions_method_status +sink_get_supported_mip_versions( + bt_self_component_class_sink *source_component_class, + const bt_value *params, void *initialize_method_data, + bt_logging_level logging_level, + bt_integer_range_set_unsigned *supported_versions) { - return BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK; + return (int) bt_integer_range_set_unsigned_add_range( + supported_versions, 0, 0); } -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_message_iterator_class_initialize_method_status +src_dummy_iterator_init_method( + bt_self_message_iterator *self_msg_iter, + bt_self_message_iterator_configuration *config, + bt_self_component_port_output *self_port) { - return BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK; + return BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_OK; +} + +static bt_message_iterator_class_initialize_method_status +flt_dummy_iterator_init_method( + bt_self_message_iterator *self_msg_iter, + bt_self_message_iterator_configuration *config, + bt_self_component_port_output *self_port) +{ + return BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_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_message_iterator_class_next_method_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_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_OK; } -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_component_class_query_method_status flt_query_method( + bt_self_component_class_filter *component_class, + bt_private_query_executor *priv_query_exec, + const char *object, const bt_value *params, + __attribute__((unused)) void *method_data, + const bt_value **result) { - struct bt_private_value *res = bt_private_value_array_create(); - *result = bt_private_value_as_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); - return BT_QUERY_STATUS_OK; + bt_value_put_ref(val); + return BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK; } BT_PLUGIN_MODULE(); @@ -85,9 +99,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_CLASS_INITIALIZE_METHOD(source, src_dummy_iterator_init_method); -BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(source, +BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD(source, dummy_iterator_finalize_method); BT_PLUGIN_SINK_COMPONENT_CLASS(sink, sink_consume); @@ -98,11 +112,13 @@ BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(sink, "venison tenderloin cow tail. Beef short loin shoulder meatball, sirloin\n" "ground round brisket salami cupim pork bresaola turkey bacon boudin.\n" ); +BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(sink, + sink_get_supported_mip_versions); 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_CLASS_INITIALIZE_METHOD(filter, flt_dummy_iterator_init_method); -BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(filter, +BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD(filter, dummy_iterator_finalize_method); BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(filter, flt_query_method);