}
if (method) {
+ const bt_error *saved_error;
+
+ saved_error = bt_current_thread_take_error();
+
BT_LIB_LOGD("Calling user's finalization method: %!+i",
iterator);
method(iterator);
+
+ if (saved_error) {
+ BT_CURRENT_THREAD_MOVE_ERROR_AND_RESET(saved_error);
+ }
}
/* Detach upstream message iterators */
upstream_port);
BT_LOGD("User method returned: status=%s",
bt_common_func_status_string(iter_status));
+ BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(iter_status);
if (iter_status != BT_FUNC_STATUS_OK) {
BT_LIB_LOGW_APPEND_CAUSE(
"Component input port message iterator initialization method failed: "
struct bt_self_component_port_input *input_port,
struct bt_self_component_port_input_message_iterator **message_iterator)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(self_msg_iter, "Message iterator");
return create_self_component_input_port_message_iterator(self_msg_iter,
input_port, message_iterator);
struct bt_self_component_port_input *input_port,
struct bt_self_component_port_input_message_iterator **message_iterator)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(self_comp, "Sink component");
return create_self_component_input_port_message_iterator(NULL,
input_port, message_iterator);
goto end;
}
- clock_snapshot_status = bt_clock_snapshot_get_ns_from_origin(clock_snapshot, &ns_from_origin);
+ clock_snapshot_status = bt_clock_snapshot_get_ns_from_origin(
+ clock_snapshot, &ns_from_origin);
if (clock_snapshot_status != BT_FUNC_STATUS_OK) {
+ /*
+ * bt_clock_snapshot_get_ns_from_origin can return
+ * OVERFLOW_ERROR. We don't really want to report an error to
+ * our caller, so just clear it.
+ */
+ bt_current_thread_clear_error();
goto end;
}
"Clock snapshots are not monotonic");
}
+ BT_ASSERT_POST_DEV_NO_ERROR_IF_NO_ERROR_STATUS(status);
+
return status;
}
{
enum bt_message_iterator_next_status status = BT_FUNC_STATUS_OK;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_DEV_NON_NULL(msgs, "Message array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(user_count, "Message count (output)");
{
enum bt_message_iterator_can_seek_ns_from_origin_status status;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_NON_NULL(can_seek, "Result (output)");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
status = (int) iterator->methods.can_seek_ns_from_origin(iterator,
ns_from_origin, can_seek);
+ BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(status);
+
if (status != BT_FUNC_STATUS_OK) {
BT_LIB_LOGW_APPEND_CAUSE(
"Component input port message iterator's \"can seek nanoseconds from origin\" method failed: "
{
enum bt_message_iterator_can_seek_beginning_status status;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_NON_NULL(can_seek, "Result (output)");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
*can_seek == BT_FALSE,
"Unexpected boolean value returned from user's \"can seek beginning\" method: val=%d, %![iter-]+i",
*can_seek, iterator);
+ BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(status);
} else {
*can_seek = BT_FALSE;
status = BT_FUNC_STATUS_OK;
{
int status;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
status == BT_FUNC_STATUS_AGAIN,
"Unexpected status: %![iter-]+i, status=%s",
iterator, bt_common_func_status_string(status));
+ BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(status);
if (status < 0) {
BT_LIB_LOGW_APPEND_CAUSE(
"Component input port message iterator's \"seek beginning\" method failed: "
GHashTable *stream_states = NULL;
bt_bool can_seek_by_itself;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
status == BT_FUNC_STATUS_AGAIN,
"Unexpected status: %![iter-]+i, status=%s",
iterator, bt_common_func_status_string(status));
+ BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS(status);
if (status < 0) {
BT_LIB_LOGW_APPEND_CAUSE(
"Component input port message iterator's \"seek nanoseconds from origin\" method failed: "