+ append_test_event(&test_event);
+}
+
+static
+enum bt_component_status sink_consume(
+ struct bt_private_component *priv_component)
+{
+ enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
+ bt_notification_array notifications = NULL;
+ uint64_t count;
+ struct sink_user_data *user_data =
+ bt_private_component_get_user_data(priv_component);
+ enum bt_notification_iterator_status it_ret;
+ struct test_event test_event;
+ bool do_append_test_event = true;
+ uint64_t i;
+
+ BT_ASSERT(user_data && user_data->notif_iter);
+ it_ret = bt_private_connection_notification_iterator_next(
+ user_data->notif_iter, ¬ifications, &count);
+ if (it_ret < 0) {
+ ret = BT_COMPONENT_STATUS_ERROR;
+ do_append_test_event = false;
+ goto end;
+ }
+
+ switch (it_ret) {
+ case BT_NOTIFICATION_ITERATOR_STATUS_END:
+ test_event.type = TEST_EV_TYPE_END;
+ ret = BT_COMPONENT_STATUS_END;
+ BT_PUT(user_data->notif_iter);
+ goto end;
+ case BT_NOTIFICATION_ITERATOR_STATUS_AGAIN:
+ test_event.type = TEST_EV_TYPE_AGAIN;
+ ret = BT_COMPONENT_STATUS_AGAIN;
+ goto end;
+ default:
+ break;
+ }
+
+ BT_ASSERT(notifications);
+
+ for (i = 0; i < count; i++) {
+ append_test_event_from_notification(notifications[i]);
+ bt_put(notifications[i]);
+ }
+
+ do_append_test_event = false;
+