mdbx-test: fix MSVC warnings (minor).

This commit is contained in:
Leonid Yuriev 2019-10-10 00:57:22 +03:00
parent 95bb371b0d
commit e5bd1a6d6f
3 changed files with 9 additions and 10 deletions

View File

@ -15,7 +15,6 @@
#include "test.h"
bool testcase_append::run() {
MDBX_dbi dbi;
int err = db_open__begin__table_create_open_clean(dbi);
if (unlikely(err != MDBX_SUCCESS)) {
log_notice("append: bailout-prepare due '%s'", mdbx_strerror(err));

View File

@ -232,18 +232,18 @@ void testcase::txn_end(bool abort) {
log_trace("<< txn_end(%s)", abort ? "abort" : "commit");
}
void testcase::cursor_open(unsigned dbi) {
log_trace(">> cursor_open(%u)", dbi);
void testcase::cursor_open(MDBX_dbi handle) {
log_trace(">> cursor_open(%u)", handle);
assert(!cursor_guard);
assert(txn_guard);
MDBX_cursor *cursor = nullptr;
int rc = mdbx_cursor_open(txn_guard.get(), dbi, &cursor);
int rc = mdbx_cursor_open(txn_guard.get(), handle, &cursor);
if (unlikely(rc != MDBX_SUCCESS))
failure_perror("mdbx_cursor_open()", rc);
cursor_guard.reset(cursor);
log_trace("<< cursor_open(%u)", dbi);
log_trace("<< cursor_open(%u)", handle);
}
void testcase::cursor_close() {
@ -435,14 +435,14 @@ void testcase::update_canary(uint64_t increment) {
log_trace("<< update_canary: sequence = %" PRIu64, canary_now.y);
}
int testcase::db_open__begin__table_create_open_clean(MDBX_dbi &dbi) {
int testcase::db_open__begin__table_create_open_clean(MDBX_dbi &handle) {
db_open();
int err, retry_left = 42;
for (;;) {
txn_begin(false);
dbi = db_table_open(true);
db_table_clear(dbi);
handle = db_table_open(true);
db_table_clear(handle);
err = breakable_commit();
if (likely(err == MDBX_SUCCESS)) {
txn_begin(false);

View File

@ -175,7 +175,7 @@ protected:
void txn_end(bool abort);
int breakable_restart();
void txn_restart(bool abort, bool readonly, unsigned flags = 0);
void cursor_open(unsigned dbi);
void cursor_open(MDBX_dbi handle);
void cursor_close();
void txn_inject_writefault(void);
void txn_inject_writefault(MDBX_txn *txn);
@ -189,7 +189,7 @@ protected:
void db_table_drop(MDBX_dbi handle);
void db_table_clear(MDBX_dbi handle, MDBX_txn *txn = nullptr);
void db_table_close(MDBX_dbi handle);
int db_open__begin__table_create_open_clean(MDBX_dbi &dbi);
int db_open__begin__table_create_open_clean(MDBX_dbi &handle);
bool wait4start();
void report(size_t nops_done);