Expectation handling support functionality. More...
Macros | |
#define | MCUX_CSSL_FP_EXPECTATIONS(...) |
Expectation aggregation. | |
#define | MCUX_CSSL_FP_VOID_EXPECTATION_IMPL() |
Implementation of expectation of nothing. | |
#define | MCUX_CSSL_FP_EXPECT_IMPL(...) |
Declaration(s) of expected code flow behavior. | |
#define | MCUX_CSSL_FP_ASSERT_CALLBACK() |
Fallback assert callback implementation. | |
#define | MCUX_CSSL_FP_ASSERT_IMPL(...) |
Assert an expected state of the code flow. | |
Expectation handling support functionality.
#define MCUX_CSSL_FP_EXPECTATIONS | ( | ... | ) |
Expectation aggregation.
expect | One or more (comma separated) declarations of expected code flow behavior. |
#define MCUX_CSSL_FP_VOID_EXPECTATION_IMPL | ( | ) |
Implementation of expectation of nothing.
This expectation macro indicates to the flow protection mechanism that nothing is expected to happen. This is mainly intended for internal use (to ensure at least one expectation is passed).
#define MCUX_CSSL_FP_EXPECT_IMPL | ( | ... | ) |
Declaration(s) of expected code flow behavior.
This macro can be used to indicate expectations in the function body at another location than the function entry or exit.
expect | One or more (comma separated) declarations of expected code flow behavior. |
#define MCUX_CSSL_FP_ASSERT_CALLBACK | ( | ) |
Fallback assert callback implementation.
This macro will be executed if an MCUX_CSSL_FP_ASSERT fails. In general this behavior should be defined by the user. This implementation is only in place to ensure that an implementation is always available.
This is implemented a division by 0, which should trigger a compiler warning when used, to inform the user that the default implementation is used. Additionally, when still used at run-time it should trigger some system exception.
#define MCUX_CSSL_FP_ASSERT_IMPL | ( | ... | ) |
Assert an expected state of the code flow.
This macro can be used to check whether the code flow up to this point matches the expected state. Unlike the MCUX_CSSL_FP_EXPECT macro, it will not update the expectations, but merely perform a check on the recorded events against the already recorded expectations plus the ones provided as parameters.
If the check fails, the code defined in MCUX_CSSL_FP_ASSERT_CALLBACK will be executed.
expect | One or more (comma separated) declarations of expected code flow behavior. |