Fix: lib: assert if an error occurs in `bt_message_iterator_class_finalize_method`
I tried to append an error with `BT_COMP_LOGE_APPEND_CAUSE_ERRNO`
in `bt_message_iterator_class_finalize_method` from a plugin, and
there was no error. The expected behavior would be for the plugin
to fail if there is an error on the current thread after returning.
This patch adds `BT_ASSERT_POST_NO_ERROR` and the assert fails if
there is an error on the current thread after returning
With this patch, here is the following output, which is the expected behavior:
10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND bt_lib_assert_cond_failed@assert-cond.c:64 Babeltrace 2 library postcondition not satisfied.
10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND bt_lib_assert_cond_failed@assert-cond.c:66 ------------------------------------------------------------------------
10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND bt_lib_assert_cond_failed@assert-cond.c:67 Condition ID: `post:message-iterator-class-finalize-method:no-error`.
10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND bt_lib_assert_cond_failed@assert-cond.c:69 Function: bt_message_iterator_class_finalize_method().
10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND bt_lib_assert_cond_failed@assert-cond.c:70 ------------------------------------------------------------------------
10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND bt_lib_assert_cond_failed@assert-cond.c:71 Error is:
10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND bt_lib_assert_cond_failed@assert-cond.c:73 Current thread has an error
10-16 14:18:05.890 51873 51873 F LIB/ASSERT-COND bt_lib_assert_cond_failed@assert-cond.c:76 Aborting...
Add `BT_ASSERT_POST_NO_ERROR` after calling the method.
Signed-off-by: Philippe Duplessis-Guindon <pduplessis@efficios.com>
Change-Id: I6cf6118661cbe615c1f6ddc77c8b3555dca3b526
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4201
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.026861 seconds and 4 git commands to generate.