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:
Inaky Perez-Gonzalez 2016-11-09 12:49:52 -08:00 committed by Anas Nashif
parent 90e6e9b7f6
commit f37065bf84

View file

@ -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
*