src: add ASSERT_EQ style macros

Add ASSERT counterparts to the CHECK_EQ/CHECK_NE/etc. family of macros.

PR-URL: https://github.com/iojs/io.js/pull/529
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
This commit is contained in:
Ben Noordhuis committed 2015-01-21 00:11:36 +01:00
1 parent ee9cd004d8
commit e95cfe14e3
2 files changed
+8 -1

No files matched your search

+1 -1
View File
@@ -639,7 +639,7 @@ class ECDH : public BaseObject {
key_(key),
group_(EC_KEY_get0_group(key_)) {
MakeWeak<ECDH>(this);
ASSERT(group_ != nullptr);
ASSERT_NE(group_, nullptr);
}
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
+7
View File
@@ -29,6 +29,13 @@ namespace node {
# define CHECK(expression) assert(expression)
#endif
#define ASSERT_EQ(a, b) ASSERT((a) == (b))
#define ASSERT_GE(a, b) ASSERT((a) >= (b))
#define ASSERT_GT(a, b) ASSERT((a) > (b))
#define ASSERT_LE(a, b) ASSERT((a) <= (b))
#define ASSERT_LT(a, b) ASSERT((a) < (b))
#define ASSERT_NE(a, b) ASSERT((a) != (b))
#define CHECK_EQ(a, b) CHECK((a) == (b))
#define CHECK_GE(a, b) CHECK((a) >= (b))
#define CHECK_GT(a, b) CHECK((a) > (b))