bt2: Adapt test_event_class.py and make it pass
[babeltrace.git] / lib / graph / component-class-sink-colander.c
index 36d764e3d5e0bdd68f35eea090cf17a3e84b6357..9a70f105218172060aa6f39d2ae3ce149abb53bb 100644 (file)
 static
 struct bt_component_class_sink *colander_comp_cls;
 
-struct colander_data {
-       bt_message_array_const msgs;
-       uint64_t *count_addr;
-       struct bt_self_component_port_input_message_iterator *msg_iter;
-};
-
 static
 enum bt_self_component_status colander_init(
                struct bt_self_component_sink *self_comp,
                const struct bt_value *params, void *init_method_data)
 {
        enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
-       struct colander_data *colander_data = NULL;
+       struct bt_component_class_sink_colander_priv_data *colander_data = NULL;
        struct bt_component_class_sink_colander_data *user_provided_data =
                init_method_data;
 
@@ -59,7 +53,8 @@ enum bt_self_component_status colander_init(
                goto end;
        }
 
-       colander_data = g_new0(struct colander_data, 1);
+       colander_data = g_new0(
+               struct bt_component_class_sink_colander_priv_data, 1);
        if (!colander_data) {
                BT_LOGE_STR("Failed to allocate colander data.");
                status = BT_SELF_COMPONENT_STATUS_NOMEM;
@@ -86,7 +81,7 @@ end:
 static
 void colander_finalize(struct bt_self_component_sink *self_comp)
 {
-       struct colander_data *colander_data =
+       struct bt_component_class_sink_colander_priv_data *colander_data =
                bt_self_component_get_data(
                        bt_self_component_sink_as_self_component(self_comp));
 
@@ -105,7 +100,7 @@ enum bt_self_component_status colander_input_port_connected(
                const struct bt_port_output *other_port)
 {
        enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
-       struct colander_data *colander_data =
+       struct bt_component_class_sink_colander_priv_data *colander_data =
                bt_self_component_get_data(
                        bt_self_component_sink_as_self_component(self_comp));
 
@@ -132,7 +127,7 @@ enum bt_self_component_status colander_consume(
 {
        enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
        enum bt_message_iterator_status msg_iter_status;
-       struct colander_data *colander_data =
+       struct bt_component_class_sink_colander_priv_data *colander_data =
                bt_self_component_get_data(
                        bt_self_component_sink_as_self_component(self_comp));
        bt_message_array_const msgs;
@@ -151,9 +146,6 @@ enum bt_self_component_status colander_consume(
                        colander_data->msg_iter, &msgs,
                        colander_data->count_addr);
        switch (msg_iter_status) {
-       case BT_MESSAGE_ITERATOR_STATUS_CANCELED:
-               status = BT_SELF_COMPONENT_STATUS_OK;
-               goto end;
        case BT_MESSAGE_ITERATOR_STATUS_AGAIN:
                status = BT_SELF_COMPONENT_STATUS_AGAIN;
                goto end;
This page took 0.024655 seconds and 4 git commands to generate.