Skip to content

Commit 294ee78

Browse files
authored
add Null reply assertion macro to rm_utils (RMUtil_AssertNullReply)
1 parent f0f9eff commit 294ee78

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rmutil/test_util.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
#define RMUtil_Assert(expr) if (!(expr)) { fprintf (stderr, "Assertion '%s' Failed\n", __STRING(expr)); return REDISMODULE_ERR; }
2121

22+
#define #define RMUtil_AssertNullReply(rep) RMUtil_Assert(RedisModule_CreateStringFromCallReply(rep) == NULL)
23+
2224
#define RMUtil_AssertReplyEquals(rep, cstr) RMUtil_Assert( \
2325
RMUtil_StringEquals(RedisModule_CreateStringFromCallReply(rep), RedisModule_CreateString(ctx, cstr, strlen(cstr))) \
2426
)
@@ -64,4 +66,4 @@ RedisModuleString **RMUtil_MakeArgs(RedisModuleCtx *ctx, int *argcp, const char
6466
return NULL;
6567
}
6668

67-
#endif
69+
#endif

0 commit comments

Comments
 (0)