mdbx: refine testing-jitter, add MDBX_DBG_JITTER.

Change-Id: Ibc3bd8a16626e97aabc2cc544a3803f2e2bc3a10
This commit is contained in:
Leonid Yuriev 2017-06-06 03:10:52 +03:00 committed by Leo Yuriev
parent 009618560f
commit e7ee0bc762
3 changed files with 4 additions and 2 deletions

1
mdbx.h
View File

@ -1550,6 +1550,7 @@ LIBMDBX_API MDBX_oom_func *mdbx_env_get_oomfunc(MDBX_env *env);
#define MDBX_DBG_TRACE 4
#define MDBX_DBG_EXTRA 8
#define MDBX_DBG_AUDIT 16
#define MDBX_DBG_JITTER 32
typedef void MDBX_debug_func(int type, const char *function, int line,
const char *msg, va_list args);

View File

@ -792,7 +792,8 @@ void mdbx_panic(const char *fmt, ...)
static __inline void mdbx_jitter4testing(bool tiny) {
#ifndef NDEBUG
mdbx_osal_jitter(tiny);
if (MDBX_DBG_JITTER & mdbx_runtime_flags)
mdbx_osal_jitter(tiny);
#else
(void)tiny;
#endif

View File

@ -114,7 +114,7 @@ void testcase::db_prepare() {
log_trace(">> db_prepare");
assert(!db_guard);
int mdbx_dbg_opts = MDBX_DBG_ASSERT;
int mdbx_dbg_opts = MDBX_DBG_ASSERT | MDBX_DBG_JITTER;
if (config.params.loglevel <= logging::trace)
mdbx_dbg_opts |= MDBX_DBG_TRACE;
if (config.params.loglevel <= logging::verbose)