X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Flib%2Ftest-plugin-plugins%2Fsfs.c;h=735bf2ae19a84047d3c09afe51d9a96ceccf3314;hb=b2e0c9076135f47110af2d96dfaee397c597bc90;hp=52d3bf9f2bba319658726e4819799e4f5dce1515;hpb=d3eb6e8fd59ebff26cb99a70d375e542d49575a3;p=babeltrace.git diff --git a/tests/lib/test-plugin-plugins/sfs.c b/tests/lib/test-plugin-plugins/sfs.c index 52d3bf9f..735bf2ae 100644 --- a/tests/lib/test-plugin-plugins/sfs.c +++ b/tests/lib/test-plugin-plugins/sfs.c @@ -16,41 +16,60 @@ */ #include -#include +#include +#include +#include +#include -static enum bt_component_status sink_consume(struct bt_component *component) +static enum bt_component_status sink_consume( + struct bt_private_component *private_component) { return BT_COMPONENT_STATUS_OK; } static enum bt_notification_iterator_status dummy_iterator_init_method( - struct bt_component *component, - struct bt_notification_iterator *iterator) + struct bt_private_notification_iterator *private_iterator, + struct bt_private_port *private_port) { return BT_NOTIFICATION_ITERATOR_STATUS_OK; } -static void dummy_iterator_destroy_method( - struct bt_notification_iterator *iterator) +static void dummy_iterator_finalize_method( + struct bt_private_notification_iterator *private_iterator) { } -static struct bt_notification *dummy_iterator_get_method( - struct bt_notification_iterator *iterator) +static struct bt_notification_iterator_next_return dummy_iterator_next_method( + struct bt_private_notification_iterator *private_iterator) { - return NULL; + struct bt_notification_iterator_next_return next_return = { + .notification = NULL, + .status = BT_NOTIFICATION_ITERATOR_STATUS_OK, + }; + + return next_return; } -static enum bt_notification_iterator_status dummy_iterator_next_method( - struct bt_notification_iterator *iterator) +static enum bt_notification_iterator_status dummy_iterator_seek_time_method( + struct bt_private_notification_iterator *private_iterator, + int64_t time) { return BT_NOTIFICATION_ITERATOR_STATUS_OK; } -static enum bt_notification_iterator_status dummy_iterator_seek_time_method( - struct bt_notification_iterator *iterator, int64_t time) +static struct bt_value *query_method( + struct bt_component_class *component_class, + const char *object, struct bt_value *params) { - return BT_NOTIFICATION_ITERATOR_STATUS_OK; + int ret; + struct bt_value *results = bt_value_array_create(); + + assert(results); + ret = bt_value_array_append_string(results, object); + assert(ret == 0); + ret = bt_value_array_append(results, params); + assert(ret == 0); + return results; } BT_PLUGIN(test_sfs); @@ -59,25 +78,30 @@ BT_PLUGIN_AUTHOR("Janine Sutto"); BT_PLUGIN_LICENSE("Beerware"); BT_PLUGIN_VERSION(1, 2, 3, "yes"); -BT_PLUGIN_SOURCE_COMPONENT_CLASS(source, dummy_iterator_get_method, - dummy_iterator_next_method); +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, dummy_iterator_init_method); -BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD(source, - dummy_iterator_destroy_method); +BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(source, + dummy_iterator_finalize_method); BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(source, dummy_iterator_seek_time_method); BT_PLUGIN_SINK_COMPONENT_CLASS(sink, sink_consume); BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(sink, "A sink."); +BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(sink, + "Bacon ipsum dolor amet strip steak cupim pastrami venison shoulder.\n" + "Prosciutto beef ribs flank meatloaf pancetta brisket kielbasa drumstick\n" + "venison tenderloin cow tail. Beef short loin shoulder meatball, sirloin\n" + "ground round brisket salami cupim pork bresaola turkey bacon boudin.\n" +); -BT_PLUGIN_FILTER_COMPONENT_CLASS(filter, dummy_iterator_get_method, - dummy_iterator_next_method); +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, dummy_iterator_init_method); -BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD(filter, - dummy_iterator_destroy_method); +BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(filter, + dummy_iterator_finalize_method); BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(filter, dummy_iterator_seek_time_method); +BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(filter, query_method);