ztest: add assert_not_equal()
Assertion for complementing assert_equal() Change-Id: Ie3066f3b00ea3145a62ffb7e0d6c2c4de1719b4c Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
This commit is contained in:
parent
90e6e9b7f6
commit
f37065bf84
|
@ -135,6 +135,17 @@ static inline void _assert(int cond, const char *msg, const char *default_msg,
|
|||
*/
|
||||
#define assert_equal(a, b, msg) assert((a) == (b), msg, #a " not equal to " #b)
|
||||
|
||||
/**
|
||||
* @brief Assert that @a a does not equal @a b
|
||||
*
|
||||
* @a a and @a b won't be converted and will be compared directly.
|
||||
*
|
||||
* @param a Value to compare
|
||||
* @param b Value to compare
|
||||
* @param msg Optional message to print if the assertion fails
|
||||
*/
|
||||
#define assert_not_equal(a, b, msg) assert((a) != (b), msg, #a " equal to " #b)
|
||||
|
||||
/**
|
||||
* @brief Assert that @a a equals @a b
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue