Added bool type assert

This commit is contained in:
Leonardo committed 2019-07-12 23:33:35 -03:00
1 parent 9eb8d5f682
commit e37b54fc62
1 file changed
+33
+33
View File
@@ -38,6 +38,7 @@
* - float
* - double
* - ptr
* - bool (only for equals and not_equals)
*
*/
@@ -369,6 +370,22 @@
\
} while (0)
#define cmc_assert_equals__Bool(expected, actual) \
do \
{ \
const char *str = #actual; \
bool expected_ = (expected); \
bool actual_ = (actual); \
\
if ((expected_) != (actual_)) \
{ \
fprintf(stderr, \
"Assertion Failed at %s:%s:%u for { %s }: Expected: %d Actual: %d\n", \
__FILE__, __func__, __LINE__, str, expected_, actual_); \
} \
\
} while (0)
#define cmc_assert_not_equals_int8_t(not_expected, actual) \
do \
{ \
@@ -593,6 +610,22 @@
\
} while (0)
#define cmc_assert_not_equals__Bool(expected, actual) \
do \
{ \
const char *str = #actual; \
bool expected_ = (expected); \
bool actual_ = (actual); \
\
if ((expected_) != (actual_)) \
{ \
fprintf(stderr, \
"Assertion Failed at %s:%s:%u for { %s }: Not Expected: %d Actual: %d\n", \
__FILE__, __func__, __LINE__, str, expected_, actual_); \
} \
\
} while (0)
#define cmc_assert_greater_int8_t(boundary, actual) \
do \
{ \