lib: add post condition assertions for current thread error after user functions
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 7 Nov 2019 23:18:06 +0000 (18:18 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 11 Nov 2019 18:53:12 +0000 (13:53 -0500)
It is a logic error and a post condition breach for a user function to
return a non-error status code (>= 0) but leave an error set on the
current thread.  Add some assertions after each point where we call a
user function to catch this kind of mistake.

The macro BT_ASSERT_POST_DEV_NO_ERROR_IF_NO_ERROR_STATUS is meant to be
used in the very fast path (consume/next callbacks).  The macro
BT_ASSERT_POST_NO_ERROR_IF_NO_ERROR_STATUS is used elsewhere.

The macros are written in such a way that if they cause an abort, the
error will still be present in thread_error, so accessible to a
debugger.

Change-Id: I4c6127c0b0258dac5be1e3bae63c2d9e6baa2d1f
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>

No differences found
This page took 0.025321 seconds and 4 git commands to generate.