ss_dassert() no longer uses skygw_log_write.

Use of skygw_log_write() in ss_dassert and ss_info_dassert replaced
with the use of MXS_ERROR(). In addition, ss_dassert and ss_info_dassert
are now expressions that require a trailing ;.
This commit is contained in:
Johan Wikman
2015-11-18 14:46:24 +02:00
parent cbeead7c43
commit 3e3770fa82
2 changed files with 7 additions and 9 deletions

View File

@ -59,7 +59,7 @@ int result, count;
"testusers : Initialise the user table.");
users = users_alloc();
mxs_log_flush_sync();
ss_info_dassert(NULL != users, "Allocating user table should not return NULL.")
ss_info_dassert(NULL != users, "Allocating user table should not return NULL.");
ss_dfprintf(stderr, "\t..done\nAdd a user");
count = users_add(users, "username", "authorisation");
mxs_log_flush_sync();

View File

@ -52,14 +52,12 @@
#if defined(SS_DEBUG) && defined(LOG_ASSERT)
#include <log_manager.h>
# define ss_dassert(exp) if(!(exp)){(skygw_log_write(LE,\
"debug assert %s:%d\n", \
(char*)__FILE__, \
__LINE__));mxs_log_flush_sync();assert(exp);}
#define ss_info_dassert(exp,info) if(!(exp)){(skygw_log_write(LE,\
"debug assert %s:%d %s\n", \
(char*)__FILE__, \
__LINE__,info));mxs_log_flush_sync();assert(exp);}
# define ss_dassert(exp) do { if(!(exp)){\
MXS_ERROR("debug assert %s:%d\n", (char*)__FILE__, __LINE__);\
mxs_log_flush_sync(); assert(exp);} } while (false)
#define ss_info_dassert(exp,info) do { if(!(exp)){\
MXS_ERROR("debug assert %s:%d %s\n", (char*)__FILE__, __LINE__, info);\
mxs_log_flush_sync();assert(exp);} } while (false)
# define ss_debug(exp) exp
# define ss_dfprintf fprintf
# define ss_dfflush fflush