Update test to accept flags instead of a bool

This commit is contained in:
James Rouzier
2017-10-25 19:54:40 -04:00
parent 7c466e53f0
commit 2f1f4b19a0
5 changed files with 25 additions and 25 deletions

View File

@@ -175,18 +175,18 @@ void testcase::db_close() {
log_trace("<< db_close");
}
void testcase::txn_begin(bool readonly) {
log_trace(">> txn_begin(%s)", readonly ? "read-only" : "read-write");
void testcase::txn_begin(unsigned flags) {
log_trace(">> txn_begin(%s)", flags & MDBX_RDONLY ? "read-only" : "read-write");
assert(!txn_guard);
MDBX_txn *txn = nullptr;
int rc =
mdbx_txn_begin(db_guard.get(), nullptr, readonly ? MDBX_RDONLY : 0, &txn);
mdbx_txn_begin(db_guard.get(), nullptr, flags, &txn);
if (unlikely(rc != MDBX_SUCCESS))
failure_perror("mdbx_txn_begin()", rc);
txn_guard.reset(txn);
log_trace("<< txn_begin(%s)", readonly ? "read-only" : "read-write");
log_trace("<< txn_begin(%s)", flags & MDBX_RDONLY ? "read-only" : "read-write");
}
void testcase::txn_end(bool abort) {
@@ -207,10 +207,10 @@ void testcase::txn_end(bool abort) {
log_trace("<< txn_end(%s)", abort ? "abort" : "commit");
}
void testcase::txn_restart(bool abort, bool readonly) {
void testcase::txn_restart(bool abort, unsigned flags) {
if (txn_guard)
txn_end(abort);
txn_begin(readonly);
txn_begin(flags);
}
bool testcase::wait4start() {