Customizable QP assertions. More...
Go to the source code of this file.
Defines | |
| #define | Q_DEFINE_THIS_FILE static char const Q_ROM Q_ROM_VAR l_this_file[] = __FILE__; |
| #define | Q_DEFINE_THIS_MODULE(name_) static char const Q_ROM Q_ROM_VAR l_this_file[] = #name_; |
| #define | Q_ASSERT(test_) |
| #define | Q_ALLEGE(test_) Q_ASSERT(test_) |
| #define | Q_ERROR() (Q_onAssert(l_this_file, __LINE__)) |
| #define | Q_REQUIRE(test_) Q_ASSERT(test_) |
| #define | Q_ENSURE(test_) Q_ASSERT(test_) |
| #define | Q_INVARIANT(test_) Q_ASSERT(test_) |
| #define | Q_ASSERT_COMPILE(test_) extern char Q_assert_compile[(test_) ? 1 : -1] |
Functions | |
| void | Q_onAssert (char const Q_ROM *const Q_ROM_VAR file, int line) |
Customizable QP assertions.
Defines customizable and memory-efficient assertions applicable to embedded systems. This header file can be used in C, C++, and mixed C/C++ programs.
Definition in file qassert.h.
| #define Q_ALLEGE | ( | test_ | ) | Q_ASSERT(test_) |
General purpose assertion that ALWAYS evaluates the test_ argument and calls the Q_onAssert() callback if the test_ evaluates to FALSE.
Definition at line 108 of file qassert.h.
Referenced by QFsm_init(), and QHsm_init().
| #define Q_ASSERT | ( | test_ | ) |
if (test_) { \ } \ else (Q_onAssert(l_this_file, __LINE__))
General purpose assertion that makes sure the test_ argument is TRUE. Calls the Q_onAssert() callback if the test_ evaluates to FALSE.
Definition at line 95 of file qassert.h.
Referenced by QActive_postFIFO(), QActive_postLIFO(), QActive_start(), QEQueue_postFIFO(), QEQueue_postLIFO(), QF_gc(), QF_new_(), QF_publish(), QHsm_dispatch(), QHsm_init(), and QMPool_init().
| #define Q_ASSERT_COMPILE | ( | test_ | ) | extern char Q_assert_compile[(test_) ? 1 : -1] |
| #define Q_DEFINE_THIS_FILE static char const Q_ROM Q_ROM_VAR l_this_file[] = __FILE__; |
| #define Q_DEFINE_THIS_MODULE | ( | name_ | ) | static char const Q_ROM Q_ROM_VAR l_this_file[] = #name_; |
| #define Q_ENSURE | ( | test_ | ) | Q_ASSERT(test_) |
| #define Q_ERROR | ( | ) | (Q_onAssert(l_this_file, __LINE__)) |
Assertion that always calls the Q_onAssert() callback if ever executed.
| #define Q_INVARIANT | ( | test_ | ) | Q_ASSERT(test_) |
| #define Q_REQUIRE | ( | test_ | ) | Q_ASSERT(test_) |
Assertion that checks for a precondition. This macro is equivalent to Q_ASSERT, except the name provides a better documentation of the intention of this assertion.
Definition at line 123 of file qassert.h.
Referenced by QActive_start(), QActive_subscribe(), QActive_unsubscribe(), QActive_unsubscribeAll(), QF_add_(), QF_getPoolMargin(), QF_getQueueMargin(), QF_poolInit(), QF_publish(), QF_remove_(), QMPool_init(), QMPool_put(), QTimeEvt_arm_(), QTimeEvt_ctor(), and QTimeEvt_rearm().
1.6.3