Tests: erroneous usage of if preprocessor directive
[babeltrace.git] / tests / lib / test-plugin-plugins / sfs.c
index ba8dcba1a979785cb95b5224310e4f5793f55c8f..c17f078b8fd172494e9aa0bb143cdf0bb8a1c5f8 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #include <babeltrace/plugin/plugin-dev.h>
-#include <babeltrace/component/component-class.h>
+#include <babeltrace/graph/component-class.h>
 #include <babeltrace/values.h>
 #include <babeltrace/ref.h>
 #include <assert.h>
@@ -28,9 +28,8 @@ static enum bt_component_status sink_consume(
 }
 
 static enum bt_notification_iterator_status dummy_iterator_init_method(
-               struct bt_private_component *private_component,
-               struct bt_private_port *private_port,
-               struct bt_private_notification_iterator *private_iterator)
+               struct bt_private_notification_iterator *private_iterator,
+               struct bt_private_port *private_port)
 {
        return BT_NOTIFICATION_ITERATOR_STATUS_OK;
 }
@@ -40,16 +39,15 @@ static void dummy_iterator_finalize_method(
 {
 }
 
-static struct bt_notification *dummy_iterator_get_method(
+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,
+       };
 
-static enum bt_notification_iterator_status dummy_iterator_next_method(
-               struct bt_private_notification_iterator *private_iterator)
-{
-       return BT_NOTIFICATION_ITERATOR_STATUS_OK;
+       return next_return;
 }
 
 static enum bt_notification_iterator_status dummy_iterator_seek_time_method(
@@ -74,14 +72,14 @@ static struct bt_value *query_method(
        return results;
 }
 
+BT_PLUGIN_MODULE();
 BT_PLUGIN(test_sfs);
 BT_PLUGIN_DESCRIPTION("Babeltrace plugin with source, sink, and filter component classes");
 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);
@@ -99,8 +97,7 @@ BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(sink,
        "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);
This page took 0.024347 seconds and 4 git commands to generate.