Fix tests when assert() undefined
Closes #309 (such as when -DNDEBUG disables all assert() macros) Inspired by keith-bennett-gbg, but re-rewritten to be more concise.
This commit is contained in:
parent
6b122d43f9
commit
27076a3e6d
7
test.c
7
test.c
@ -43,6 +43,13 @@ static long long usec(void) {
|
||||
return (((long long)tv.tv_sec)*1000000)+tv.tv_usec;
|
||||
}
|
||||
|
||||
/* The assert() calls below have side effects, so we need assert()
|
||||
* even if we are compiling without asserts (-DNDEBUG). */
|
||||
#ifdef NDEBUG
|
||||
#undef assert
|
||||
#define assert(e) (void)(e)
|
||||
#endif
|
||||
|
||||
static redisContext *select_database(redisContext *c) {
|
||||
redisReply *reply;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user