aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-11-29 13:14:29 +0000
committerlloyd <[email protected]>2010-11-29 13:14:29 +0000
commit40e1662d627e2c0c5a15ee35b7b2b225d52ac778 (patch)
tree75793d377fd92a6d0d103c59459e5d0db0b6002b
parenta532337570d4eebb9fef9fa126b8e7de20615571 (diff)
Add assert equal
-rw-r--r--src/utils/assert.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/utils/assert.h b/src/utils/assert.h
index d84f5c7ad..67ca665e3 100644
--- a/src/utils/assert.h
+++ b/src/utils/assert.h
@@ -16,14 +16,24 @@ void assertion_failure(const char* expr_str,
const char* file,
int line);
-#define BOTAN_ASSERT(expr, msg) \
- do { \
- if(!(expr)) \
- Botan::assertion_failure(#expr, \
- msg, \
- BOTAN_ASSERT_FUNCTION, \
- __FILE__, \
- __LINE__); \
+#define BOTAN_ASSERT(expr, msg) \
+ do { \
+ if(!(expr)) \
+ Botan::assertion_failure(#expr, \
+ msg, \
+ BOTAN_ASSERT_FUNCTION, \
+ __FILE__, \
+ __LINE__); \
+ } while(0)
+
+#define BOTAN_ASSERT_EQUAL(value1, value2, msg) \
+ do { \
+ if(value1 != value2) \
+ Botan::assertion_failure(#value1 " == " #value2, \
+ msg, \
+ BOTAN_ASSERT_FUNCTION, \
+ __FILE__, \
+ __LINE__); \
} while(0)
/*